Function

NumCosmoMathcfg_init

Declaration [src]

void
ncm_cfg_init (
  void
)

Description [src]

Initializes the library; it must be called before any other NumCosmo function, and later calls return immediately. It

  • sets the default FFTW planner flag and time limit from NCM_FFTW_PLANNER and NCM_FFTW_PLANNER_TIMELIMIT, see ncm_cfg_set_fftw_default_from_env_str(); the time limit is 10 s when NCM_FFTW_PLANNER_TIMELIMIT is not set;
  • creates the NumCosmo user data directory, see ncm_cfg_get_fullpath(); it is NUMCOSMO_HOME when set, otherwise ~/.numcosmo when that directory exists (deprecated), otherwise $XDG_DATA_HOME/numcosmo, or ~/.local/share/numcosmo when XDG_DATA_HOME is unset, empty or relative; aborts when NUMCOSMO_HOME is relative or the directory cannot be created;
  • sets the Cuba library core counts to zero;
  • turns the GSL error handler off, see ncm_cfg_enable_gsl_err_handler();
  • installs the NumCosmo log handlers;
  • warns when OMP_NUM_THREADS exceeds OMP_THREAD_LIMIT, since an OpenMP-threaded BLAS can then deadlock;
  • registers the library objects and functions;
  • under an MPI launcher, initializes MPI; every rank except the master then runs the worker loop and never returns.

MPI is detected from the launcher’s environment (Open MPI, MPICH/Hydra, Slurm); NUMCOSMO_MPI_INIT set to 1 or 0 forces or skips it.

Same as ncm_cfg_init_full() without command-line arguments.