X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b202abf4024ab977d86f64d5ff65094e09eb3a53..c46aba70aa4ccf22cc19fac31d451c7158e922dd:/src/simgrid/sg_config.c diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 4a9c9d7917..187e8aea8d 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -18,6 +18,7 @@ #include "instr/instr_interface.h" #include "simgrid/simix.h" #include "simgrid/sg_config.h" +#include "simgrid_config.h" /* what was compiled in? */ #ifdef HAVE_SMPI #include "smpi/smpi_interface.h" #endif @@ -772,7 +773,7 @@ void sg_config_init(int *argc, char **argv) //test is if( size >= thresholdN ) return valueN; //Values can be modified with command line --cfg=smpi/bw_factor:"threshold0:value0;threshold1:value1;...;thresholdN:valueN" // or with tag config put line - // SMPI model can be used without enable_smpi, so keep this the ifdef. + // SMPI model can be used without enable_smpi, so keep this out of the ifdef. xbt_cfg_register(&_sg_cfg_set, "smpi/bw_factor", "Bandwidth factors for smpi.", xbt_cfgelm_string, 1, 1, NULL); @@ -949,75 +950,6 @@ void sg_config_finalize(void) _sg_cfg_init_status = 0; } -/* Pick the right models for CPU, net and host, and call their model_init_preparse */ -void surf_config_models_setup() -{ - const char *host_model_name; - const char *vm_model_name; - int host_id = -1; - int vm_id = -1; - char *network_model_name = NULL; - char *cpu_model_name = NULL; - int storage_id = -1; - char *storage_model_name = NULL; - - host_model_name = xbt_cfg_get_string(_sg_cfg_set, "host/model"); - vm_model_name = xbt_cfg_get_string(_sg_cfg_set, "vm/model"); - network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model"); - cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model"); - storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model"); - - /* Check whether we use a net/cpu model differing from the default ones, in which case - * we should switch to the "compound" host model to correctly dispatch stuff to - * the right net/cpu models. - */ - - if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") || - !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) && - xbt_cfg_is_default_value(_sg_cfg_set, "host/model")) { - host_model_name = "compound"; - xbt_cfg_set_string(_sg_cfg_set, "host/model", host_model_name); - } - - XBT_DEBUG("host model: %s", host_model_name); - host_id = find_model_description(surf_host_model_description, host_model_name); - if (!strcmp(host_model_name, "compound")) { - int network_id = -1; - int cpu_id = -1; - - xbt_assert(cpu_model_name, - "Set a cpu model to use with the 'compound' host model"); - - xbt_assert(network_model_name, - "Set a network model to use with the 'compound' host model"); - - if(surf_cpu_model_init_preparse){ - surf_cpu_model_init_preparse(); - } else { - cpu_id = - find_model_description(surf_cpu_model_description, cpu_model_name); - surf_cpu_model_description[cpu_id].model_init_preparse(); - } - - network_id = - find_model_description(surf_network_model_description, - network_model_name); - surf_network_model_description[network_id].model_init_preparse(); - } - - XBT_DEBUG("Call host_model_init"); - surf_host_model_description[host_id].model_init_preparse(); - - XBT_DEBUG("Call vm_model_init"); - vm_id = find_model_description(surf_vm_model_description, vm_model_name); - surf_vm_model_description[vm_id].model_init_preparse(); - - XBT_DEBUG("Call storage_model_init"); - storage_id = find_model_description(surf_storage_model_description, storage_model_name); - surf_storage_model_description[storage_id].model_init_preparse(); - -} - int sg_cfg_is_default_value(const char *name) { return xbt_cfg_is_default_value(_sg_cfg_set, name);