190 likes | 206 Views
Discover ZPL and other global view languages for implicit parallelism. Compiler generates threads, handles synchronization, and supports array-focused operations. Learn about ZPL's primitive data types, control statements, and operators. Dive into algorithms and performance models.
E N D
Chapter 8:ZPL and Other Global View Languages Principles of Parallel Programming First Edition by Calvin Lin Lawrence Snyder
Global view parallel languages Programmers see the whole computation Do not focus on processes Language support for implicit parallelism
ZPL • http://research.cs.washington.edu/zpl/home/ • Focus on arrays • Implicit parallelism • Compiler generates processes/threads • Inserts communication calls • Handles synchronization • [1..n] count: =+<<(array==3); ZPL for count 3s
Array language • A := A + 1; adds 1 to all elements of A • Performs in parallel • [1..n] A := A + 1; only updates 1 .. N • Named regions • region R = [1..m, 1..n]
Code Spec 8.3 ZPL’s primitive operators and operator-assignments.
Figure 8.1 ZPL program that implements Conway’s Game of Life.
Figure 8.2 The SUMMA matrix multiplication algorithm in ZPL.
Code Spec 8.5 Requirements of ZPL’s partial reduce and flood operators.
Figure 8.4 Bounding region. Regions used in the program are superimposed so that their indices align; the black square has the same index in all regions. Once aligned, the bounding region is the smallest region containing the indices of the superimposed regions.
Figure 8.5 Block allocation of the bounding region. The bounding region (a) is partitioned using a balanced allocation (b), which assigns a set of indices (c). The contributing regions’ indices are inherited from those indices (d).
NESL Based on ML High level global view language Data parallel Allows programmers to asses the behavior of their programs
Basic data type • Sequence [6, 14, 0, -5] essentially a list • Basic operation • Apply-to-each • {a+1 : a in [6, 14, 0, -5]}; • applies the increment to each element