NPROC — Set number of processors to use during the calculation (if supported).
On some operating systems, AMPAC is able to take advantage of multiple processors in order to help speed up the calculation. This occurs by two different mechanisms. The first is OpenMP, which is allows work for certain activities to be spread across multiple processors so that the total (wall clock) time is reduced. The second case involves the use of special math libraries (e.g. MKL for intel-based systems), which are used to speed up operations involving matrices and vectors. OpenMP can potentially achieve large speed-ups, but is only used for select activities, whereas a parallel math library yield smaller speed-ups but is used throughout the code.
There are several ways for the user to control the actual number of processors used during the calculation (on systems that support parallel processing). First is the -nproc=option on the command line. AGUI allows the user to set this when the job is being launched but can also be specified with the ampac or mampac run scripts. The second choice is the NPROC keyword described here. NOTE: the command-line option takes prescidence over this keyword! Third, if the environmental variable AMPAC_OMP_NPROC is set, then that will be used to specify the number of processors. Otherwise, the default behavior is to use only 1 processor, so as to help avoid thrashing (poor system behavior) that can occur if there is more demand for processors than the system can adequately support.
The number of processors available for use should be understood as the number of processor cores, rather than the number of physical processors. So, for example, a single quad-core processor would be considered as having four available processors. For systems with hyper-threading enabled, the number of processors available equals the number of hypertreads.
This keyword sets the number of processors to be used during the calculation to
n. This option gives the user full control over the number of processors.
A value greater than the number of the number of available processors will still only use the maximum number
of processors and a value of
n < 1 will be ignored
Using this keyword will instruct AMPAC to use all available processors. This keyword (and the related variants below) is helpful because it can be used in jobs without having to know in advance where it will be run or how many processors are available on the machine.
This directs AMPAC to use all but one of the available processors to help speed up the calculation. Unlike NPROC=all, one processor is left unused on which the rest of the system's processes to utilize. This compromise allows the system and other jobs to run freely and so preventing the machine from thrashing. This is particularly important on single-user computers because it allows the user to perform other tasks while running AMPAC.
Only half of the machine's processors will be utilized in the calculation. Like NPROC=most, this is intended to be a compromise to allow AMPAC to run smoothly without slowing down or interfering with the other system processes.
Windows, Linux, intel-based Macs, Irix, and Irix64: NPROC is supported.
HPUX: NPROC is ignored. The environment variable MP_NUMBER_OF_THREADS can be used instead of NPROC to control the number of processors.
Tru64: NPROC is ignored. The environment variable OMP_NUM_THREADS can be used instead of NPROC to control the number of processors.
Other systems: NPROC is ignored.
Copyright © 1992-2013 Semichem, Inc. All rights reserved.