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.1 Primitive data types available in ZPL.
Code Spec 8.2 Syntax of control statements in ZPL.
Code Spec 8.3 ZPL’s primitive operators and operator-assignments.
Figure 8.1 ZPL program that implements Conway’s Game of Life.
Code Spec 8.4 Specifying the entry procedure for ZPL.
Figure 8.2 The SUMMA matrix multiplication algorithm in ZPL.
Code Spec 8.5 Requirements of ZPL’s partial reduce and flood operators.
Code Spec 8.6 Requirements of ZPL’s remap operator.
Figure 8.3 ZPL program for ranking coffee drinker data.
Figure 8. 4 Bounding region 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 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).
Code Spec 8.7 ZPL performance model.
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
Figure 8.6 A NESL matrix multiplication function.