Next: Tiling the main Up: Running the NPB Previous: Trying the simple

The EP benchmark

The EP benchmark is a kernel that could be used in a Monte Carlo type procedure. pseudorandom floating point numbers are generated and some computations which depend only on pairs of neighboring elements are performed. The data dependency is minimal, hence the problem is called embarrassingly parallel. It should be mentioned that the sought result is a table of 10 integer values, which are counts of how many pseudorandom pairs satisfy some specified criteria.

The compute intensive part of the program is a loop over segments of the numbers. For each iteration, a batch of pseudorandom numbers is first generated and then analyzed. The numbers are generated in batches instead of one-by-one because this is normally faster, even if this part of the code is not easily vectorizable. The obvious strategy on a parallel computer is to give each processor such a segment of numbers to work on. These computations are completely independent, except that the answer is a combination of all the answers to the subproblems.

The EP problem is somewhat untypical for a general numerical program. In many real-life cases one does not know how to distribute work and data among processors, and one is more than happy to think in terms of shared-memory and leave this task to the compiling and run-time system. But in our case, we have the opposite situation. We know how to distribute work and data We would like to think in terms of local (distributed) memory. It turned out that the greatest problem was, in fact, to get the KSR1 to do what we wanted it to do.

The most important high-level parallel directives in KSR Fortran are the tiling constructs. These are used for splitting up loops into independent tasks that can be executed in parallel. The word tile is used because the index space is subdivided into tiles that are assigned to different pthreads (processors). Various options control the tiling strategy, the tile size, and related parameters.

Next: Tiling the main Up: Running the NPB Previous: Trying the simple