Use directed parallelization if you are experienced with parallel programming, and you want to explicitly control which loops KAP parallelizes with PCF directives. PCF directives eliminate the need for you to write calls to the DECthreads library. This is helpful if you previously parallelized your program on a non-OpenVMS Alpha system, since you may be able to replace those directives with PCF directives. For example, Table 3-1 gives a functional comparison of Cray autotasking directives and PCF directives.
In general, use PCF directives only with loops that are safe to parallelize. Where KAP sees loops prefaced with PCF directives, it does not perform data dependence analysis and does not prevent you from using a parallel directive incorrectly.
To compile a program with PCF directives for directed parallel execution, use the compiler and linker qualifiers as follows:
kfort myprog_pcf.f sys$common:[syslib]kmp.olb/lib /threads_enable
/threads_enable
- allows a multithreaded
application to have a thread executing on every CPU in a
multiprocessor system.
sys$common:[syslib]kmp.olb/lib
- causes
the linker to link to the parallel processing library
/sys$common:[syslib]kmp.olb
.
KAP provides the following PCF directives. Refer to the appropriate sections for explanations and code examples as follows:
C*KAP* ONE PROCESSOR SECTION . . . END ONE PROCESSOR
SECTION
(See Section 3.2.7.)
C*KAP* PARALLEL REGION . . . END PARALLEL REGION
(See Section 3.2.2.)
C*KAP* PARALLEL DO
(See Section 3.2.3.)
C*KAP* CRITICAL SECTION . . . END CRITICAL
SECTION
(See Section 3.2.6.)