Cleanup kernel status and configuration flags #3396
Labels
I: External API
Developers of extensions or other language bindings may need to adapt their code
S: Normal
Handle this with default priority
T: Discussion
Still searching for the right way to proceed / suggestions welcome
T: Enhancement
New functionality, model or documentation
Current state
nest.GetKernelStatus()
returns a mixture of run-time states, compile time configurations and options. In code this is reflected with different mechanisms and on different levels:-Dwith-...
, which inconsistently areON
/OFF
flags in most cases, but sometimes take a path argument,HAVE_…
preprocessor macros that partially are transfered identically from thewith-…
cmake-flags, and sometimes set explicitly in header files.is_threaded
(bool) in the SLI status dict.Additionally, there is the external script
nest-config
that returns partially the same information, together with flags and library paths for the compiler and linker. This information is usually required by external tools compiling modules, such as NEST ML. Many of these flags however become meaningless when deploying pre-built binaries with APT or PIP, as all shown paths are only available on the build-system which is usually not available to the users. Thenest-config
is a bash-script template filled by cmake withNEST_VERSION
),CMAKE_CXX_COMPILER
,CMAKE_CXX_COMPILER_VERSION
, …),ALL_INCLUDES
,Python_EXECUTABLE
, library paths, …), andCMAKE_INSTALL_DIR
,CMAKE_INSTALL_DOCDIR
, …)The current state is that an incomplete subset of this information is available via
nest.GetKernelStatus()
and a different incomplete subset is available from thenest-config
shell script.Where to go
#ifdef HAVE_MPI
problems (note that currently cmake setsHAVE_MPI=OFF
, so using the conventionalifdef
is ineffective)To start the discussion I could imagine a split at least into three classes of variables. In a hypothetical Python representation available via the imported
nest
object:nest.features
: built-in options and feature-flags regarding the neuroscientific and operational domains ("detailed_timers", "mpi", "conductance_models", "gap_junctions", …)nest.build
: static technical compile-time information ("version=3.9.0", "compiler_flags=-O3", "prefix=/path/to/nest", "mpiexec=orterun", "libgsl=/usr/lib/...", "boost=/lib/libboost…")nest.status
: dynamic run-time information of the current NEST instance ("time_simulate", "time_construct", "ranks", "nlocalproc", "rss_size", "spike_compression", …)Additional context
This discussion was triggered by recurring problems in packaging where paths from the config tend to "leak" from the build-system. This is especially relevant when install locations of NEST and/or libraries are not known beforehand, such as in Python environments, and when requiring to reproduce the compile-time environment on the user machine, as with NESTML.
Configuration is found at least in these files:
nestkernel/config.h.in
bin/nest-config.in
CMakeLists.txt
The text was updated successfully, but these errors were encountered: