From 148f5e8e381d67771e1b389f6ee068d25482b2f7 Mon Sep 17 00:00:00 2001 From: alegrand Date: Sat, 15 Mar 2008 20:34:24 +0000 Subject: [PATCH] The interaction between the parser and the surf modules makes more sense now. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5294 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/simix/smx_environment.c | 27 ++++++++++----------------- src/surf/surf.c | 2 +- src/surf/workstation.c | 2 -- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/simix/smx_environment.c b/src/simix/smx_environment.c index f1ff57960b..1198f5a830 100644 --- a/src/simix/smx_environment.c +++ b/src/simix/smx_environment.c @@ -33,7 +33,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, */ void SIMIX_create_environment(const char *file) { - int parsed = 0; xbt_dict_cursor_t cursor = NULL; char *name = NULL; void *workstation = NULL; @@ -98,24 +97,18 @@ void SIMIX_create_environment(const char *file) surf_cpu_model_description[cpu_id].model_init(file); surf_network_model_description[network_id].model_init(file); - start = xbt_os_time(); - parse_platform_file(file); - end = xbt_os_time(); - DEBUG1("PARSE TIME: %lg", (end-start)); - parsed = 1; - } + } surf_workstation_model_description[workstation_id]. - model_init(file); - - if (!parsed) { - start = xbt_os_time(); - parse_platform_file(file); - if (surf_workstation_model_description[workstation_id].create_ws != NULL) - surf_workstation_model_description[workstation_id].create_ws(); - end = xbt_os_time(); - DEBUG1("PARSE TIME: %lg", (end-start)); - } + model_init(file); + + start = xbt_os_time(); + parse_platform_file(file); + + if (surf_workstation_model_description[workstation_id].create_ws != NULL) + surf_workstation_model_description[workstation_id].create_ws(); + end = xbt_os_time(); + DEBUG1("PARSE TIME: %lg", (end-start)); _simix_init_status = 2; /* inited; don't change settings now */ diff --git a/src/surf/surf.c b/src/surf/surf.c index 2f7957df2e..016ab2a2e2 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -143,7 +143,7 @@ s_surf_model_description_t surf_cpu_model_description[surf_cpu_model_description s_surf_model_description_t surf_workstation_model_description[surf_workstation_model_description_size] = { {"CLM03", NULL, surf_workstation_model_init_CLM03, create_workstations}, - {"compound", NULL, surf_workstation_model_init_compound, NULL}, + {"compound", NULL, surf_workstation_model_init_compound, create_workstations}, {"ptask_L07", NULL, surf_workstation_model_init_ptask_L07, NULL} }; diff --git a/src/surf/workstation.c b/src/surf/workstation.c index 8229535614..379cf3222d 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -427,7 +427,6 @@ void surf_workstation_model_init_CLM03(const char *filename) surf_workstation_model_init_internal(); surf_cpu_model_init_Cas01(filename); surf_network_model_init_CM02(filename); -// create_workstations(); update_model_description(surf_workstation_model_description, surf_workstation_model_description_size, "CLM03", @@ -441,7 +440,6 @@ void surf_workstation_model_init_compound(const char *filename) xbt_assert0(surf_cpu_model, "No CPU model defined yet!"); xbt_assert0(surf_network_model, "No network model defined yet!"); surf_workstation_model_init_internal(); - create_workstations(); update_model_description(surf_workstation_model_description, surf_workstation_model_description_size, -- 2.20.1