From e1730083c35441eaf907fc0a9287ae1d461b4f08 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 8 Mar 2021 19:44:32 +0100 Subject: [PATCH] trigger Host::on_creation a bit earlier --- src/surf/sg_platf.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 8ffe7dbf18..68165ebdc5 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -80,12 +80,15 @@ void sg_platf_new_host(const simgrid::kernel::routing::HostCreationArgs* args) host->set_state_profile(args->state_trace); if (args->speed_trace) host->set_speed_profile(args->speed_trace); - if (args->pstate != 0) - host->set_pstate(args->pstate); if (not args->coord.empty()) new simgrid::kernel::routing::vivaldi::Coords(host->get_netpoint(), args->coord); simgrid::s4u::Host::on_creation(*host); // notify the signal + + /* When energy plugin is activated, changing the pstate requires to already have the HostEnergy extension whose + * allocation is triggered by the on_creation signal. Then set_pstate must be called after the signal emition */ + if (args->pstate != 0) + host->set_pstate(args->pstate); } /** @brief Add a "router" to the network element list */ -- 2.20.1