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).
  • HybridNProc processes, each running NThreads threads.

The default is a single process with a single thread (serial execution).

Keywords

KeywordTypeDefaultDescription
NProcinteger1Number of cooperating processes
NThreadsinteger1Shared-memory threads per process
NCoresintegerdetectedTotal physical-core budget
MemmemoryunlimitedTotal memory budget (e.g. 8GB)
MemPerProcmemoryderivedExplicit 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:

  1. The default is one process and one thread.
  2. If you give NCores together with NProc, the threads-per-process is derived so that NProc × NThreads ≤ NCores.
  3. If you give Mem together with NProc, the per-process budget is Mem / NProc.
  4. An explicit NThreads or MemPerProc always 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:

VariableMeaning
OPENQUANTUM_NPROCNumber of processes
OPENQUANTUM_NTHREADSThreads per process
OPENQUANTUM_NCORESTotal core budget
OPENQUANTUM_MEMTotal memory budget
OPENQUANTUM_MEM_PER_PROCPer-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.