X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b4ac368a8512fa8ec30d04f55c4a3c660e9439b9..12ad1e7c01058fada33cecf2d4c4cb8bf9874f9e:/src/s4u/s4u_engine.cpp diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 7695d85c0b..97f2d89bb7 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -17,7 +17,7 @@ #include "src/kernel/routing/NetPoint.hpp" #include "src/kernel/routing/NetZoneImpl.hpp" #include "src/surf/network_interface.hpp" -#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON +#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface"); @@ -26,6 +26,7 @@ namespace s4u { xbt::signal onPlatformCreated; xbt::signal onSimulationEnd; xbt::signal onTimeAdvance; +xbt::signal onDeadlock; Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */ @@ -48,8 +49,9 @@ Engine::~Engine() Engine* Engine::getInstance() { if (s4u::Engine::instance_ == nullptr) - new Engine(0,nullptr); - return s4u::Engine::instance_; + return new Engine(0, nullptr); + else + return s4u::Engine::instance_; } void Engine::shutdown() { @@ -92,6 +94,16 @@ void Engine::getHostList(std::vector* list) for (auto const& kv : host_list) list->push_back(kv.second); } +/** @brief Returns the amount of links in the platform */ +size_t Engine::getLinkCount() +{ + return simgrid::surf::LinkImpl::linksCount(); +} +/** @brief Fills the passed list with all hosts found in the platform */ +void Engine::getLinkList(std::vector* list) +{ + simgrid::surf::LinkImpl::linksList(list); +} void Engine::run() { if (MC_is_active()) {