celeritas
celeritas copied to clipboard
Refactor CELER_(DISABLE|PARALLEL) environment variables
We have some environment variables that "disable" capabilities automatically on (e.g., MPI or CUDA), others that "enable" capabilities (profiling). The "color" environment variable can be disabled or enabled, with an "automatic" evaluation as a third option.
It would be better to have an API:
template<class T>
T getenv(std::string const& key, T default);
so for example we could set
static bool use_root = getenv("CELER_ROOT", CELERITAS_USE_ROOT);
and the getenv would:
- load the environment variable (and register its access for later output)
- set the value to the default if blank, or parse the variable otherwise
- save the possibly defaulted result into the environment list