Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix errors with relative includes with smpicc
[simgrid.git] / src / smpi / smpi_global.c
index bef49b1..e242d92 100644 (file)
@@ -153,6 +153,10 @@ void smpi_global_init()
 
   smpi_global = xbt_new(s_smpi_global_t, 1);
 
+  // config vars
+  smpi_global->reference_speed =
+    xbt_cfg_get_double(_surf_cfg_set, "reference_speed");
+
   // mallocators
   smpi_global->request_mallocator =
     xbt_mallocator_new(SMPI_REQUEST_MALLOCATOR_SIZE, smpi_request_new,
@@ -309,8 +313,11 @@ smx_cond_t smpi_process_cond()
 
 static void smpi_cfg_cb_host_speed(const char *name, int pos)
 {
-  smpi_global->reference_speed =
-    xbt_cfg_get_double_at(_surf_cfg_set, name, pos);
+  if(smpi_global)
+  {
+    smpi_global->reference_speed =
+      xbt_cfg_get_double_at(_surf_cfg_set, name, pos);
+  }
 }
 
 int smpi_run_simulation(int *argc, char **argv)
@@ -357,3 +364,8 @@ int smpi_run_simulation(int *argc, char **argv)
 
   return 0;
 }
+
+int main(int argc, char** argv)
+{
+  return smpi_run_simulation(&argc, argv);
+}