Environment variables

ClimaCore reads a small number of environment variables. The two that select the hardware belong to ClimaComms and apply to every CliMA package; one controls precompilation; the rest tune or instrument the CUDA kernels and are read once when the CUDA extension loads.

VariableRead byValuesEffect
CLIMACOMMS_DEVICEClimaCommsCPU (default), CPUMultiThreaded, CUDAThe compute device returned by ClimaComms.device(), on which spaces and fields are allocated. Requires ClimaComms.@import_required_backends in the script and CUDA.jl in the load path for CUDA.
CLIMACOMMS_CONTEXTClimaCommsSINGLETON (default), MPIThe communication context returned by ClimaComms.context(); MPI distributes horizontal topologies over ranks.
CLIMA_SKIP_PRECOMPILE_WORKLOADClimaCoretrue or unsetSkip the precompilation workload that warms up common broadcasts, for faster development builds.
CLIMA_CUDA_MAX_WAVESClimaCoreCUDAExtInteger (default 1)Upper bound on the number of thread-block waves a kernel launch may use.
CLIMA_FD_MAX_THREADSClimaCoreCUDAExtInteger (default 128, at most 1024)Threads per block for finite-difference (column) kernels.
CLIMA_DSS_MAX_THREADSClimaCoreCUDAExtInteger (default 256, at most 1024)Threads per block for the DSS kernels.
CLIMA_NAME_CUDA_KERNELS_FROM_STACK_TRACEClimaCoreCUDAExttrue or unsetName each CUDA kernel after the call site that launched it, for profilers.
CLIMA_COLLECT_KERNEL_STATSClimaCoreCUDAExttrue or unsetRecord per-launch statistics for kernel-configuration sweeps. Read at precompilation of the extension, so changing it requires recompiling.

The *_MAX_* and kernel-naming variables are read when the extension loads; changing them requires a new Julia session. perf/sweep_kernel_configs.jl sweeps them. The defaults are tuned for A100- and H100-class GPUs (Run on a GPU).

The ClimaComms documentation describes CLIMACOMMS_DEVICE and CLIMACOMMS_CONTEXT, including the SINGLETON context for running an MPI-launched job on one process.