Technical data

Cray Standard C/C++ Reference Manual
3.8.1.1.1 Master Code
The master code contains the code that sets up the data structures needed for
tasking, performs some (or all) of the work in a parallel region, and performs the
cleanup operations needed after tasking is complete. The task that executes the
master code is known as the
master task. A copy of the body of the parallel region
is placed in the master code. The master code is executed by the same processor
that was executing the nontasked code just prior to the parallel region. This
processor also resumes execution of the nontasked code following the parallel
region. It is the master task that starts all the slave tasks, if necessary.
3.8.1.1.2 Slave Code
The slave code contains a copy of the body of the parallel region and code to
determine what part of the parallel region needs to be performed next. The
tasks that execute the slave code are known asslave tasks. Because the compiler
places the slave code in a function, the slave code is sometimes referred to as
the slave function. The slave code is executed by each of the processors available
for tasking, except for the original processor. When processing of the parallel
region is complete, all of the processors that were executing the slave function
are returned to the operating system.
64 S217936