Top |
extern guint | fftw_default_flags |
#define | NCM_CFG_DATA_DIR_ENV |
#define | NCM_ZERO_LIMIT |
#define | NCM_DEFAULT_PRECISION |
#define | NCM_THREAD_POOL_MAX |
#define | mpz_inits |
#define | mpz_clears |
These functions are used to configure the library, including helper functions related to the library configuration.
void
ncm_cfg_init (void
);
Main library configuration function. Must be called before any other function of NumCosmo.
Initializes internal variables and sets all other library number of threads to one.
See also: ncm_cfg_init_full()
ncm_cfg_init_full_ptr()
.
void ncm_cfg_init_full_ptr (gint *argc
,gchar ***argv
);
Main library configuration function. Must be called before any other function of NumCosmo.
Initializes internal variables and sets all other library number of threads to one.
This function passes the arguments to other libraries, e.g, MPI. If that is not necessary
ncm_cfg_init()
should be used. This version should be used from C applications passing
argc
and argv
pointers from main.
See also: ncm_cfg_init()
ncm_cfg_init_full()
.
gchar ** ncm_cfg_init_full (gint argc
,gchar **argv
);
Main library configuration function. Must be called before any other function of NumCosmo.
Initializes internal variables and sets all other library number of threads to one.
This function passes the arguments to other libraries, e.g, MPI. If that is not necessary
ncm_cfg_init()
should be used. This version is compatible with bindings and can be safely
called from other languages.
See also: ncm_cfg_init()
ncm_cfg_init_full_ptr()
.
void
ncm_cfg_enable_gsl_err_handler (void
);
Enables the GSL error handler.
void
ncm_cfg_register_obj (GType obj
);
Registers the object obj
in the GObject type system.
gchar * ncm_cfg_get_fullpath (const gchar *filename
,...
);
Gets the full path of filename
.
const gchar *
ncm_cfg_get_fullpath_base (void
);
Gets the full path base directory.
void ncm_cfg_keyfile_to_arg (GKeyFile *kfile
,const gchar *group_name
,GOptionEntry *entries
,gchar **argv
,gint *argc
);
Transforms the entries
in a keyfile kfile
group group_name
into an array of
strings representing the command line arguments.
void ncm_cfg_entries_to_keyfile (GKeyFile *kfile
,const gchar *group_name
,GOptionEntry *entries
);
Transforms the entries
into a keyfile kfile
group group_name
.
gchar *
ncm_cfg_string_to_comment (const gchar *str
);
Transforms str
into a comment string.
const GEnumValue * ncm_cfg_get_enum_by_id_name_nick (GType enum_type
,const gchar *id_name_nick
);
Gets the enum value from enum_type
by id_name_nick
.
const GEnumValue * ncm_cfg_enum_get_value (GType enum_type
,guint n
);
Gets the enum value from enum_type
by n
.
void ncm_cfg_enum_print_all (GType enum_type
,const gchar *header
);
Prints all enum values from enum_type
.
void
ncm_cfg_lock_plan_fftw (void
);
Locks the FFTW plan. This is a generic lock for all FFTW plans.
void
ncm_cfg_unlock_plan_fftw (void
);
Unlocks the FFTW plan. This is a generic lock for all FFTW plans.
gboolean ncm_cfg_load_fftw_wisdom (const gchar *filename
,...
);
Loads the FFTW wisdom from filename
.
gboolean ncm_cfg_save_fftw_wisdom (const gchar *filename
,...
);
Saves the current FFTW wisdom to filename
.
gboolean ncm_cfg_exists (const gchar *filename
,...
);
Checks if filename
exists in the numcosmo path.
void
ncm_cfg_set_logfile (gchar *filename
);
Sets all log information to filename
.
void
ncm_cfg_set_logstream (FILE *stream
);
Sets all log information to stream
.
void
ncm_cfg_set_log_handler (NcmCfgLoggerFunc logger
);
Sets all log information to stream
.
void
ncm_cfg_set_error_log_handler (NcmCfgLoggerFunc logger
);
Sets all log information to stream
.
void
ncm_cfg_set_openmp_nthreads (gint n
);
Sets OpenMP number of threads to n
when available.
void
ncm_cfg_set_openblas_nthreads (gint n
);
Sets OpenBLAS number of threads to n
when available.
void
ncm_cfg_set_blis_nthreads (gint n
);
Sets BLIS number of threads to n
when available.
void
ncm_cfg_set_mkl_nthreads (gint n
);
Sets OpenBLAS number of threads to n
when available.
void
ncm_cfg_logfile_flush (gboolean on
);
Enables or disables the log file flush.
gchar * ncm_string_ww (const gchar *msg
,const gchar *first
,const gchar *rest
,guint ncols
);
Creates a word wrapped string.
void ncm_message_ww (const gchar *msg
,const gchar *first
,const gchar *rest
,guint ncols
);
Logs a word wrapped message.
gchar * ncm_cfg_get_data_filename (const gchar *filename
,gboolean must_exist
);
Looks for filename
in the data path and returns
the full path if found.
gchar *
ncm_cfg_get_data_directory (void
);
Gets the data directory path. It first checks the environment variable NCM_CFG_DATA_DIR_ENV, then the package data directory and finally the package source directory. If none of these directories exists, it raises an error.
gchar * ncm_cfg_command_line (gchar *argv[]
,gint argc
);
Converts argv
to a single string.
void ncm_cfg_array_set_variant (GArray *a
,GVariant *var
);
Transfers the data from var
to a
.
[skip]
GVariant * ncm_cfg_array_to_variant (GArray *a
,const GVariantType *etype
);
Creates a variant of array type from a
.
[skip]
void ncm_cfg_set_fftw_default_flag (guint flag
,const gdouble timeout
);
Sets the default FFTW flag (FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE)
to be used when building plans. The variable timeout
sets the maximum time spended on
planners.