Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Fortran 90 Compiler for HP-UX: Fortran 90 Programmer's Guide > Chapter 9 Using Fortran 90 directives

Compatibility directives

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

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

Vendor

Directive

Cray

DIR$ NO SIDE EFFECTS

DIR$ [NO]CONCUR

DIR$ IVDEP

FPP$ NODEPCHK

KAP

*$* [NO]CONCURRENTIZE

*$* [NO]VECTORIZE

VAST

VD$ NODEPCHK

 

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.

Controlling vectorization

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.

Controlling parallelization

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:

  • *$* [NO]CONCURRENTIZE

  • DIR$ [NO]CONCUR

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.

Controlling dependence checks

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:

  • DIR$ IVDEP

  • FPP$ NODEPCHK

  • VD$ NODEPCHK

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.

NOTE: Using these directives to incorrectly assert that a loop has no data dependences can result in the loop producing wrong answers.

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.

Controlling checks for side effects

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.

NOTE: Using this directive to incorrectly assert that a routine has no side effects can result in wrong answers when a call to the routine is embedded in a 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.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.