X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bff077b4621c68455a86e60292cb0bf872a879d5..28b96ce2e782890f1d8d9410ec192cd342f81b23:/src/simix/smx_config.c?ds=sidebyside diff --git a/src/simix/smx_config.c b/src/simix/smx_config.c index 77d690fb10..bb727bc1ca 100644 --- a/src/simix/smx_config.c +++ b/src/simix/smx_config.c @@ -10,9 +10,9 @@ #include "xbt/sysdep.h" #include "xbt/log.h" -int _simix_init_status = 0; /* 0: beginning of time; - 1: pre-inited (cfg_set created); - 2: inited (running) */ +int _simix_init_status = 0; /* 0: beginning of time; + 1: pre-inited (cfg_set created); + 2: inited (running) */ xbt_cfg_t _simix_cfg_set = NULL; /* callback of the workstation_model variable */ @@ -21,14 +21,12 @@ static void _simix_cfg_cb__workstation_model(const char *name, int pos) char *val; xbt_assert0(_simix_init_status < 2, - "Cannot change the model after the initialization"); + "Cannot change the model after the initialization"); val = xbt_cfg_get_string(_simix_cfg_set, name); /* New Module missing */ - find_model_description(surf_workstation_model_description, - surf_workstation_model_description_size, - val); + find_model_description(surf_workstation_model_description, val); } /* callback of the cpu_model variable */ @@ -37,12 +35,11 @@ static void _simix_cfg_cb__cpu_model(const char *name, int pos) char *val; xbt_assert0(_simix_init_status < 2, - "Cannot change the model after the initialization"); + "Cannot change the model after the initialization"); val = xbt_cfg_get_string(_simix_cfg_set, name); /* New Module missing */ - find_model_description(surf_cpu_model_description, - surf_cpu_model_description_size, val); + find_model_description(surf_cpu_model_description, val); } /* callback of the workstation_model variable */ @@ -51,20 +48,28 @@ static void _simix_cfg_cb__network_model(const char *name, int pos) char *val; xbt_assert0(_simix_init_status < 2, - "Cannot change the model after the initialization"); + "Cannot change the model after the initialization"); val = xbt_cfg_get_string(_simix_cfg_set, name); /* New Module missing */ - find_model_description(surf_network_model_description, - surf_network_model_description_size, val); + find_model_description(surf_network_model_description, val); } +XBT_LOG_EXTERNAL_CATEGORY(simix); +XBT_LOG_EXTERNAL_CATEGORY(simix_action); +XBT_LOG_EXTERNAL_CATEGORY(simix_deployment); +XBT_LOG_EXTERNAL_CATEGORY(simix_environment); +XBT_LOG_EXTERNAL_CATEGORY(simix_host); +XBT_LOG_EXTERNAL_CATEGORY(simix_kernel); +XBT_LOG_EXTERNAL_CATEGORY(simix_process); +XBT_LOG_EXTERNAL_CATEGORY(simix_synchro); + /* create the config set and register what should be */ void simix_config_init(void) { if (_simix_init_status) - return; /* Already inited, nothing to do */ + return; /* Already inited, nothing to do */ /* Connect our log channels: that must be done manually under windows */ XBT_LOG_CONNECT(simix_action, simix); @@ -74,20 +79,20 @@ void simix_config_init(void) XBT_LOG_CONNECT(simix_kernel, simix); XBT_LOG_CONNECT(simix_process, simix); XBT_LOG_CONNECT(simix_synchro, simix); - + _simix_init_status = 1; _simix_cfg_set = xbt_cfg_new(); xbt_cfg_register(_simix_cfg_set, - "workstation_model", xbt_cfgelm_string, 1, 1, - &_simix_cfg_cb__workstation_model, NULL); + "workstation_model", xbt_cfgelm_string, 1, 1, + &_simix_cfg_cb__workstation_model, NULL); xbt_cfg_register(_simix_cfg_set, - "cpu_model", xbt_cfgelm_string, 1, 1, - &_simix_cfg_cb__cpu_model, NULL); + "cpu_model", xbt_cfgelm_string, 1, 1, + &_simix_cfg_cb__cpu_model, NULL); xbt_cfg_register(_simix_cfg_set, - "network_model", xbt_cfgelm_string, 1, 1, - &_simix_cfg_cb__network_model, NULL); + "network_model", xbt_cfgelm_string, 1, 1, + &_simix_cfg_cb__network_model, NULL); xbt_cfg_set_string(_simix_cfg_set, "workstation_model", "CLM03"); } @@ -96,7 +101,7 @@ void simix_config_finalize(void) { if (!_simix_init_status) - return; /* Not initialized yet. Nothing to do */ + return; /* Not initialized yet. Nothing to do */ xbt_cfg_free(&_simix_cfg_set); _simix_init_status = 0;