All XL Fortran directives belong to one of two groups: noncomment form directives and comment form directives.
>>-directive--------------------------------------------------->< |
The compiler always recognizes noncomment form directives. They cannot be continued.
Additional statements cannot be included on the same line as a directive.
Source format rules concerning white space apply to directive lines.
>>-trigger_head--trigger_constant--directive------------------->< |
The default value for the trigger_constant is IBM*.
The compiler will always recognize comment form directives that use IBM* as the trigger_constant.
By default, the option -qdirective=IBM*:IBMT will be on when compiling using the xlf_r, xlf_r7, xlf90_r, xlf90_r7, xlf95_r or xlf95_r7 invocation commands. By default, if you use the -qsmp compiler option in conjunction with one of these invocation commands, the option -qdirective=IBM*:SMP$:$OMP:IBMP:IBMT will be on. If you specify the -qsmp=omp option this will be as if you set the option -qdirective=$OMP on by default. You can specify an alternate or additional trigger_constant with the -qdirective compiler option. See the -qdirective compiler option in the User's Guide for more details.
The compiler treats all comment form directives, with the exception of the default trigger_constant as comments, unless you define the appropriate trigger_constant using the -qdirective compiler option. As a result, code containing these directives is portable to non-SMP environments.
XLF supports the OpenMP specification, as understood and interpreted by IBM. To ensure the greatest portability of code, we recommend that you use these directives whenever possible. You should use them with the OpenMP trigger_constant, $OMP; but you should not use this trigger_constant with any other directive.
XLF also includes the trigger_constants IBMP and IBMT. The compiler recognizes IBMP if you compile using the -qsmp compiler option. You should use IBMP with the SCHEDULE directive, and IBM extensions to OpenMP directives. The compiler recognizes IBMT if you compile using the -qthreaded compiler option. IBMT is the default for the xlf_r, xlf_r7, xlf90_r, xlf90_r7, xlf95_r or xlf95_r7 invocation commands; we recommend its use with the THREADLOCAL directive.
XLF directives include directives that are common to other vendors. If you use these directives in your code, you can enable whichever trigger_constant that vendor has selected. Specifying the trigger constant by using the -qdirective compiler option will enable the trigger_constant the vendor has selected. Refer to the -qdirective compiler option in the User's Guide for details on specifying alternative trigger_constants.
You can specify a directive as a free source form or fixed source form comment, depending on the current source form.
The trigger_head follows the rules of comment lines either in Fortran 90 free source form or fixed source form. If the trigger_head is !, it does not have to be in column 1. There must be no blanks between the trigger_head and the trigger_constant.
You can specify the directive_trigger (defined as the trigger_head combined with the trigger_constant, !IBM* for example) and any directive keywords in uppercase, lowercase, or mixed case.
You can specify inline comments on directive lines.
!SMP$ INDEPENDENT, NEW(i) !This is a comment
A directive cannot follow another statement or another directive on the same line.
All comment form directives can be continued. You cannot embed a directive within a continued statement, nor can you embed a statement within a continued directive.
You must specify the directive_trigger on all continuation lines. However, the directive_trigger on a continuation line need not be identical to the directive_trigger that is used in the continued line. For example:
!SMP$ INDEPENDENT & !IBM*& , REDUCTION (X) & !SMP$& , NEW (I)
The above is equivalent to:
!SMP$ INDEPENDENT, REDUCTION (X), NEW (I)
provided both IBM* and SMP$ are active trigger_constants.
For more information, see Lines and Source Formats.
If the trigger_head is one of C, c, or *, it must be in column 1.
The maximum length of the trigger_constant in fixed source form is 4 for directives that are continued on one or more lines. This rule applies to the continued lines only, not to the initial line. Otherwise, the maximum length of the trigger_constant is 15. We recommend that initial line triggers have a maximum length of 4. The maximum allowable length of 15 is permitted for the purposes of backwards compatibility.
If the trigger_constant has a length of 4 or less, the first line of a comment directive must have either white space or a zero in column 6. Otherwise, the character in column 6 is part of the trigger_constant.
The directive_trigger of a continuation line of a comment directive must appear in columns 1-5. Column 6 of a continuation line must have a character that is neither white space nor a zero.
For more information, see Fixed Source Form.
The maximum length of the trigger_constant is 15.
An ampersand (&) at the end of a line indicates that the directive will continue. When you continue a directive line, a directive_trigger must appear at the beginning of all continuation lines. If you are beginning a continuation line with an ampersand, the directive_trigger must precede the ampersand. For example:
!IBM* INDEPENDENT & !SMP$& , REDUCTION (X) & !IBM*& , NEW (I)
For more information, see Free Source Form.