Read by libcpmdc at run time

Variable

Read in

Effect

CPMDC_PSEUDO_DIR

src/cpmd_embed_c_api.F90, first call of an OpenCPMD session

directory holding the pseudopotential files named in the deck; cpmdc changes into it while CPMD reads them, then leaves it before CPMD writes output files

CPMD_PP_LIBRARY_PATH

same place, when CPMDC_PSEUDO_DIR is unset

fallback for the same directory

CPMDC_DECK_OUT

src/cpmdc.c, each time a message is rendered

file that receives the rendered method deck; each write replaces the last

CPMDC_STRESS

src/cpmd_embed_c_api.F90, each OpenCPMD evaluation

0 skips the stress tensor on periodic cells; any other value, or unset, computes it

The first call of an OpenCPMD session fails when neither CPMDC_PSEUDO_DIR nor CPMD_PP_LIBRARY_PATH names an existing directory. The result message and cpmdc_last_error() name that directory; the call does not report an unconverged SCF. While cpmdc is in the pseudopotential directory it also sets CPMD_PP_LIBRARY_PATH and PP_LIBRARY_PATH to that directory with a trailing slash, for OpenCPMD’s own lookup. The change of directory is needed because OpenCPMD’s get_pplib takes argv[2] as the library path whenever the process has more than one argument, which most hosts do. Once the pseudopotential files are read, the working directory becomes permanentDir if that field is set, otherwise scratchDir, otherwise the host directory from before the call. RESTART.1, LATEST, GEOMETRY, and GEOMETRY.xyz are written there. LATEST and GEOMETRY do not follow FILEPATH, so the working directory is what places them. The pseudopotential directory is left unchanged.

CPMDC_STRESS=0 saves the stress calculation for callers that use only energy and forces, and the stress snapshot stays invalid. Isolated cells never compute stress, whatever the variable says, and the snapshot stays invalid for them even when the box volume is positive.

Read by the tests and tools

Variable

Read by

Effect

CPMD_ROOT, then CPMDC_CPMD_ROOT

tools/check_feature_inventory.py (feature-inventory test)

OpenCPMD source tree to probe for inscan('&SECTION') calls; without it the live completeness check is skipped with a warning

CPMD_SRC, then OPENCPMD_SRC

tests/test_cpmd_inscan_token_fidelity.py

OpenCPMD source tree for the parser token check

CPMDC_CPMD_EXE, then CPMD_ROOT

tools/cpmd_root_probe.py

the cpmd.x to check, or the tree whose bin/cpmd.x it checks

MAKE, AR

tools/rebuild_opencpmd_embed.sh

the Make and archiver programs; default make and ar

The live tests of an OpenCPMD build (meson test -C build-cpmd) run libcpmdc, so they need CPMDC_PSEUDO_DIR like any other host.

Read by hosts that load libcpmdc

These belong to the host, not to cpmdc, and are listed here because they decide which libcpmdc a host loads.

Variable

Host

Effect

CPMDC_LIBRARY, RGPOT_CPMDC_ENGINE, RGPOT_CPMD_ENGINE

rgpot CPMDPot

path of the libcpmdc.so to dlopen, tried in that order after an explicit engine path

RGPOT_PARAMS_PATH

eOn RgpotPot builds that read params_path

overrides [RgpotPot] params_path

OMP_NUM_THREADS

OpenMP runtime

threads per rank inside CPMD when OpenCPMD was built with OpenMP