X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c6bbeb1829c36ff45b43ab25f9d8d3f53f554d98..db5adf7439201fb67d1d697b86806d58ace9fe85:/src/plugins/host_dvfs.cpp diff --git a/src/plugins/host_dvfs.cpp b/src/plugins/host_dvfs.cpp index f477c5f3c5..82c38aa728 100644 --- a/src/plugins/host_dvfs.cpp +++ b/src/plugins/host_dvfs.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -297,19 +297,18 @@ public: }); simgrid::s4u::Exec::on_completion.connect([this](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) { // For more than one host (not yet supported), we can access the host via - // simcalls_.front()->issuer->iface()->get_host() + // simcalls_.front()->issuer->get_iface()->get_host() if (activity.get_host() == get_host() && iteration_running) { comp_timer += activity.get_finish_time() - activity.get_start_time(); } }); // FIXME I think that this fires at the same time for all hosts, so when the src sends something, // the dst will be notified even though it didn't even arrive at the recv yet - simgrid::s4u::Link::on_communicate.connect( - [this](kernel::resource::NetworkAction const&, s4u::Host* src, s4u::Host* dst) { - if ((get_host() == src || get_host() == dst) && iteration_running) { - post_task(); - } - }); + simgrid::s4u::Link::on_communicate.connect([this](const kernel::resource::NetworkAction& act) { + if ((get_host() == &act.get_src() || get_host() == &act.get_dst()) && iteration_running) { + post_task(); + } + }); } std::string get_name() const override { return "Adagio"; } @@ -387,35 +386,29 @@ static void on_host_added(simgrid::s4u::Host& host) boost::algorithm::to_lower(dvfs_governor); } - auto governor = [&dvfs_governor, &daemon_proc]() { + auto governor = [&dvfs_governor, &daemon_proc]() -> std::unique_ptr { if (dvfs_governor == "conservative") { - return std::unique_ptr( - new simgrid::plugin::dvfs::Conservative(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } else if (dvfs_governor == "ondemand") { - return std::unique_ptr( - new simgrid::plugin::dvfs::OnDemand(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } #if HAVE_SMPI else if (dvfs_governor == "adagio") { - return std::unique_ptr( - new simgrid::plugin::dvfs::Adagio(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } #endif else if (dvfs_governor == "performance") { - return std::unique_ptr( - new simgrid::plugin::dvfs::Performance(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } else if (dvfs_governor == "powersave") { - return std::unique_ptr( - new simgrid::plugin::dvfs::Powersave(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } else { XBT_CRITICAL("No governor specified for host %s, falling back to Performance", daemon_proc->get_host()->get_cname()); - return std::unique_ptr( - new simgrid::plugin::dvfs::Performance(daemon_proc->get_host())); + return std::make_unique(daemon_proc->get_host()); } }(); - while (1) { + while (true) { // Sleep *before* updating; important for startup (i.e., t = 0). // In the beginning, we want to go with the pstates specified in the platform file // (so we sleep first)