From: SUTER Frederic Date: Mon, 20 Sep 2021 13:45:07 +0000 (+0200) Subject: save some hidden calls to Engine::get_instance X-Git-Tag: v3.29~74 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/86a1011750f50a04258aa9cf0eeb23e666cf6bf2 save some hidden calls to Engine::get_instance --- diff --git a/examples/cpp/energy-wifi/s4u-energy-wifi.cpp b/examples/cpp/energy-wifi/s4u-energy-wifi.cpp index a2d9a7ed23..b4f0983f0d 100644 --- a/examples/cpp/energy-wifi/s4u-energy-wifi.cpp +++ b/examples/cpp/energy-wifi/s4u-energy-wifi.cpp @@ -52,13 +52,13 @@ int main(int argc, char** argv) engine.load_platform(argv[1]); // setup WiFi bandwidths - const auto* l = simgrid::s4u::Link::by_name("AP1"); - l->set_host_wifi_rate(simgrid::s4u::Host::by_name("Station 1"), 0); - l->set_host_wifi_rate(simgrid::s4u::Host::by_name("Station 2"), 0); + const auto* l = engine.link_by_name("AP1"); + l->set_host_wifi_rate(engine.host_by_name("Station 1"), 0); + l->set_host_wifi_rate(engine.host_by_name("Station 2"), 0); // create the two actors for the test - simgrid::s4u::Actor::create("act0", simgrid::s4u::Host::by_name("Station 1"), sender); - simgrid::s4u::Actor::create("act1", simgrid::s4u::Host::by_name("Station 2"), receiver); + simgrid::s4u::Actor::create("act0", engine.host_by_name("Station 1"), sender); + simgrid::s4u::Actor::create("act1", engine.host_by_name("Station 2"), receiver); engine.run(); diff --git a/examples/cpp/network-wifi/s4u-network-wifi.cpp b/examples/cpp/network-wifi/s4u-network-wifi.cpp index 4ac5f122c9..8d30241e97 100644 --- a/examples/cpp/network-wifi/s4u-network-wifi.cpp +++ b/examples/cpp/network-wifi/s4u-network-wifi.cpp @@ -41,7 +41,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Actor::create("receiver", station2, receiver, mailbox); /* Declare that the stations are not at the same distance from their AP */ - auto ap = simgrid::s4u::Link::by_name("AP1"); + auto ap = e.link_by_name("AP1"); ap->set_host_wifi_rate(station1, 1); // The host "Station 1" uses the second level of bandwidths on that AP ap->set_host_wifi_rate(station2, 0); // This is perfectly useless as level 0 is used by default diff --git a/src/surf/SplitDuplexLinkImpl_test.cpp b/src/surf/SplitDuplexLinkImpl_test.cpp index 8a2a928a91..b36ea8aad2 100644 --- a/src/surf/SplitDuplexLinkImpl_test.cpp +++ b/src/surf/SplitDuplexLinkImpl_test.cpp @@ -20,9 +20,9 @@ TEST_CASE("SplitDuplexLink: create", "") simgrid::s4u::Link* link_down; simgrid::s4u::SplitDuplexLink* link; REQUIRE_NOTHROW(link = zone->create_split_duplex_link("link", "100GBps")); - REQUIRE(simgrid::s4u::SplitDuplexLink::by_name("link") == link); - REQUIRE_NOTHROW(link_up = simgrid::s4u::Link::by_name("link_UP")); - REQUIRE_NOTHROW(link_down = simgrid::s4u::Link::by_name("link_DOWN")); + REQUIRE(e.split_duplex_link_by_name("link") == link); + REQUIRE_NOTHROW(link_up = e.link_by_name("link_UP")); + REQUIRE_NOTHROW(link_down = e.link_by_name("link_DOWN")); REQUIRE(link_up->get_bandwidth() == 100e9); REQUIRE(link_down->get_bandwidth() == 100e9); REQUIRE(link_up == link->get_link_up()); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 08386317d9..712824ead1 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -377,11 +377,12 @@ static void sg_platf_build_hostlink(simgrid::kernel::routing::StarZone* zone, const simgrid::kernel::routing::HostLinkCreationArgs* hostlink, const simgrid::s4u::Link* backbone) { - simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint(); + const auto engine = simgrid::s4u::Engine::get_instance(); + auto netpoint = engine->host_by_name(hostlink->id)->get_netpoint(); xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str()); - const simgrid::s4u::Link* linkUp = simgrid::s4u::Link::by_name_or_null(hostlink->link_up); - const simgrid::s4u::Link* linkDown = simgrid::s4u::Link::by_name_or_null(hostlink->link_down); + const auto linkUp = engine->link_by_name_or_null(hostlink->link_up); + const auto linkDown = engine->link_by_name_or_null(hostlink->link_down); xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str()); xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str()); 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); } diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 62947af7a7..1ebfbd1c51 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -481,19 +481,20 @@ void ETag_surfxml_link(){ void STag_surfxml_link___ctn() { + const auto engine = simgrid::s4u::Engine::get_instance(); const simgrid::s4u::Link* link; simgrid::s4u::LinkInRoute::Direction direction = simgrid::s4u::LinkInRoute::Direction::NONE; switch (A_surfxml_link___ctn_direction) { case AU_surfxml_link___ctn_direction: case A_surfxml_link___ctn_direction_NONE: - link = simgrid::s4u::Link::by_name(std::string(A_surfxml_link___ctn_id)); + link = engine->link_by_name(std::string(A_surfxml_link___ctn_id)); break; case A_surfxml_link___ctn_direction_UP: - link = simgrid::s4u::SplitDuplexLink::by_name(std::string(A_surfxml_link___ctn_id)); + link = engine->split_duplex_link_by_name(std::string(A_surfxml_link___ctn_id)); direction = simgrid::s4u::LinkInRoute::Direction::UP; break; case A_surfxml_link___ctn_direction_DOWN: - link = simgrid::s4u::SplitDuplexLink::by_name(std::string(A_surfxml_link___ctn_id)); + link = engine->split_duplex_link_by_name(std::string(A_surfxml_link___ctn_id)); direction = simgrid::s4u::LinkInRoute::Direction::DOWN; break; default: diff --git a/teshsuite/mc/mutex-handling/mutex-handling.cpp b/teshsuite/mc/mutex-handling/mutex-handling.cpp index 243763b7f2..236c5f35b3 100644 --- a/teshsuite/mc/mutex-handling/mutex-handling.cpp +++ b/teshsuite/mc/mutex-handling/mutex-handling.cpp @@ -69,12 +69,12 @@ int main(int argc, char* argv[]) #endif e.load_platform(argv[1]); - simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name("Jupiter"), receiver, "box"); - simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("Boivin"), sender, "box", mutex, 1); - simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("Fafard"), sender, "box", mutex, 2); + simgrid::s4u::Actor::create("receiver", e.host_by_name("Jupiter"), receiver, "box"); + simgrid::s4u::Actor::create("sender", e.host_by_name("Boivin"), sender, "box", mutex, 1); + simgrid::s4u::Actor::create("sender", e.host_by_name("Fafard"), sender, "box", mutex, 2); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/mc/random-bug/random-bug.cpp b/teshsuite/mc/random-bug/random-bug.cpp index 2374cae907..a4b2c06418 100644 --- a/teshsuite/mc/random-bug/random-bug.cpp +++ b/teshsuite/mc/random-bug/random-bug.cpp @@ -64,6 +64,6 @@ int main(int argc, char* argv[]) e.load_platform(argv[2]); - simgrid::s4u::Actor::create("app", simgrid::s4u::Host::by_name("Fafard"), &app); + simgrid::s4u::Actor::create("app", e.host_by_name("Fafard"), &app); e.run(); } diff --git a/teshsuite/models/cloud-sharing/cloud-sharing.cpp b/teshsuite/models/cloud-sharing/cloud-sharing.cpp index 2b14c9dfc3..49784b71e6 100644 --- a/teshsuite/models/cloud-sharing/cloud-sharing.cpp +++ b/teshsuite/models/cloud-sharing/cloud-sharing.cpp @@ -588,7 +588,7 @@ int main(int argc, char* argv[]) platform = argv[1]; e.load_platform(platform); - simgrid::s4u::Host* pm0 = simgrid::s4u::Host::by_name("node-0.1core.org"); + simgrid::s4u::Host* pm0 = e.host_by_name("node-0.1core.org"); xbt_assert(pm0, "Host 'node-0.1core.org' not found"); simgrid::s4u::Actor::create("master", pm0, master_main); diff --git a/teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp b/teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp index 399fe99812..cb19cdf2d9 100644 --- a/teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp +++ b/teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp @@ -96,9 +96,9 @@ int main(int argc, char** argv) { sg4::Engine e(&argc, argv); /* keep it simple, no network factors nor crosstrafic */ - simgrid::s4u::Engine::set_config("network/model:CM02"); - simgrid::s4u::Engine::set_config("network/weight-S:20537"); - simgrid::s4u::Engine::set_config("network/crosstraffic:0"); + e.set_config("network/model:CM02"); + e.set_config("network/weight-S:20537"); + e.set_config("network/crosstraffic:0"); /* dog-bone platform */ std::unordered_map hosts; diff --git a/teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp b/teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp index 25e4b78b82..6901c46e24 100644 --- a/teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp +++ b/teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp @@ -23,9 +23,9 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to compute 1 flop on a 1 flop/s host."); XBT_INFO("Should be done in exactly one second."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init()->set_flops_amount(1)->set_host(hosts[0])->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: computing 1 flop at 1 flop/s takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -35,12 +35,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to compute 2 x 1 flop on a 1 flop/s host."); XBT_INFO("Should be done in exactly 2 seconds because of sharing."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::ExecPtr e1 = sg4::Exec::init()->set_flops_amount(1)->set_host(hosts[0])->start(); sg4::ExecPtr e2 = sg4::Exec::init()->set_flops_amount(1)->set_host(hosts[0])->start(); e1->wait(); e2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: computing 2x1 flop at 1 flop/s takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -50,12 +50,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to compute 2 flops across two hosts running at 1 flop/s."); XBT_INFO("Should be done in exactly one second."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init() ->set_flops_amounts(std::vector({1.0, 1.0})) ->set_hosts(std::vector({hosts[0], hosts[1]})) ->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: computing 2 flops on 2 hosts at 1 flop/s takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -65,12 +65,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to compute 2 flops across two hosts, one running at 1 flop/s and one at 2 flop/s."); XBT_INFO("Should be done in exactly one second."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init() ->set_flops_amounts(std::vector({1.0, 1.0})) ->set_hosts(std::vector({hosts[0], hosts[5]})) ->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: computing 2 flops on 2 heterogeneous hosts takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -80,9 +80,9 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0)->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte on a shared link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -92,9 +92,9 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0)->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte on a fatpipe link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -105,9 +105,9 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B from one host to another at 1Bps with a latency of 2 x 500ms + 1s."); XBT_INFO("Should be done in 3 seconds (2 x 500ms + 1s latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0)->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte on a 3-link route at 1Bps + 2,500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -119,9 +119,9 @@ static void main_dispatcher() XBT_INFO("Have to send 1B from one host to another on a link at 2Bps with a latency of 2 x 1024^2s."); XBT_INFO("This latency is half the default TCP window size (4MiB). This limits the bandwidth to 1B"); XBT_INFO("Should be done in 2 x 1024^2s + 1 seconds (large latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Comm::sendto_async(hosts[0], hosts[6], 1.0)->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte on a large latency link takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -131,12 +131,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 2.5 seconds (500ms latency + 2s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::CommPtr c1 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0); sg4::CommPtr c2 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 2x1 bytes on a shared link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -147,12 +147,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0); c2 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 2x1 bytes on a fatpipe link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -163,12 +163,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 2 x 1B from one host to another at 1Bps with a latency of 2 x 500ms + 1s."); XBT_INFO("Should be done in 4 seconds (2 x 500ms + 1s latency + 2s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0); c2 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 2x1 bytes on a 3-link route at 1Bps + 2,500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -179,12 +179,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 2.5 seconds (500ms latency + 2s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0); c2 = sg4::Comm::sendto_async(hosts[4], hosts[0], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte in both directions on a shared link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -195,12 +195,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 500ms."); XBT_INFO("Should be done in 1.5 seconds (500ms latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[5], 1.0); c2 = sg4::Comm::sendto_async(hosts[5], hosts[0], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte in both directions on a fatpipe link at 1Bps + 500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -211,12 +211,12 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("Have to send 1B between two hosts in each direction at 1Bps with a latency of 2 x 500ms + 1s."); XBT_INFO("Should be done in 4 seconds (2 x 500ms + 1s latency + 2s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[1], 1.0); c2 = sg4::Comm::sendto_async(hosts[1], hosts[0], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 1 byte in both directions on a 3-link route at 1Bps + 2,500ms takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -227,7 +227,7 @@ static void main_dispatcher() XBT_INFO("------------------------------------------------------------"); XBT_INFO("'cpu0' sends 1B to 'cpu1' and 'cpu2' sends 1B to 'cpu3'. The only shared link is the fatpipe switch."); XBT_INFO("Should be done in 3 seconds (2 x 500ms + 1s latency + 1s transfert)."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init() ->set_bytes_amounts(std::vector({0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, @@ -235,7 +235,7 @@ static void main_dispatcher() 0.0, 0.0, 0.0, 0.0 })) ->set_hosts(std::vector({hosts[0], hosts[1], hosts[2], hosts[3]})) ->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: sending 2 x 1 byte in a parallel communication without interference takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -250,7 +250,7 @@ static void main_dispatcher() XBT_INFO(" - For 2 seconds, two lows share a link to transfer 1 x 1B. 'cpu2' received is payload"); XBT_INFO(" - For 1 second, one flow has the full bandwidth to transfer 1B. 'cpu3' received is payload"); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init() ->set_bytes_amounts(std::vector({0.0, 1.0, 2.0, 3.0, 0.0, 0.0, 0.0, 0.0, @@ -258,7 +258,7 @@ static void main_dispatcher() 0.0, 0.0, 0.0, 0.0 })) ->set_hosts(std::vector({hosts[0], hosts[1], hosts[2], hosts[3]})) ->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: scattering an increasing number of bytes to 3 hosts takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -272,7 +272,7 @@ static void main_dispatcher() XBT_INFO("Each SHARED link is traversed by 6 flows (3 in and 3 out). "); XBT_INFO("Each 1B transfer thus takes 6 seconds on a 1Bps link"); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); sg4::Exec::init() ->set_bytes_amounts(std::vector({0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0, @@ -280,7 +280,7 @@ static void main_dispatcher() 1.0, 1.0, 1.0, 0.0 })) ->set_hosts(std::vector({hosts[0], hosts[1], hosts[2], hosts[3]})) ->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: 1-byte all-too-all in a parallel communication takes %.2f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -293,12 +293,12 @@ static void main_dispatcher() XBT_INFO("The small communication has a negligible impact on the large one."); XBT_INFO("This corresponds to paying latency once and having the full bandwidth for the large communication."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[7], 1e8); c2 = sg4::Comm::sendto_async(hosts[0], hosts[7], 1.0); c1->wait(); c2->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: 1 small and 1 large concurrent communications take %.4f seconds.", end_time - start_time); XBT_INFO("\n"); @@ -311,12 +311,12 @@ static void main_dispatcher() XBT_INFO("The two activities should overlap smoothly as they use different resources."); XBT_INFO("The completion time is thus the maximum of the time to complete the two activities."); - start_time = sg4::Engine::get_clock(); + start_time = e->get_clock(); c1 = sg4::Comm::sendto_async(hosts[0], hosts[4], 1.0); e1 = sg4::Exec::init()->set_flops_amount(2.0)->set_host(hosts[4])->start(); e1->wait(); c1->wait(); - end_time = sg4::Engine::get_clock(); + end_time = e->get_clock(); XBT_INFO("Actual result: Sending 1B while computing 2 flops takes %.4f seconds.", end_time - start_time); XBT_INFO("\n"); } @@ -325,7 +325,7 @@ int main(int argc, char** argv) { sg4::Engine engine(&argc, argv); engine.load_platform(argv[1]); - sg4::Actor::create("dispatcher", sg4::Host::by_name("cpu0"), main_dispatcher); + sg4::Actor::create("dispatcher", engine.host_by_name("cpu0"), main_dispatcher); engine.run(); return 0; diff --git a/teshsuite/models/wifi_usage/wifi_usage.cpp b/teshsuite/models/wifi_usage/wifi_usage.cpp index 619319f830..04f093ab97 100644 --- a/teshsuite/models/wifi_usage/wifi_usage.cpp +++ b/teshsuite/models/wifi_usage/wifi_usage.cpp @@ -49,11 +49,12 @@ static void main_dispatcher() } run_ping_test("Station 1", "Station 2", 1000); } + int main(int argc, char** argv) { simgrid::s4u::Engine engine(&argc, argv); engine.load_platform(argv[1]); - simgrid::s4u::Actor::create("dispatcher", simgrid::s4u::Host::by_name("node1"), main_dispatcher); + simgrid::s4u::Actor::create("dispatcher", engine.host_by_name("node1"), main_dispatcher); engine.run(); return 0; diff --git a/teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp b/teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp index 6525f735a1..8abfa03c1a 100644 --- a/teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp +++ b/teshsuite/models/wifi_usage_decay/wifi_usage_decay.cpp @@ -57,7 +57,7 @@ int main(int argc, char** argv) { simgrid::s4u::Engine engine(&argc, argv); engine.load_platform(argv[1]); - simgrid::s4u::Actor::create("dispatcher", simgrid::s4u::Host::by_name("node1"), main_dispatcher); + simgrid::s4u::Actor::create("dispatcher", engine.host_by_name("node1"), main_dispatcher); engine.run(); return 0; diff --git a/teshsuite/s4u/actor-autorestart/actor-autorestart.cpp b/teshsuite/s4u/actor-autorestart/actor-autorestart.cpp index 6a86b410b2..65a5464e92 100644 --- a/teshsuite/s4u/actor-autorestart/actor-autorestart.cpp +++ b/teshsuite/s4u/actor-autorestart/actor-autorestart.cpp @@ -56,10 +56,10 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("Autostart", simgrid::s4u::Host::by_name("Tremblay"), autostart); + simgrid::s4u::Actor::create("Autostart", e.host_by_name("Tremblay"), autostart); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/actor-suspend/actor-suspend.cpp b/teshsuite/s4u/actor-suspend/actor-suspend.cpp index 167313ef3b..657b2fcab1 100644 --- a/teshsuite/s4u/actor-suspend/actor-suspend.cpp +++ b/teshsuite/s4u/actor-suspend/actor-suspend.cpp @@ -53,7 +53,7 @@ int main(int argc, char** argv) simgrid::s4u::Engine engine(&argc, argv); engine.load_platform(argv[1]); - simgrid::s4u::Host* host = simgrid::s4u::Host::by_name("Tremblay"); + simgrid::s4u::Host* host = engine.host_by_name("Tremblay"); simgrid::s4u::Actor::create("Suspender", host, Suspender()); receiver = simgrid::s4u::Actor::create("Receiver", host, Receiver()); diff --git a/teshsuite/s4u/actor/actor.cpp b/teshsuite/s4u/actor/actor.cpp index eafecfe47f..0bbc75335b 100644 --- a/teshsuite/s4u/actor/actor.cpp +++ b/teshsuite/s4u/actor/actor.cpp @@ -56,11 +56,11 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker); + simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), master); + simgrid::s4u::Actor::create("worker", e.host_by_name("Tremblay"), worker); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/basic-link-test/basic-link-test.cpp b/teshsuite/s4u/basic-link-test/basic-link-test.cpp index 905017423f..e305da460e 100644 --- a/teshsuite/s4u/basic-link-test/basic-link-test.cpp +++ b/teshsuite/s4u/basic-link-test/basic-link-test.cpp @@ -19,7 +19,7 @@ int main(int argc, char** argv) /* creation of the environment */ e.load_platform(argv[1]); - std::vector links = simgrid::s4u::Engine::get_instance()->get_all_links(); + std::vector links = e.get_all_links(); XBT_INFO("Link count: %zu", links.size()); std::sort(links.begin(), links.end(), [](const simgrid::s4u::Link* a, const simgrid::s4u::Link* b) { diff --git a/teshsuite/s4u/basic-parsing-test/basic-parsing-test.cpp b/teshsuite/s4u/basic-parsing-test/basic-parsing-test.cpp index e7c59e6f6a..442faf39d5 100644 --- a/teshsuite/s4u/basic-parsing-test/basic-parsing-test.cpp +++ b/teshsuite/s4u/basic-parsing-test/basic-parsing-test.cpp @@ -72,7 +72,7 @@ int main(int argc, char** argv) if (strcmp(argv[2], "FULL_LINK") == 0) test_full_link(hosts); if (strcmp(argv[2], "PROP") == 0) - XBT_INFO("SG_TEST_mem: %s", sg4::Host::by_name("host1")->get_property("SG_TEST_mem")); + XBT_INFO("SG_TEST_mem: %s", e.host_by_name("host1")->get_property("SG_TEST_mem")); } return 0; diff --git a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp index 6b52c4e467..019b10059f 100644 --- a/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp +++ b/teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp @@ -61,11 +61,11 @@ int main(int argc, char* argv[]) /* load the platform file */ e.load_platform(argv[1]); - simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); + simgrid::s4u::Actor::create("master_", e.host_by_name("Fafard"), master_main); e.run(); - XBT_INFO("Bye (simulation time %g)", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Bye (simulation time %g)", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/cloud-two-execs/cloud-two-execs.cpp b/teshsuite/s4u/cloud-two-execs/cloud-two-execs.cpp index 495453ede1..2114719ae5 100644 --- a/teshsuite/s4u/cloud-two-execs/cloud-two-execs.cpp +++ b/teshsuite/s4u/cloud-two-execs/cloud-two-execs.cpp @@ -55,10 +55,10 @@ int main(int argc, char* argv[]) e.load_platform(argv[1]); - simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main); + simgrid::s4u::Actor::create("master_", e.host_by_name("Fafard"), master_main); e.run(); - XBT_INFO("Bye (simulation time %g)", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Bye (simulation time %g)", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp b/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp index 081b14aae6..a4b320c35e 100644 --- a/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp +++ b/teshsuite/s4u/comm-get-sender/comm-get-sender.cpp @@ -36,8 +36,8 @@ int main(int argc, char* argv[]) e.load_platform(argv[1]); - simgrid::s4u::Actor::create("send", simgrid::s4u::Host::by_name("Tremblay"), sender_fun); - simgrid::s4u::Actor::create("receive", simgrid::s4u::Host::by_name("Tremblay"), receiver_fun); + simgrid::s4u::Actor::create("send", e.host_by_name("Tremblay"), sender_fun); + simgrid::s4u::Actor::create("receive", e.host_by_name("Tremblay"), receiver_fun); e.run(); return 0; diff --git a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp index 6fbc60742a..5ccfa0cce2 100644 --- a/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp +++ b/teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp @@ -186,7 +186,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Actor::create("recver", hosts[1], receiver, argRecv); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp index 54aaf3aea2..d86661d713 100644 --- a/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp +++ b/teshsuite/s4u/concurrent_rw/concurrent_rw.cpp @@ -35,10 +35,10 @@ int main(int argc, char** argv) e.load_platform(argv[1]); for (int i = 0; i < 5; i++) - sg4::Actor::create("host", sg4::Host::by_name("bob"), host); + sg4::Actor::create("host", e.host_by_name("bob"), host); e.run(); - XBT_INFO("Simulation time %g", sg4::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/host-multicore-speed-file/host-multicore-speed-file.cpp b/teshsuite/s4u/host-multicore-speed-file/host-multicore-speed-file.cpp index 07ad10de57..468c98fac2 100644 --- a/teshsuite/s4u/host-multicore-speed-file/host-multicore-speed-file.cpp +++ b/teshsuite/s4u/host-multicore-speed-file/host-multicore-speed-file.cpp @@ -102,12 +102,12 @@ int main(int argc, char* argv[]) ->seal(); zone->seal(); - sg4::Actor::create("carol", simgrid::s4u::Host::by_name("carol"), worker); - sg4::Actor::create("erin", simgrid::s4u::Host::by_name("erin"), failed_worker)->set_auto_restart(true); + sg4::Actor::create("carol", e.host_by_name("carol"), worker); + sg4::Actor::create("erin", e.host_by_name("erin"), failed_worker)->set_auto_restart(true); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp b/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp index a94afdccfb..e5ad474739 100644 --- a/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp +++ b/teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp @@ -159,12 +159,11 @@ int main(int argc, char* argv[]) e.load_platform(argv[1]); - simgrid::s4u::Actor::create("test_launcher", simgrid::s4u::Host::by_name("Tremblay"), test_launcher, - std::stoi(argv[2])); + simgrid::s4u::Actor::create("test_launcher", e.host_by_name("Tremblay"), test_launcher, std::stoi(argv[2])); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/host-on-off-recv/host-on-off-recv.cpp b/teshsuite/s4u/host-on-off-recv/host-on-off-recv.cpp index 08641ef198..19de43d063 100644 --- a/teshsuite/s4u/host-on-off-recv/host-on-off-recv.cpp +++ b/teshsuite/s4u/host-on-off-recv/host-on-off-recv.cpp @@ -56,12 +56,12 @@ int main(int argc, char* argv[]) e.load_platform(argv[1]); - simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Jupiter"), worker); + simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), master); + simgrid::s4u::Actor::create("worker", e.host_by_name("Jupiter"), worker); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/host-on-off/host-on-off.cpp b/teshsuite/s4u/host-on-off/host-on-off.cpp index e4610d6848..860df769bc 100644 --- a/teshsuite/s4u/host-on-off/host-on-off.cpp +++ b/teshsuite/s4u/host-on-off/host-on-off.cpp @@ -94,12 +94,12 @@ int main(int argc, char* argv[]) e.load_platform(argv[1]); - simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Jupiter"), worker); + simgrid::s4u::Actor::create("master", e.host_by_name("Tremblay"), master); + simgrid::s4u::Actor::create("worker", e.host_by_name("Jupiter"), worker); e.run(); - XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulation time %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/listen_async/listen_async.cpp b/teshsuite/s4u/listen_async/listen_async.cpp index 3f83ca81b6..fd6effa37d 100644 --- a/teshsuite/s4u/listen_async/listen_async.cpp +++ b/teshsuite/s4u/listen_async/listen_async.cpp @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("test", simgrid::s4u::Host::by_name("Tremblay"), server); + simgrid::s4u::Actor::create("test", e.host_by_name("Tremblay"), server); e.run(); diff --git a/teshsuite/s4u/pid/pid.cpp b/teshsuite/s4u/pid/pid.cpp index 7c2c7c082e..053209fbb8 100644 --- a/teshsuite/s4u/pid/pid.cpp +++ b/teshsuite/s4u/pid/pid.cpp @@ -38,10 +38,10 @@ int main(int argc, char* argv[]) simgrid::s4u::Actor::kill_all(); - simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid); - simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid); - simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid); - simgrid::s4u::Actor::create("killall", simgrid::s4u::Host::by_name("Tremblay"), killall); + simgrid::s4u::Actor::create("sendpid", e.host_by_name("Tremblay"), sendpid); + simgrid::s4u::Actor::create("sendpid", e.host_by_name("Tremblay"), sendpid); + simgrid::s4u::Actor::create("sendpid", e.host_by_name("Tremblay"), sendpid); + simgrid::s4u::Actor::create("killall", e.host_by_name("Tremblay"), killall); e.run(); diff --git a/teshsuite/s4u/storage_client_server/storage_client_server.cpp b/teshsuite/s4u/storage_client_server/storage_client_server.cpp index 30eec58384..8c1f927bfc 100644 --- a/teshsuite/s4u/storage_client_server/storage_client_server.cpp +++ b/teshsuite/s4u/storage_client_server/storage_client_server.cpp @@ -149,11 +149,11 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform_file\n", argv[0]); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("server", simgrid::s4u::Host::by_name("alice"), server); - simgrid::s4u::Actor::create("client", simgrid::s4u::Host::by_name("bob"), client); + simgrid::s4u::Actor::create("server", e.host_by_name("alice"), server); + simgrid::s4u::Actor::create("client", e.host_by_name("bob"), client); e.run(); - XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock()); + XBT_INFO("Simulated time: %g", e.get_clock()); return 0; } diff --git a/teshsuite/s4u/vm-live-migration/vm-live-migration.cpp b/teshsuite/s4u/vm-live-migration/vm-live-migration.cpp index 33524187af..613852e779 100644 --- a/teshsuite/s4u/vm-live-migration/vm-live-migration.cpp +++ b/teshsuite/s4u/vm-live-migration/vm-live-migration.cpp @@ -28,7 +28,7 @@ static void task_executor() int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); - simgrid::s4u::Engine::set_config("network/model:CM02"); // Much less realistic, but easier to compute manually + e.set_config("network/model:CM02"); // Much less realistic, but easier to compute manually sg_vm_live_migration_plugin_init(); sg_host_energy_plugin_init(); @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) xbt_assert(argc == 2, "Usage: %s platform.xml\n", argv[0]); e.load_platform(argv[1]); - auto* pm = simgrid::s4u::Host::by_name("host1"); + auto* pm = e.host_by_name("host1"); auto* vm = new simgrid::s4u::VirtualMachine("VM0", pm, 1 /*nCores*/); vm->set_ramsize(1250000000)->start(); simgrid::s4u::Actor::create("executor", vm, task_executor); diff --git a/teshsuite/s4u/wait-all-for/wait-all-for.cpp b/teshsuite/s4u/wait-all-for/wait-all-for.cpp index f8ca85dc56..ee84b72ec2 100644 --- a/teshsuite/s4u/wait-all-for/wait-all-for.cpp +++ b/teshsuite/s4u/wait-all-for/wait-all-for.cpp @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker); + simgrid::s4u::Actor::create("worker", e.host_by_name("Tremblay"), worker); e.run(); return 0; } diff --git a/teshsuite/s4u/wait-any-for/wait-any-for.cpp b/teshsuite/s4u/wait-any-for/wait-any-for.cpp index 9438f45e04..b10b4ff421 100644 --- a/teshsuite/s4u/wait-any-for/wait-any-for.cpp +++ b/teshsuite/s4u/wait-any-for/wait-any-for.cpp @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) { simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker); + simgrid::s4u::Actor::create("worker", e.host_by_name("Tremblay"), worker); e.run(); return 0; } diff --git a/teshsuite/xbt/signals/signals.cpp b/teshsuite/xbt/signals/signals.cpp index 7effa0ebb3..9191d8a53e 100644 --- a/teshsuite/xbt/signals/signals.cpp +++ b/teshsuite/xbt/signals/signals.cpp @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) simgrid::s4u::Engine e(&argc, argv); e.load_platform(argv[1]); - simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker); + simgrid::s4u::Actor::create("worker", e.host_by_name("Tremblay"), worker); e.run();