- Task Decomposition Pattern
- Data Decomposition Pattern
- Group Task Pattern
- Order Task Pattern
- Data Sharing Pattern
- Design Evaluation Pattern
When achieving task based parallelism programmer must aware about the following points
- He must understands the which are the computationally intensive parts of the problem.
- Key Data structures
- How the data is used as the problem's solution unfolds.
Lets' see what are the factors which influence in parallel design
- Flexibility : Allow to adapted to different implementation requirements.
- Efficiency : Parallel program must scale efficiently with the size of the parallel computer. Ex: Task decomposition needs to keep all the PEs busy.
- Simplicity : Task decomposition needs to be complex enough to get the job done.
- The actions that are carried out to solve the problem.
- Whether these actions are distinct and relatively independent.
- Each task corresponds to a distinct call to a function defining a task for each function call... leads to what is called a functional decomposition.
- Distinct iterations of the loops with in an algorithm.
- A large data structure is decomposed and multiple units of execution concurrently update different chunks of the data structure. In this case the tasks are those updates on individual chunks.
When we consider a multiplication of two matrices A and B(C=A.B). We can produce a task based decomposition by considering the calculation of each element of the product as a separate task. Each task needs to access to one row of A and one column of B. All tasks are independent. Also all the data that is shared among the tasks A and B is read-only. That mean an implementation of a shared memory environment.
But this algorithm has a poor performance because the memory access time is slow compared to floating point arithmetic. Bandwidth of the memory subsystem would limit the performance.
But we can design a algorithm that maximize the reuse of data loaded into a processor's caches. This can be achieved by two different ways.
- Using the Group Tasks Pattern: tasks which use similar sort of elements are grouped and run on the same UE.
- Data Decomposition: Design the algorithm from the beginning around the way the matrices fit into the caches.
0 comments:
Post a Comment