PARALLEL Section
The PARALLEL section controls how OpenQuantum uses the CPUs and memory of a
single compute node. It selects between three execution layouts:
- Multi-threaded — one process with a shared-memory thread pool that accelerates the hot kernels (two-electron integrals, Fock builds, and the finite-difference Hessian).
- Multi-process — several cooperating processes that each take a slice of an embarrassingly parallel workload (the displaced gradient evaluations of a numerical Hessian).
- Hybrid —
NProcprocesses, each runningNThreadsthreads.
The default is a single process with a single thread (serial execution).
Keywords
| Keyword | Type | Default | Description |
|---|---|---|---|
NProc | integer | 1 | Number of cooperating processes |
NThreads | integer | 1 | Shared-memory threads per process |
NCores | integer | detected | Total physical-core budget |
Mem | memory | unlimited | Total memory budget (e.g. 8GB) |
MemPerProc | memory | derived | Explicit per-process memory budget |
NProc, NThreads, and NCores accept Procs, Threads, and Cores as
aliases. Memory values accept kb, mb, gb, and tb suffixes (binary
units); a bare number is interpreted as megabytes.
Resolution rules
The requested layout is resolved against the machine as follows:
- The default is one process and one thread.
- If you give
NCorestogether withNProc, the threads-per-process is derived so thatNProc × NThreads ≤ NCores. - If you give
Memtogether withNProc, the per-process budget isMem / NProc. - An explicit
NThreadsorMemPerProcalways overrides a derived value.
A memory budget is advisory: the per-process value is reported in the output header and, on Unix, applied as a soft address-space limit so a runaway process fails fast rather than driving the node into swap.
Examples
Two processes spread across eight cores (four threads each):
PARALLEL
NProc 2
NCores 8
END
Eight threads in a single process with an 8 GB budget:
PARALLEL
NThreads 8
Mem 8GB
END
Route-card and command-line equivalents
The same settings may be given on the route card:
#p rhf/sto-3g freq=(numerical) parallel=(nproc=2,ncores=8)
or on the command line, which takes precedence over the input file:
openquantum --nproc 2 --ncores 8 input.inp
openquantum --nthreads 8 --mem 8GB input.inp
or through environment variables, which a batch scheduler script typically sets and which override the input file:
| Variable | Meaning |
|---|---|
OPENQUANTUM_NPROC | Number of processes |
OPENQUANTUM_NTHREADS | Threads per process |
OPENQUANTUM_NCORES | Total core budget |
OPENQUANTUM_MEM | Total memory budget |
OPENQUANTUM_MEM_PER_PROC | Per-process memory budget |
Precedence, from lowest to highest: input file → environment → command line.
Scope
Multi-process execution currently parallelises the numerical (semi-analytical)
Hessian used by Numerical true, OptFreq, and the numerical Hessian path
of Freq. All run types benefit from the shared-memory thread pool. Analytical
Hessians and single-point energies use the thread pool within one process.