Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix my previous commit, sorry
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 2 Mar 2016 00:38:47 +0000 (01:38 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 2 Mar 2016 00:38:47 +0000 (01:38 +0100)
src/simdag/sd_global.cpp
src/simix/smx_environment.cpp
src/simix/smx_global.cpp
src/surf/sg_platf.cpp

index 2ec7169..2b7e904 100644 (file)
@@ -9,6 +9,7 @@
 #include "simgrid/host.h"
 #include "src/simdag/simdag_private.h"
 #include "src/surf/surf_interface.hpp"
+#include "simgrid/s4u/engine.hpp"
 
 #ifdef HAVE_JEDULE
 #include "simgrid/jedule/jedule_sd_binding.h"
@@ -90,7 +91,7 @@ void SD_config(const char *key, const char *value){
  */
 void SD_create_environment(const char *platform_file)
 {
-  parse_platform_file(platform_file);
+  simgrid::s4u::Engine::instance()->loadPlatform(platform_file);
 
   XBT_DEBUG("Workstation number: %zu, link number: %d", sg_host_count(), sg_link_count());
 #ifdef HAVE_JEDULE
index 279e6ea..3d82fd9 100644 (file)
@@ -32,10 +32,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix,
  */
 void SIMIX_create_environment(const char *file)
 {
+  xbt_ex_t e;
   double start = 0, end = 0;
   if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
     start = xbt_os_time();
-  parse_platform_file(file);
+  TRY {
+    parse_platform_file(file);
+  } CATCH (e) {
+    xbt_die("Error while loading %s: %s", file, e.msg);
+  }
   if(XBT_LOG_ISENABLED(simix_environment, xbt_log_priority_debug))
     end = xbt_os_time();
   XBT_DEBUG("PARSE TIME: %g", (end - start));
index 68e296f..a61a3d8 100644 (file)
@@ -263,14 +263,12 @@ void SIMIX_global_init(int *argc, char **argv)
         SIMIX_storage_create_(s);
       });
 
-
+    SIMIX_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, SIMIX_storage_destroy);
   }
   if (!simix_timers) {
     simix_timers = xbt_heap_new(8, &free);
   }
 
-  SIMIX_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, SIMIX_storage_destroy);
-
   if (sg_cfg_get_boolean("clean_atexit"))
     atexit(SIMIX_clean);
 
index 8e4a5a3..62e4fad 100644 (file)
@@ -415,10 +415,7 @@ void sg_platf_new_storage(sg_platf_storage_cbarg_t storage)
       storage->type_id,
       storage->content);
 
-  xbt_lib_set(storage_lib,
-      storage->id,
-      ROUTING_STORAGE_LEVEL,
-      (void *) xbt_strdup(storage->type_id));
+  xbt_lib_set(storage_lib, storage->id, ROUTING_STORAGE_LEVEL, (void *) xbt_strdup(storage->type_id));
 
   // if storage content is not specified use the content of storage_type if any
   if(!strcmp(storage->content,"") && strcmp(((storage_type_t) stype)->content,"")){