- // host.extension_set(new HostDvfs(&host));
- // This call must be placed in this function. Otherweise, the daemonize() call comes too late and
- // SMPI will take this process as an MPI process!
- MSG_process_daemonize(MSG_process_create("daemon", check, NULL, &host));
-}
+ std::string name = std::string("dvfs-daemon-") + host.getCname();
+ simgrid::s4u::ActorPtr daemon = simgrid::s4u::Actor::createActor(name.c_str(), &host, []() {
+ /**
+ * This lambda function is the function the actor (daemon) will execute
+ * all the time - in the case of the dvfs plugin, this controls when to
+ * lower/raise the frequency.
+ */
+ simgrid::s4u::ActorPtr daemonProc = simgrid::s4u::Actor::self();
+
+ XBT_DEBUG("DVFS process on %s is a daemon: %d", daemonProc->getHost()->getName().c_str(), daemonProc->isDaemon());
+
+ std::string dvfs_governor;
+ const char* host_conf = daemonProc->getHost()->getProperty("plugin/dvfs/governor");
+ if (host_conf != nullptr) {
+ dvfs_governor = std::string(daemonProc->getHost()->getProperty("plugin/dvfs/governor"));
+ boost::algorithm::to_lower(dvfs_governor);
+ } else {
+ dvfs_governor = xbt_cfg_get_string("plugin/dvfs/governor");
+ boost::algorithm::to_lower(dvfs_governor);
+ }