Go to the first, previous, next, last section, table of contents.
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:
PL_NUM_THREADS
PL_PROC_START
PL_MAXPROC
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 first, previous, next, last section, table of contents.