-/* 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. */
});
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"; }
boost::algorithm::to_lower(dvfs_governor);
}
- auto governor = [&dvfs_governor, &daemon_proc]() {
+ auto governor = [&dvfs_governor, &daemon_proc]() -> std::unique_ptr<simgrid::plugin::dvfs::Governor> {
if (dvfs_governor == "conservative") {
- return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::Conservative(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::Conservative>(daemon_proc->get_host());
} else if (dvfs_governor == "ondemand") {
- return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::OnDemand(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::OnDemand>(daemon_proc->get_host());
}
#if HAVE_SMPI
else if (dvfs_governor == "adagio") {
- return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::Adagio(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::Adagio>(daemon_proc->get_host());
}
#endif
else if (dvfs_governor == "performance") {
- return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::Performance(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::Performance>(daemon_proc->get_host());
} else if (dvfs_governor == "powersave") {
- return std::unique_ptr<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::Powersave(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::Powersave>(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<simgrid::plugin::dvfs::Governor>(
- new simgrid::plugin::dvfs::Performance(daemon_proc->get_host()));
+ return std::make_unique<simgrid::plugin::dvfs::Performance>(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)