Technical data
Cray Standard C/C++ Reference Manual
• The address of a taskcommon variable cannot be taken in a constant
expression (for example, an initializer).
3.8.11 common Directive
A common directive ensures that specified variables are accessible to all
tasks (not stored as taskcommon). Use this directive, for example, with the
-h taskcommon option, to exempt certain variables that would otherwise
be taskcommon. The common directive overrides the -h taskcommon and
-h taskprivate command line options. The format of the common directive is
as follows (the comma-separated list of variables can be placed in parentheses):
#pragma _CRI common variable,...
The common directive can appear in both global and local scopes and applies
only to the following types of variables:
• Global scope variables, in which case the directive must appear at global
scope.
• Local scope variables with static storage class, in which case the directive
must appear within the same scope as the variable declaration.
When a variable is designated as common, subsequent declarations of that
variable in the same source file inherit the common storage class.
The following example illustrates the use of the common directive:
/* The #pragma directive below retains "test" in
common storage when the -h taskcommon command line
option is used. */
int test;
#pragma _CRI common test
3.8.12 prefertask Directive (UNICOS Systems)
Scope: Local
The prefertask directive tells the compiler to generate tasked code for the
loop that immediately follows it if that loop contains more than one loop in the
nest that can be tasked. The directive states a tasking preference but does not
guarantee that the loop has no memory dependence hazard. Aggressive tasking
(enabled by the -h task3 command line option) must be enabled for this
78 S–2179–36










