Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The interaction between the parser and the surf modules makes more sense now.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:34:24 +0000 (20:34 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 15 Mar 2008 20:34:24 +0000 (20:34 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5294 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/smx_environment.c
src/surf/surf.c
src/surf/workstation.c

index f1ff579..1198f5a 100644 (file)
@@ -33,7 +33,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
  */
 void SIMIX_create_environment(const char *file)
 {
  */
 void SIMIX_create_environment(const char *file)
 {
-  int parsed = 0;
   xbt_dict_cursor_t cursor = NULL;
   char *name = NULL;
   void *workstation = NULL;
   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);
 
     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].
   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 */
 
 
   _simix_init_status = 2;      /* inited; don't change settings now */
 
index 2f7957d..016ab2a 100644 (file)
@@ -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},
 
 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}
 };
 
   {"ptask_L07", NULL, surf_workstation_model_init_ptask_L07, NULL}
 };
 
index 8229535..379cf32 100644 (file)
@@ -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);
   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",
   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();
   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,
 
   update_model_description(surf_workstation_model_description,
                              surf_workstation_model_description_size,