X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/38f246c4c46920a78ea0af8233449f402c178f04..86a1011750f50a04258aa9cf0eeb23e666cf6bf2:/src/surf/xml/surfxml_parseplatf.cpp diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 2576e498ba..674d7f5daa 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -3,11 +3,12 @@ /* 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 "surf/surf.hpp" #include "src/surf/cpu_interface.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/surf_interface.hpp" #include "src/surf/xml/platf_private.hpp" +#include "surf/surf.hpp" +#include #include @@ -100,12 +101,15 @@ void parse_platform_file(const std::string& file) /* Do the actual parsing */ surf_parse(); + /* Get the Engine singleton once and for all*/ + const auto engine = simgrid::s4u::Engine::get_instance(); + /* connect all profiles relative to hosts */ for (auto const& elm : trace_connect_list_host_avail) { surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Trace ")+elm.first+" undefined."); auto profile = traces_set_list.at(elm.first); - auto host = simgrid::s4u::Host::by_name_or_null(elm.second); + auto host = engine->host_by_name_or_null(elm.second); surf_parse_assert(host, std::string(": Host ") + elm.second + " undefined."); host->set_state_profile(profile); } @@ -114,7 +118,7 @@ void parse_platform_file(const std::string& file) surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Trace ")+elm.first+" undefined."); auto profile = traces_set_list.at(elm.first); - auto host = simgrid::s4u::Host::by_name_or_null(elm.second); + auto host = engine->host_by_name_or_null(elm.second); surf_parse_assert(host, std::string(": Host ") + elm.second + " undefined."); host->set_speed_profile(profile); } @@ -123,7 +127,7 @@ void parse_platform_file(const std::string& file) surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Trace ")+elm.first+" undefined."); auto profile = traces_set_list.at(elm.first); - auto link = simgrid::s4u::Link::by_name_or_null(elm.second); + auto link = engine->link_by_name_or_null(elm.second); surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_state_profile(profile); } @@ -132,7 +136,7 @@ void parse_platform_file(const std::string& file) surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Trace ")+elm.first+" undefined."); auto profile = traces_set_list.at(elm.first); - auto link = simgrid::s4u::Link::by_name_or_null(elm.second); + auto link = engine->link_by_name_or_null(elm.second); surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_bandwidth_profile(profile); } @@ -141,7 +145,7 @@ void parse_platform_file(const std::string& file) surf_parse_assert(traces_set_list.find(elm.first) != traces_set_list.end(), std::string(": Trace ")+elm.first+" undefined."); auto profile = traces_set_list.at(elm.first); - auto link = simgrid::s4u::Link::by_name_or_null(elm.second); + auto link = engine->link_by_name_or_null(elm.second); surf_parse_assert(link, std::string(": Link ") + elm.second + " undefined."); link->set_latency_profile(profile); }