To run a parallel program compiled by KAP on an SMP system, you must define the following logicals:
Replace <integer> with the number of parallel threads to use. The number of parallel threads is equal usually to the number of processors on the system. Do not specify more parallel threads than there are processors to avoid performance degradation.
Increasing the number of threads may result in the need to increase the stack size of your system, as explained in the following KMP_STACKSIZE description.
The KMP_STACKSIZE <integer> environment logical specifies the threads stack size in bytes. Replace <integer> with the desired stack size in bytes. KMP_STACKSIZE should be as large as the largest stack size given in the annotated listing. The default setting is 1 megabyte.
Two indications that your system stack size is too small are the following:
DECthreads Last Chance handler: thread 1 exiting on status exception 0x177db005 Exception: Invalid memory address (dce / thd)
kfort /fkapargs=(/conc) large.f KAP/Digital_VMS_F V3.1 03-Apr-1997 15:38:26 ### enddo ### in line 620 procedure EVALWW of file large.f ### Routine PKEVALWW requires the parallel STACKSIZE must be at least 221544 bytes. ### enddo ### in line 978 procedure EVALFW of file large.f ### Routine PKEVALFW requires the parallel STACKSIZE must be at least 221400 bytes.
Ask your system manager to increase the stacksize. The KAP annotated source file and the preprocessing warning message tell you how much to increase KMP_STACKSIZE.
The KMP_SPINLOCKS <on/off> environment logical sets the synchronization mechanism:
For example, to run a program on a multiprocessor system with 4 parallel threads, a thread stack size of 1 megabyte, and mutex synchronization, define the logicals as follows:
define PARALLEL 4 define KMP_STACKSIZE 100000 define KMP_SPINLOCKS off
kfort /fkapargs=(/conc) myprog.f
define PARALLEL 1
kfort /fkapargs=(/noconc) myprog.f