Sun Studio 12: Fortran User's Guide

2.3.2.2 Legacy Sun/Cray Parallelization Directives


Note –

Legacy Sun and Cray style parallelization directives are now deprecated. The compiler still recognizes these directives, but that may change in a later Sun Studio release. The OpenMP parallelization API is preferred. Information on how to migrate from legacy Sun/Cray directives to the OpenMP model appears in the OpenMP API User’s Guide.


Sun style parallelization directives are the default for -parallel and -explicitpar. Sun directives have the directive sentinel $PAR.

Cray style parallelization directives, enabled by the -mp=cray compiler option, have the sentinel MIC$. Interpretations of similar directives differ between Sun and Cray styles. See the chapter on parallelization in the Fortran Programming Guide for details. See also the OpenMP API User’s Guide for guidelines on converting legacy Sun/Cray parallelization directives to OpenMP directives.

Note that only the OpenMP directives are available for parallelization on x86 Solaris and Linux platforms.

Sun/Cray parallelization directives have the following syntax:

Each parallelization directive has its own set of optional qualifiers that follow the keyword.

Example: Specifying a loop with a shared variable:


C$PAR DOALL SHARED(yvalue)    Sun style
CMIC$ DOALL SHARED(yvalue)    Cray style