Go to the previous, next section.

Running Parallel Programs

The number of parallel threads and mapping of threads to physical processors for SUIF parallelized programs can be set using environment variables. The run-time library reads the following environment variables:

The number of parallel threads to execute. The default is set to 4.

The physical processor number that is to execute the first thread. For the DASH and SGI run-time libraries the default is set to 4.

The total number of processors available. The current default is 48 for the DASH and SGI libraries.

The run-time libraries assume that the physical processors are numbered starting at 0. The system creates a number of threads equal to PL_NUM_THREADS. The threads are then mapped to physical processors starting at PL_PROC_START, wrapping at PL_MAXPROC back to processor 0. The threads are assigned logical ids from 0 to PL_NUM_THREADS-1. The original master thread is guaranteed to be thread 0.

Under the SPMD model, the run-time library starts up a single thread on each processor. While one processor executes the sequential portions of the program, the remaining processors wait at a barrier. Once a parallel region is reached, all processors participate in the parallel computation, and again synchronize at a barrier at the end of the parallel region. The SUIF parallelizer generates code according to the lightweight thread model, where all variables are shared by default. Only local variables declared within an SPMD region are private; these variables are allocated on the local stack of the processor.

Go to the previous, next section.