Environment variables¶
adc_cpp reads a small set of POPS_* environment variables. They are all
optional: with none of them set the toolchain auto-detects everything and the
runtime stays inert. Each variable below is documented with its effect, its
default, and the exact file that reads it, so this page never describes a knob
that the code does not actually honor.
There are three families:
Codegen / toolchain knobs, read by the Python DSL compilation path when it builds a problem
.so(pops.codegen). They override auto-detection of the compiler, the headers, the Kokkos install, the optimization flags, and the cache directory.Python runtime defaults, read by
pops.runtimeto supply a default for a Python call that takes no argument. An explicit Python argument always wins.Runtime diagnostics, read by the C++ core. They are off by default and have no effect on numerics or outputs when unset.
adc_cpp also writes a few standard (non-POPS_) variables to steer the
threading backend; those are listed at the end.
Codegen and toolchain¶
These are read inside python/pops/codegen/toolchain.py and
python/pops/codegen/cache.py. They only affect the out-of-CMake compilation of
the DSL loader .so; they change neither the ABI key nor the numerics.
Variable |
Effect |
Default |
Read in |
|---|---|---|---|
|
Path to the |
Auto-detected (validity probe: |
|
|
Forces the C++ compiler used for every DSL |
The compiler baked into |
|
|
Kokkos install root used to compile the DSL loader with the same backend as |
Unset (no Kokkos root found -> the toolchain raises an explicit error, or warns about a serial fallback). |
|
|
Explicit compiler for the Kokkos DSL loader (for example an |
Unset (falls back to |
|
|
Opt-in switch to select the |
Unset / false (host compiler). |
|
|
Overrides the optimization flags of the |
|
|
|
Directory for the out-of-source |
|
|
Codegen logging, dumps, and autotune¶
These are read by compile_problem through the resolver in
python/pops/codegen/env.py. They supply DEFAULTS for the codegen step; an
explicit argument to compile_problem always wins (for example
compile_problem(debug=True) forces keep-generated regardless of
POPS_KEEP_GENERATED). Coercion is lenient: an unrecognised value falls back to
the safe default instead of raising. Every one of them is surfaced in
compiled.inspect() (criterion #47), so the env state that governed a compile is
inspectable rather than hidden.
Variable |
Effect |
Default |
Read in |
|---|---|---|---|
|
Log level for the compile/codegen path: |
Unset (quiet). |
|
|
Codegen-specific log level (same level vocabulary as |
Unset (falls back to |
|
|
Directory the compiled |
Unset (the |
|
|
Keep the generated |
Unset / false (source kept only in a temporary directory). |
|
|
After a successful compile (or a cache hit), dump the serialized Program IR (JSON) into |
Unset / false (no dump). |
|
|
After a successful compile (or a cache hit), dump the generated C++ source into |
Unset / false (no dump). |
|
|
Requested autotune level: |
Unset ( |
|
Debug / unsafe gate¶
Variable |
Effect |
Default |
Read in |
|---|---|---|---|
|
A DEBUG / UNSAFE gate. Disabled by default and never enabled implicitly by any other option. No backdoor behavior is wired today; this variable’s only effect is the GUARD: if it is set truthy ( |
Unset / false (disabled). |
|
Python runtime defaults¶
These are read by pops.runtime to default a no-argument Python call. They only
supply a default: an explicit Python argument always overrides the environment,
and an unset or unparseable value falls back to the built-in default (no stricter
rejection than passing the argument directly).
Variable |
Effect |
Default |
Read in |
|---|---|---|---|
|
Default thread count for |
Unset (falls back to |
|
|
Default level for |
Unset (the call’s default level). |
|
Runtime diagnostics¶
These are read by the C++ core (header-only). They are inert by default: setting them changes no output and no numerics, only optional behavior or stderr traces.
Variable |
Effect |
Default |
Read in |
|---|---|---|---|
|
Cell-count threshold under which |
|
|
|
When set to any value, enables a diagnostic trace of the |
Unset (no trace). |
|
Standard variables that pops writes¶
pops.set_threads(n) (in python/pops/runtime/threading.py) does not define any
POPS_* variable; it writes the standard Kokkos / OpenMP knobs so the chosen
backend picks up the thread count:
OMP_NUM_THREADSandKOKKOS_NUM_THREADSare both set ton(agnostic to whether Kokkos was built on the OpenMP or the Threads device);OMP_PROC_BINDis set tofalseonly on macOS (viasetdefault, so a value you already exported wins), to avoid libomp oversubscription warnings on dev Macs.
The cache directory resolution also reads the standard XDG_CACHE_HOME (see
POPS_CACHE_DIR above).
Test-only knobs¶
Two further names exist only inside the GPU validation harness
(python/tests/gpu/gpu_dsl_production_validate.cpp): POPS_DSLPROD_SOLVER and
POPS_DSLPROD_TRACE. They are test-only knobs, not part of the public runtime,
and are mentioned here only to avoid confusion with the variables above.