From 3400fc8e74d6ccf632346df99770baf940a1bedc Mon Sep 17 00:00:00 2001 From: Navarrop Date: Wed, 20 Apr 2011 16:18:06 +0200 Subject: [PATCH] Do really what we claim to do. Use xbt_cfg_is_default_value(_surf_cfg_set, opt) to know if it is the default value. --- src/surf/surf_config.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c index 0fff09fabb..f7d686ec9a 100644 --- a/src/surf/surf_config.c +++ b/src/surf/surf_config.c @@ -460,14 +460,16 @@ void surf_config_models_setup(const char *platform_file) * we should switch to the "compound" workstation model to correctly dispatch stuff to * the right net/cpu models. */ - if ((strcmp(network_model_name, "LV08") - || strcmp(cpu_model_name, "Cas01")) - && !strcmp(workstation_model_name, "CLM03")) { - const char *val = "compound"; - XBT_INFO - ("Switching workstation model to compound since you changed the network and/or cpu model(s)"); - xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val); - workstation_model_name = (char *) "compound"; + + if((!xbt_cfg_is_default_value(_surf_cfg_set, "network/model") || + !xbt_cfg_is_default_value(_surf_cfg_set, "cpu/model")) && + xbt_cfg_is_default_value(_surf_cfg_set, "workstation/model")) + { + const char *val = "compound"; + XBT_INFO + ("Switching workstation model to compound since you changed the network and/or cpu model(s)"); + xbt_cfg_set_string(_surf_cfg_set, "workstation/model", val); + workstation_model_name = (char *) "compound"; } XBT_DEBUG("Workstation model: %s", workstation_model_name); -- 2.20.1