| United States-English |
|
|
|
![]() |
Fortran 90 Compiler for HP-UX: Fortran 90 Programmer's Guide > Chapter 9 Using Fortran 90 directivesCompatibility directives |
|
HP Fortran 90 supports the compiler directives listed in Table 9-2 “Compatibility directives recognized by HP Fortran 90”. These directives are provided for compatibility with programs developed on the platforms listed in the table. Table 9-2 Compatibility directives recognized by HP Fortran 90
In fixed format, each directive must be preceded by the comment character C, !, or * and must begin in column 1 of the source file. In free format, the directive must be preceded by the Fortran 90 comment character (!). If an option or argument is included with the directive name, the compiler ignores the directive. The following sections describes these directives in detail. HP Fortran 90 can vectorize eligible program loops that operate on vectors. This optimization causes the compiler to replace the loops with calls to selected routines in the Basic Linear Algebra Subroutine (BLAS) library. You can use the *$* [NO]VECTORIZE directive to enable or disable vectorization. The compiler considers the *$* VECTORIZE directive as a request to vectorize a loop. If the compiler determines that it cannot profitably or safely vectorize the loop, it ignores the directive. To use the vectorization directive, you must compile and link with the +Ovectorize option. The directive applies to the beginning of the next loop and remains in effect for the rest of the program unit or until superseded by a later directive. For more information about this option, see HP Fortran 90 Programmer's Reference, Chapter 13. HP Fortran 90 can parallelize eligible program loops by distributing different iterations of the loop to different processors for parallel execution on a multiprocessor machine. The following directives provide local control over parallelization:
These directives have both enable and disable versions: *$* CONCURRENTIZE and DIR$ CONCUR enable parallelization; *$* NOCONCURRENTIZE and DIR$ NOCONCUR disable parallelization. The parallelization directives are effective only if you have compiled and linked the program with the +Oparallel and the +O3 option. Each directive applies to the beginning of the next loop and remains in effect for the rest of the program unit or until superseded by a later directive. The compiler considers the *$* CONCURRENTIZE and DIR$ CONCUR directives as requests to parallelize a loop. If the compiler cannot profitably or safely parallelize the loop, it ignores the directive. For information about conditions that can inhibit parallelization, see the Parallel Programming Guide for HP-UX Systems. The compiler will not parallelize a loop where it detects a possible data dependence, even if you use an option or directive that specifically requests parallelization. However, if you know that there is no actual data dependence in the loop in question, you can insert one of the following directives just before the loop:
The effect of these directives is to cause the compiler to ignore data dependences within the next loop when determining whether to parallelize. The DIR$ IVDEP directive differs from the other two in that it causes the compiler to ignore only array-based dependences, but not scalar-based. All three directives apply to the next loop only.
Other conditions may limit the compiler"s efforts to parallelize, such as the presence of the VD$ NOCONCUR directive. Such conditions may prevent parallelization even if you use a directive to disable dependence checking. The compiler will not parallelize a loop with an embedded call to a routine if the compiler finds that the routine has side effects. However, if you know that a routine that is called inside of a loop does not have side effects, you can insert the DIR$ NO SIDE EFFECTS directive in front of the loop to force the compiler to ignore any side effects in the referenced routine when it determines whether to parallelize the loop. This directive affects only the immediately following loop.
Cray"s implementation of this directive requires that it precede any executable statement or statement function. HP Fortran 90 does not enforce this requirement. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||