To compile a program for parallel execution using kapf
, use the following commands:
kapf /conc /cmp=myprog_mp.f myprog.f fort myprog_mp.f /fast/optimize=(tune=host,level=5) /automatic link myprog_cmp.obj/threads_enable/EXECUTABLE=myprog.exe,SYS$COMMON:[SYSLIB]kmp/lib
The compiler and linker qualifiers are as follows:
/automatic
- Tells the compiler to allocate
local variables on the run-time stack.
/conc
- Tells KAP to restructure source code
for parallel processing.
/cmp
- Causes KAP to save the optimized
source program under the file name of your choice. The
kapf
default is to name the optimized source
file_name_cmp
. Because the Fortran compiler
will not process a file with the default extension of
.cmp
, you must override the default by using
/cmp
to rename the optimized source file_
name_cmp.f
.
/fast
- Sets the following qualifiers that
can improve run-time performance: /alignment=natural
, assume=noaccuracy_sensitive
, math_
library=fast
, and /optimize=level=4
.
/sys$common:[syslib]kmp.olb
- Tells the
linker to use the KAP parallel processing library for OpenVMS
Alpha. The parallel processing library provides an interface
to DECthreads. See Section 3.1 for
more information.
/threads_enable
- Tells the linker to
allow a multithreaded application to have a thread executing
on every CPU in a multiprocessor system. See Section 3.1 for more information.
/optimize=(tune=host,level=5)
- Tells the
compiler to optimize for the architecture of the host processor.
Note that the Fortran /optimize=(tune=host,level=5)
qualifiers and the KAP Fortran /tune
qualifier
work independently and perform different optimizations. For
information about the KAP Fortran /tune
qualifier,
see Section 5.1.7.
kapf
to process a file, you must set the Fortran compiler and linker
qualifiers appropriately. For this reason, Compaq recommends that
you use kfort
whenever possible, as kfort
automatically sets the compiler and linker qualifiers correctly.
Copyright © Digital Equipment Corporation. 1999. All Rights Reserved.