X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/72d32c4e88a57f4786f62fec48a1bfa454adbff9..76fd6cc1330945172740464411a0b2f1170dcb2a:/src/plugins/link_load.cpp diff --git a/src/plugins/link_load.cpp b/src/plugins/link_load.cpp index 0ecac0cac9..1afdd6ea2b 100644 --- a/src/plugins/link_load.cpp +++ b/src/plugins/link_load.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -8,6 +8,7 @@ #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/resource/NetworkModel.hpp" +#include "src/simgrid/module.hpp" // SIMGRID_REGISTER_PLUGIN #include @@ -66,7 +67,7 @@ public: xbt::Extension LinkLoad::EXTENSION_ID; -LinkLoad::LinkLoad(s4u::Link* ptr) : link_(ptr), is_tracked_(false) +LinkLoad::LinkLoad(s4u::Link* ptr) : link_(ptr) { XBT_DEBUG("Instantiating a LinkLoad for link '%s'", link_->get_cname()); } @@ -181,7 +182,8 @@ static void on_communication(const simgrid::kernel::activity::CommImpl& comm) */ void sg_link_load_plugin_init() { - xbt_assert(simgrid::s4u::Engine::get_instance()->get_host_count() == 0, + xbt_assert(simgrid::s4u::Engine::get_instance()->get_host_count() == 0 && + simgrid::s4u::Engine::get_instance()->get_link_count() == 0, "Please call sg_link_load_plugin_init() BEFORE initializing the platform."); xbt_assert(not LinkLoad::EXTENSION_ID.valid(), "Double call to sg_link_load_plugin_init. Aborting."); LinkLoad::EXTENSION_ID = simgrid::s4u::Link::extension_create();