/* 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 <simgrid/plugins/dvfs.h>
#include <simgrid/plugins/load.h>
/* 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 <simgrid/plugins/dvfs.h>
#include <simgrid/plugins/load.h>
#if HAVE_SMPI
#include "src/smpi/include/smpi_request.hpp"
#include "src/smpi/plugins/ampi/ampi.hpp"
#endif
#include <boost/algorithm/string.hpp>
#if HAVE_SMPI
#include "src/smpi/include/smpi_request.hpp"
#include "src/smpi/plugins/ampi/ampi.hpp"
#endif
#include <boost/algorithm/string.hpp>
{"performance", "TODO: Doc"}, {"powersave", "TODO: Doc"},
}),
{"performance", "TODO: Doc"}, {"powersave", "TODO: Doc"},
}),
cfg_min_pstate("plugin/dvfs/min-pstate",
"Which pstate is the minimum (and hence fastest) pstate for this governor?", 0);
cfg_min_pstate("plugin/dvfs/min-pstate",
"Which pstate is the minimum (and hence fastest) pstate for this governor?", 0);
static simgrid::config::Flag<int>
cfg_max_pstate("plugin/dvfs/max-pstate",
static simgrid::config::Flag<int>
cfg_max_pstate("plugin/dvfs/max-pstate",
- This plugin makes it very simple for users to obtain the current load for each host.
-
-*/
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_plugin_dvfs, surf, "Logging specific to the SURF HostDvfs plugin");
-
-namespace simgrid {
-namespace plugin {
-
-namespace dvfs {
+namespace simgrid::plugin::dvfs {
max_pstate = std::stoul(local_max_pstate_config);
}
xbt_assert(max_pstate <= host_->get_pstate_count() - 1, "Value for max_pstate too large!");
max_pstate = std::stoul(local_max_pstate_config);
}
xbt_assert(max_pstate <= host_->get_pstate_count() - 1, "Value for max_pstate too large!");
// For more than one host (not yet supported), we can access the host via
// simcalls_.front()->issuer->get_iface()->get_host()
// For more than one host (not yet supported), we can access the host via
// 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();
+ if (exec.get_host() == get_host() && iteration_running) {
+ comp_timer += exec.get_finish_time() - exec.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
}
});
// 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](const kernel::resource::NetworkAction& act) {
- if ((get_host() == &act.get_src() || get_host() == &act.get_dst()) && iteration_running) {
+ simgrid::s4u::Comm::on_start_cb([this](const s4u::Comm& comm) {
+ if ((get_host() == comm.get_sender()->get_host() || get_host() == comm.get_receiver()->get_host()) &&
+ iteration_running) {
/* **************************** events callback *************************** */
static void on_host_added(simgrid::s4u::Host& host)
/* **************************** events callback *************************** */
static void on_host_added(simgrid::s4u::Host& host)
simgrid::s4u::ActorPtr daemon = simgrid::s4u::Actor::create(name.c_str(), &host, []() {
/**
* This lambda function is the function the actor (daemon) will execute
simgrid::s4u::ActorPtr daemon = simgrid::s4u::Actor::create(name.c_str(), &host, []() {
/**
* This lambda function is the function the actor (daemon) will execute
XBT_DEBUG("DVFS process on %s is a daemon: %d", daemon_proc->get_host()->get_cname(), daemon_proc->is_daemon());
std::string dvfs_governor;
XBT_DEBUG("DVFS process on %s is a daemon: %d", daemon_proc->get_host()->get_cname(), daemon_proc->is_daemon());
std::string dvfs_governor;
- const char* host_conf = daemon_proc->get_host()->get_property("plugin/dvfs/governor");
- if (host_conf != nullptr) {
- dvfs_governor = std::string(host_conf);
+ if (const char* host_conf = daemon_proc->get_host()->get_property("plugin/dvfs/governor")) {
+ dvfs_governor = host_conf;