Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
It's the least I can do in a cancel function...
[simgrid.git] / src / smpi / smpi_global.c
index bef49b1..4f60f00 100644 (file)
@@ -136,6 +136,11 @@ void smpi_mpi_min_func(void *a, void *b, int *length,
 void smpi_mpi_max_func(void *a, void *b, int *length,
                        MPI_Datatype * datatype);
 
+void smpi_init()
+{
+  smpi_global = xbt_new(s_smpi_global_t, 1);
+}
+
 void smpi_global_init()
 {
   int i;
@@ -151,7 +156,9 @@ void smpi_global_init()
   XBT_LOG_CONNECT(smpi_util, smpi);
 #endif
 
-  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 =
@@ -328,6 +335,9 @@ int smpi_run_simulation(int *argc, char **argv)
                    "Boolean indicating whether we should display the timing after simulation.",
                    xbt_cfgelm_int, &default_display_timing, 1, 1, NULL, NULL);
 
+  // Allocate minimal things before parsing command line arguments
+  smpi_init();
+
   SIMIX_global_init(argc, argv);
 
 
@@ -357,3 +367,8 @@ int smpi_run_simulation(int *argc, char **argv)
 
   return 0;
 }
+
+int main(int argc, char** argv)
+{
+  return smpi_run_simulation(&argc, argv);
+}