Technical data
#pragma Directives [3]
explicitly do so. Unlike other loop-based directives, the taskloop directive must
appear before a for loop.
The taskloop directive can be used either inside or outside of a parallel region.
When the directive is used inside a parallel region, the private, shared,
value, defaults, if, and maxcpus arguments are not allowed. These
arguments, if specified, must be specified on the parallel directive that
precedes the taskloop directive. When a taskloop directive is used outside a
parallel region, the loop is referred to as a
stand-alone task loop. The savelast
argument can be specified only on stand-alone task loops.
For task loops outside of a parallel region, the format of the taskloop directive
is as follows:
#pragma _CRI taskloop [shared(var)...)][private(var...)]
[value(var...)][defaults][if (exp)][maxcpus(exp)]
[savelast][dist]
For task loops inside a parallel region, the format of the taskloop directive is
as follows:
#pragma _CRI taskloop [dist]
Arguments to tasking directives are described in Section 3.8.13, page 79.
The following example illustrates the use of the taskloop directive:
#pragma _CRI taskloop vector
for (i = 0; i < 2000; i++) {
...
xsum = xsum + aa[i]*(bb[i]-cc[aa[i]]);
xbig = max(abs(aa[i]*bb[i]), xbig);
...
}
3.8.5 endloop Directive (UNICOS Systems)
Scope: Local
By default, a directive is not needed to end a taskloop loop. The endloop
directive is a special terminator for the taskloop directive inside a parallel
region. The endloop directive extends the range of the control structure that
S–2179–36 71










