X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9bc2f7734295810a24f98d65169f06705e3ea951..bc0e9c9ecdf8b93f139978e522433f0a9fdcdedd:/src/msg/msg_global.cpp diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index f4dd8abf85..3b0e79a5d0 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -3,16 +3,18 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "simgrid/s4u/engine.hpp" #include "simgrid/s4u/host.hpp" #include "instr/instr_interface.h" #include "mc/mc.h" #include "src/msg/msg_private.h" -#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME by removing MSG_post_create_environment() XBT_LOG_NEW_CATEGORY(msg, "All MSG categories"); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)"); +SG_BEGIN_DECL() + MSG_Global_t msg_global = nullptr; static void MSG_exit(); @@ -23,11 +25,6 @@ static void _sg_cfg_cb_msg_debug_multiple_use(const char *name) msg_global->debug_multiple_use = xbt_cfg_get_boolean(name); } -static void MSG_host_create_(sg_host_t host) -{ - __MSG_host_create(host); -} - /** * \ingroup msg_simulation * \brief Initialize MSG with less verifications @@ -54,14 +51,12 @@ 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); - simgrid::surf::on_postparse.connect(MSG_post_create_environment); + simgrid::s4u::onPlatformCreated.connect(MSG_post_create_environment); + + simgrid::MsgHostExt::EXTENSION_ID = simgrid::s4u::Host::extension_create(); simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) { - MSG_host_create_(&host); - }); - MSG_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) { - __MSG_host_priv_free((msg_host_priv_t) p); + host.extension_set(new simgrid::MsgHostExt()); }); - } if(MC_is_active()){ @@ -142,3 +137,5 @@ unsigned long int MSG_get_sent_msg() { return msg_global->sent_msg; } + +SG_END_DECL()