XL Fortran for AIX 8.1

User's Guide


Portability of Directives

XL Fortran supports many directives available with other Fortran products. This ensures easy portability between products. If your code contains trigger_constants other than the defaults in XL Fortran Version 8.1, you can use the -qdirective compiler option to specify them. For instance, if you are porting CRAY code contained in a file xx.f, you would use the following command to add the CRAY trigger_constant:

   xlf95 xx.f -qdirective=mic\$

For fixed source form code, in addition to the ! value for the trigger_head portion of the directive, XL Fortran Version 8.1 also supports the trigger_head values C, c, and *.

For more information, see -qdirective Option.

XL Fortran supports a number of programming terms as synonyms to ease the effort of porting code from other Fortran products. Those terms that are supported are dependent on context, as indicated in the following tables:

Table 30. PARALLEL DO Clauses and Their XL Fortran Synonyms

PARALLEL DO Clause XL Fortran Synonym
LASTLOCAL LASTPRIVATE
LOCAL PRIVATE
MP_SCHEDTYPE
and CHUNK
SCHEDULE
SAVELAST LASTPRIVATE
SHARE SHARED
NEW PRIVATE


Table 31. PARALLEL DO Scheduling Types and Their XL Fortran Synonyms

Scheduling Type XL Fortran Synonym
GSS GUIDED
INTERLEAVE STATIC(1)
INTERLEAVED STATIC(1)
INTERLEAVE(n) STATIC(n)
INTERLEAVED(n) STATIC(n)
SIMPLE STATIC


Table 32. PARALLEL SECTIONS Clauses and Their XL Fortran Synonyms

PARALLEL SECTIONS Clause XL Fortran Synonym
LOCAL PRIVATE
SHARE SHARED
NEW PRIVATE

NEW

The NEW directive is a means for specifying which variables should be local in a PARALLEL DO loop or a PARALLEL SECTIONS construct. It performs the same function as the PRIVATE clause of the PARALLEL DO directive and PARALLEL SECTIONS directive.

Background Information:

The NEW directive only takes effect if you specify the -qsmp compiler option.

Syntax:



>>-NEW--named_variable_list------------------------------------><
 
 

The NEW directive must immediately follow either a PARALLEL DO directive or a PARALLEL SECTIONS directive.

If you specify the NEW directive, you must specify the corresponding PARALLEL DO or PARALLEL SECTIONS directive with no clauses.

If the NEW directive follows the PARALLEL DO directive, the first noncomment line (not including other directives) following the NEW directive must be a DO loop. This line cannot be an infinite DO or DO WHILE loop.

A variable name in the named_variable_list of the NEW directive has the same restrictions as a variable name appearing in the PRIVATE clause of the PARALLEL DO directive or a PRIVATE clause of the PARALLEL SECTIONS directive. See the sections on the PARALLEL DO directive and the PARALLEL SECTIONS construct in the XL Fortran for AIX Language Reference.

Examples

INTEGER A(10), C(10)
REAL B(10)
INTEGER FUNC(100)
!SMP$ PARALLEL DO
!SMP$ NEW I, TMP
        DO I = 1, 10
          TMP = A(I) + COS(B(I))
          C(I) = TMP + FUNC(I)
        END DO


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]