Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[DOC] Fixed even more errors.
[simgrid.git] / src / msg / msg_global.cpp
index f0df69f..110694e 100644 (file)
@@ -16,6 +16,7 @@
 #include "xbt/replay.h"
 #include "simgrid/sg_config.h" /* Configuration mechanism of SimGrid */
 #include "src/surf/callbacks.h"
+#include "src/surf/platform.hpp"
 
 XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg,
@@ -67,8 +68,10 @@ void MSG_init_nocheck(int *argc, char **argv) {
     SIMIX_function_register_process_create(MSG_process_create_from_SIMIX);
     SIMIX_function_register_process_cleanup(MSG_process_cleanup_from_SIMIX);
 
-    sg_platf_postparse_add_cb(MSG_post_create_environment);
-    surf_on_host_created(MSG_host_create_);
+    simgrid::surf::on_postparse.connect(MSG_post_create_environment);
+    simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
+      MSG_host_create_(&host);
+    });
   }
 
   if(MC_is_active()){