User`s guide

Compiler Directives and Assertions [C]
You can use this pragma in conjunction with the use n streams
to ask the compiler to allocate a certain number of streams per
processor to the job.
#pragma mta use 100 streams
#pragma mta for all streams
{ // do something
}
However, there is no guarantee that the runtime will grant the
requested number of streams if, for example, they are not available
due to other jobs, the OS, or other simultaneous parallel regions in
the current job.
#pragma mta for all streams i of n
This directive is similar to the for all streams pragma except
that it also sets the variable n to the total number of streams executing
the region, and the variable i to a unique per-stream identifier
between 0 and n-1. For example:
int i, n;
int check_in_array[MAX_PROCESSORS * MAX_STREAMS_PER_PROCESSOR];
for (int i = 0; i < MAX_PROCESSORS * MAX_STREAMS_PER_PROCESSOR; i++)
check_in_array[i] = 0;
#pragma mta for all streams i of n
{
check_in_array[i] = 1;
printf("Stream %d of %d checked in.\n", i, n);
}
Note that the integer variables i and n are declared separately from
the pragma. For more information on the for all streams
pragmas see Using the Cray XMT for all streams Pragmas in the
CrayDoc Knowledge Base at http://docs.cray.com/kbase.
S247920 113