R. Sinas1, E. Papaioannou2, N. Karanikolas1, C. Kaklamanis2
Parallel computation is a core technology in the modern world, enabling faster and more efficient processing of complex tasks. Unlike sequential computing, where tasks are processed one after the other, in the context of parallel computing tasks are divided into smaller, potentially independent parts that can be processed simultaneously via the execution of identical steps using multiple processors. From multi-core processors in our laptops and smartphones to supercomputers tackling large-scale simulations, parallel processing is used in diverse fields to handle large datasets, run complex algorithms, and speed up calculations. Sorting, i.e., the rearrangement of a list of numbers into a particular order, is a very common operation appearing in many applications. Sorting is a typical problem for which sequential algorithms may not be efficient enough when they are required to operate on large data volumes, while their parallel counterparts can perform significantly better. Shearsort is a classic parallel sorting algorithm which works in rounds on two-dimensional processor arrays or meshes and consists of alternately sorting rows and columns of the mesh.
The study of parallel algorithms both in terms of theoretical analysis as well as implementation and application is part of the curriculum of almost all departments of computer science and engineering. Shearsort in particular is one of the basic parallel sorting algorithms studied in the context of courses on parallel algorithms. The use of visualization in the form of instructional animation can significantly leverage teaching parallel algorithms. Watching animations and actively participating in constructing them enable students to gain insight and thus better understand the presented algorithms before proceeding to analysis and implementation. Taking into account that most students are familiar with coding while largely lack a background on theoretical analysis of algorithms, watching an algorithm working in real time can provide students with valuable insight regarding pivotal arguments used for the involved theoretical analysis. While plenty of textual information on parallel sorting algorithms and Shearsort is available, our research returned very limited results for similar existing applications focusing on animated visualization of the operation of parallel sorting algorithms and Shearsort in particular.
Motivated by these observations and with an intention to provide students and tutors with a supportive tool for courses on parallel algorithms, we designed and implemented a web application for the Shearsort parallel sorting algorithm on two-dimensional meshes. Users can select the dimension of the mesh and let the application populate it with values or actively participate in the procedure. Then, they can watch the visualized mesh gradually being sorted by the Shearsort algorithm either as an animated flow or in a step-by-step fashion. During the execution of the algorithm additional information is depicted regarding the particular operations performed in each step. Our application, built on JavaScript with a fully-parallel implementation, is responsive, supports accessibility features and is currently available in greek and english.
Keywords: Web application, animation, visualization, parallel algorithms, Shearsort, JavaScript.