From 79ba0e25e50b8ecaf5fd4df7ca4fd39e6e3ac232 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 21 Nov 2017 16:15:58 +0100 Subject: [PATCH 1/1] allow to retrieve the link list from the Engine --- include/simgrid/s4u/Engine.hpp | 2 ++ src/s4u/s4u_engine.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index e705bab613..805a309301 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -58,6 +58,8 @@ public: size_t getHostCount(); void getHostList(std::vector * whereTo); + size_t getLinkCount(); + void getLinkList(std::vector * list); /** @brief Run the simulation */ void run(); diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index c16b189cf7..886cc33a91 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -93,6 +93,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()) { -- 2.20.1