Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to ensure that link_energy plugin is inited in a timely manner
[simgrid.git] / src / surf / plugins / link_energy.cpp
index b81cd6f..34e71ae 100644 (file)
@@ -193,6 +193,8 @@ void sg_link_energy_plugin_init()
     return;
   LinkEnergy::EXTENSION_ID = simgrid::s4u::Link::extension_create<LinkEnergy>();
 
+  xbt_assert(sg_host_count() == 0, "Please call sg_link_energy_plugin_init() before initializing the platform.");
+
   simgrid::s4u::Link::onCreation.connect([](simgrid::s4u::Link& link) {
     link.extension_set(new LinkEnergy(&link));
   });