z-logo
open-access-imgOpen Access
THE TEMPLATE PROGRAMMING OF PARALLEL ALGORITHMS
Author(s) -
Milda Baravykaitė,
Ramūnas Šablinskas
Publication year - 2002
Publication title -
mathematical modelling and analysis/mathematical modeling and analysis
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.491
H-Index - 25
eISSN - 1648-3510
pISSN - 1392-6292
DOI - 10.3846/13926292.2002.9637173
Subject(s) - computer science , initialization , programming language , granularity , set (abstract data type) , debugging , task (project management) , code (set theory) , class (philosophy) , parallel programming model , algorithm , parallel computing , theoretical computer science , programming paradigm , artificial intelligence , management , economics
The parallel programming tools and packages are evolving rapidly. However the complexity of parallel thinking does not allow to implement many algorithms for the end user. In most cases only expert programmers risk to involve in parallel programming and program debugging.In this paper we extend the ideas from [3] of template programming for a certain class of problems which could be solved by using general master‐slave paradigm. The template is suitable for solution of the coarse grain and middle grain granularity problem set. Actually, it could be applied to solve any problem P, which is decomposable into a set of tasks P = U i N=0ti. The most effective application cases are obtained for the problems where all ti are independent.The template programming sets some requirements for the sequential version of the user program:The main program must comprise of several code blocks: data initialization, computation of one task ti and the processing of the result. The user has to define the data structures: initial data, one task data, the result data. These requirements do not require to rewrite the existing sequential code but to organize it into some logical parts. After these requirements (and naming conventions) are fulfilled, the parallel version of the code is obtained automatically by compiling and linking the code with the Master‐Slave Template library.In this paper we introduce the idea of the template programming and describe the layer structure of the Master‐Slave Template library. We show how the user has to adjust the sequential code to obtain a valid parallel version of the initial program. We also give examples of the prime number search problem and the Mandelbrot set calculation problem.

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here