Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case some methods in s4u::Host
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 18 May 2018 22:03:48 +0000 (00:03 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 18 May 2018 22:21:31 +0000 (00:21 +0200)
21 files changed:
examples/s4u/energy-boot/s4u-energy-boot.cpp
examples/s4u/energy-exec/s4u-energy-exec.cpp
examples/s4u/platform-properties/s4u-platform-properties.cpp
examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp
include/simgrid/s4u/Host.hpp
src/bindings/lua/lua_platf.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/SleepImpl.cpp
src/kernel/routing/NetZoneImpl.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/VmLiveMigration.cpp
src/s4u/s4u_Host.cpp
src/simix/ActorImpl.cpp
src/simix/smx_host.cpp
src/simix/smx_io.cpp
src/simix/smx_network.cpp
src/smpi/internals/smpi_host.cpp
src/surf/plugins/host_dvfs.cpp
src/surf/plugins/host_energy.cpp
teshsuite/s4u/actor/actor.cpp
teshsuite/s4u/host_on_off_wait/host_on_off_wait.cpp

index 9d5aac8..d631c00 100644 (file)
@@ -43,7 +43,7 @@ static void simulate_bootup(simgrid::s4u::Host* host)
   host->setPstate(3);
 
   XBT_INFO("Actually start the host");
-  host->turnOn();
+  host->turn_on();
 
   XBT_INFO("Wait 150s to simulate the boot time.");
   simgrid::s4u::this_actor::sleep_for(150);
@@ -66,7 +66,7 @@ static void simulate_shutdown(simgrid::s4u::Host* host)
   host->setPstate(previous_pstate);
 
   XBT_INFO("Actually shutdown the host");
-  host->turnOff();
+  host->turn_off();
 }
 
 static int monitor()
index b1893e1..846bc6d 100644 (file)
@@ -13,7 +13,7 @@ static void dvfs()
   simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
   simgrid::s4u::Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
 
-  XBT_INFO("Energetic profile: %s", host1->getProperty("watt_per_state"));
+  XBT_INFO("Energetic profile: %s", host1->get_property("watt_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", host1->getSpeed(),
            sg_host_get_consumed_energy(host1));
 
@@ -56,7 +56,7 @@ static void dvfs()
   // =========== Turn the other host off ==========
   XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
            sg_host_get_consumed_energy(host2));
-  host2->turnOff();
+  host2->turn_off();
   start = simgrid::s4u::Engine::get_clock();
   simgrid::s4u::this_actor::sleep_for(10);
   XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
index fafbfa7..e616163 100644 (file)
@@ -23,26 +23,26 @@ static void test_host(std::string hostname)
     XBT_INFO("  Host property: '%s' -> '%s'", kv.first.c_str(), kv.second.c_str());
 
   XBT_INFO("== Try to get a host property that does not exist");
-  value = thehost->getProperty(noexist);
+  value = thehost->get_property(noexist);
   xbt_assert(not value, "The key exists (it's not supposed to)");
 
   XBT_INFO("== Try to get a host property that does exist");
-  value = thehost->getProperty(exist);
+  value = thehost->get_property(exist);
   xbt_assert(value, "\tProperty %s is undefined (where it should)", exist);
   xbt_assert(!strcmp(value, "180"), "\tValue of property %s is defined to %s (where it should be 180)", exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   XBT_INFO("== Trying to modify a host property");
-  thehost->setProperty(exist, "250");
+  thehost->set_property(exist, "250");
 
   /* Test if we have changed the value */
-  value = thehost->getProperty(exist);
+  value = thehost->get_property(exist);
   xbt_assert(value, "Property %s is undefined (where it should)", exist);
   xbt_assert(!strcmp(value, "250"), "Value of property %s is defined to %s (where it should be 250)", exist, value);
   XBT_INFO("   Property: %s old value: %s", exist, value);
 
   /* Restore the value for the next test */
-  thehost->setProperty(exist, "180");
+  thehost->set_property(exist, "180");
 }
 
 static int alice(int argc, char* argv[])
index ee43098..c185785 100644 (file)
@@ -65,7 +65,7 @@ static void execute_load_test()
   s4u_Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
   XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 computed %.0f flops so far and has an average load of %.5f.",
            sg_host_get_computed_flops(host2), sg_host_get_avg_load(host2));
-  host2->turnOff();
+  host2->turn_off();
   start = simgrid::s4u::Engine::get_clock();
   simgrid::s4u::this_actor::sleep_for(10);
   XBT_INFO("Done sleeping %.2f s; peak speed: %.0E flop/s; number of flops computed so far: %.0E",
index 4ce6a6a..15972ce 100644 (file)
@@ -80,29 +80,30 @@ public:
   /** Retrieves the name of that host as a C string */
   const char* get_cname() const { return name_.c_str(); }
 
-  void actorList(std::vector<ActorPtr> * whereto);
+  int get_actor_count();
+  std::vector<ActorPtr> get_all_actors();
 
   /** Turns that host on if it was previously off
    *
    * All actors on that host which were marked autorestart will be restarted automatically.
    * This call does nothing if the host is already on.
    */
-  void turnOn();
+  void turn_on();
   /** Turns that host off. All actors are forcefully stopped. */
-  void turnOff();
+  void turn_off();
   /** Returns if that host is currently up and running */
-  bool isOn();
+  bool is_on();
   /** Returns if that host is currently down and offline */
-  bool isOff() { return not isOn(); }
+  bool is_off() { return not is_on(); }
+
+  const char* get_property(const char* key);
+  void set_property(std::string key, std::string value);
+  std::map<std::string, std::string>* getProperties();
 
   double getSpeed();
   double get_available_speed();
   int getCoreCount();
-  std::map<std::string, std::string>* getProperties();
-  const char* getProperty(const char* key);
-  void setProperty(std::string key, std::string value);
-  void getProcesses(std::vector<ActorPtr> * list);
-  int get_actor_count();
+
   double getPstateSpeed(int pstate_index);
   int getPstatesCount() const;
   void setPstate(int pstate_index);
@@ -142,6 +143,21 @@ public:
     return name_;
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_cname()") const char* getCname() const { return name_.c_str(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void actorList(std::vector<ActorPtr>* whereto);
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void getProcesses(std::vector<ActorPtr>* list);
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_on()") void turnOn() { turn_on(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_off()") void turnOff() { turn_off(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_on()") bool isOn() { return is_on(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_off()") bool isOff() { return is_off(); }
+
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_property()") const char* getProperty(const char* key)
+  {
+    return get_property(key);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_property()") void setProperty(std::string key, std::string value)
+  {
+    set_property(key, value);
+  }
 
 private:
   simgrid::xbt::string name_{"noname"};
index 9279bdb..087381a 100644 (file)
@@ -517,7 +517,7 @@ int console_host_set_property(lua_State *L) {
 
   sg_host_t host = sg_host_by_name(name);
   lua_ensure(host, "no host '%s' found",name);
-  host->setProperty(prop_id, prop_value);
+  host->set_property(prop_id, prop_value);
 
   return 0;
 }
index a0e3cc2..ebfa43b 100644 (file)
@@ -93,10 +93,10 @@ void simgrid::kernel::activity::ExecImpl::set_priority(double priority)
 
 void simgrid::kernel::activity::ExecImpl::post()
 {
-  if (host_ && host_->isOff()) { /* FIXME: handle resource failure for parallel tasks too */
-                                 /* If the host running the synchro failed, notice it. This way, the asking
-                                  * process can be killed if it runs on that host itself */
-                                 state_ = SIMIX_FAILED;
+  if (host_ && host_->is_off()) { /* FIXME: handle resource failure for parallel tasks too */
+    /* If the host running the synchro failed, notice it. This way, the asking
+     * process can be killed if it runs on that host itself */
+    state_ = SIMIX_FAILED;
   } else if (surf_action_ && surf_action_->get_state() == simgrid::kernel::resource::Action::State::FAILED) {
     /* If the host running the synchro didn't fail, then the synchro was canceled */
     state_ = SIMIX_CANCELED;
index 9fa1841..aea4da1 100644 (file)
@@ -46,7 +46,7 @@ void simgrid::kernel::activity::SleepImpl::post()
         THROW_IMPOSSIBLE;
         break;
     }
-    if (simcall->issuer->host->isOff()) {
+    if (simcall->issuer->host->is_off()) {
       simcall->issuer->context->iwannadie = 1;
     }
     simcall_process_sleep__set__result(simcall, result);
index bbcec30..f70889a 100644 (file)
@@ -57,7 +57,7 @@ simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector<doubl
 
   if (props != nullptr)
     for (auto const& kv : *props)
-      res->setProperty(kv.first, kv.second);
+      res->set_property(kv.first, kv.second);
 
   simgrid::s4u::Host::on_creation(*res); // notify the signal
 
index 326fde5..350e3f4 100644 (file)
@@ -46,7 +46,7 @@ const double virt_overhead = 1; // 0.95
 
 static void hostStateChange(s4u::Host& host)
 {
-  if (host.isOff()) { // just turned off.
+  if (host.is_off()) { // just turned off.
     std::vector<s4u::VirtualMachine*> trash;
     /* Find all VMs living on that host */
     for (s4u::VirtualMachine* const& vm : VirtualMachineImpl::allVms_)
index 55a01a9..c6b7760 100644 (file)
@@ -333,10 +333,10 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
 {
   simgrid::s4u::Host* src_pm = vm->getPm();
 
-  if (src_pm->isOff())
+  if (src_pm->is_off())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(),
            src_pm->get_cname());
-  if (dst_pm->isOff())
+  if (dst_pm->is_off())
     THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname());
   if (vm->getState() != SURF_VM_STATE_RUNNING)
     THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname());
index 9aa141c..1fbbf94 100644 (file)
@@ -89,9 +89,9 @@ Host* Host::current()
   return smx_proc->host;
 }
 
-void Host::turnOn()
+void Host::turn_on()
 {
-  if (isOff()) {
+  if (is_off()) {
     simgrid::simix::simcall([this] {
       this->extension<simgrid::simix::Host>()->turnOn();
       this->pimpl_cpu->turn_on();
@@ -101,9 +101,9 @@ void Host::turnOn()
 }
 
 /** @brief Stop the host if it is on */
-void Host::turnOff()
+void Host::turn_off()
 {
-  if (isOn()) {
+  if (is_on()) {
     smx_actor_t self = SIMIX_process_self();
     simgrid::simix::simcall([this, self] {
       simgrid::simix::Host* host = this->extension<simgrid::simix::Host>();
@@ -126,7 +126,7 @@ void Host::turnOff()
   }
 }
 
-bool Host::isOn()
+bool Host::is_on()
 {
   return this->pimpl_cpu->is_on();
 }
@@ -137,10 +137,33 @@ int Host::getPstatesCount() const
 }
 
 /**
- * \brief Return the list of actors attached to an host.
+ * \brief Return a copy of the list of actors that are executing on this host.
  *
- * \param whereto a vector in which we should push actors living on that host
+ * Daemons and regular actors are all mixed in this list.
  */
+std::vector<ActorPtr> Host::get_all_actors()
+{
+  std::vector<ActorPtr> res;
+  for (auto& actor : this->extension<simgrid::simix::Host>()->process_list)
+    res.push_back(actor.ciface());
+  return res;
+}
+
+/** @brief Returns how many actors (daemonized or not) have been launched on this host */
+int Host::get_actor_count()
+{
+  return this->extension<simgrid::simix::Host>()->process_list.size();
+}
+
+/** @deprecated */
+void Host::getProcesses(std::vector<ActorPtr>* list)
+{
+  for (auto& actor : this->extension<simgrid::simix::Host>()->process_list) {
+    list->push_back(actor.iface());
+  }
+}
+
+/** @deprecated */
 void Host::actorList(std::vector<ActorPtr>* whereto)
 {
   for (auto& actor : this->extension<simgrid::simix::Host>()->process_list) {
@@ -187,30 +210,16 @@ std::map<std::string, std::string>* Host::getProperties()
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char* Host::getProperty(const char* key)
+const char* Host::get_property(const char* key)
 {
   return this->pimpl_->getProperty(key);
 }
 
-void Host::setProperty(std::string key, std::string value)
+void Host::set_property(std::string key, std::string value)
 {
   simgrid::simix::simcall([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
-/** Get the processes attached to the host */
-void Host::getProcesses(std::vector<ActorPtr>* list)
-{
-  for (auto& actor : this->extension<simgrid::simix::Host>()->process_list) {
-    list->push_back(actor.iface());
-  }
-}
-
-/** @brief Returns how many actors (daemonized or not) have been launched on this host */
-int Host::get_actor_count()
-{
-  return this->extension<simgrid::simix::Host>()->process_list.size();
-}
-
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
 double Host::getPstateSpeed(int pstate_index)
 {
@@ -466,7 +475,7 @@ void sg_host_set_pstate(sg_host_t host, int pstate)
  */
 void sg_host_turn_on(sg_host_t host)
 {
-  host->turnOn();
+  host->turn_on();
 }
 
 /** \ingroup m_host_management
@@ -478,7 +487,7 @@ void sg_host_turn_on(sg_host_t host)
  */
 void sg_host_turn_off(sg_host_t host)
 {
-  host->turnOff();
+  host->turn_off();
 }
 
 /** @ingroup m_host_management
@@ -492,7 +501,7 @@ void sg_host_turn_off(sg_host_t host)
  */
 int sg_host_is_on(sg_host_t host)
 {
-  return host->isOn();
+  return host->is_on();
 }
 
 /** @ingroup m_host_management
@@ -503,7 +512,7 @@ int sg_host_is_on(sg_host_t host)
  */
 int sg_host_is_off(sg_host_t host)
 {
-  return host->isOff();
+  return host->is_off();
 }
 
 /** @brief Get the properties of an host */
@@ -528,12 +537,12 @@ xbt_dict_t sg_host_get_properties(sg_host_t host)
 */
 const char* sg_host_get_property_value(sg_host_t host, const char* name)
 {
-  return host->getProperty(name);
+  return host->get_property(name);
 }
 
 void sg_host_set_property_value(sg_host_t host, const char* name, const char* value)
 {
-  host->setProperty(name, value);
+  host->set_property(name, value);
 }
 
 /**
index 9319634..ec224ed 100644 (file)
@@ -236,7 +236,7 @@ void ActorImpl::resume()
 
 smx_activity_t ActorImpl::sleep(double duration)
 {
-  if (host->isOff())
+  if (host->is_off())
     THROWF(host_error, 0, "Host %s failed, you cannot sleep there.", host->get_cname());
 
   simgrid::kernel::activity::SleepImpl* synchro = new simgrid::kernel::activity::SleepImpl();
@@ -294,7 +294,7 @@ smx_actor_t SIMIX_process_create(const char* name, std::function<void()> code, v
 
   XBT_DEBUG("Start process %s on host '%s'", name, host->get_cname());
 
-  if (host->isOff()) {
+  if (host->is_off()) {
     XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, host->get_cname());
     return nullptr;
   }
@@ -354,7 +354,7 @@ smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostn
   sg_host_t host = sg_host_by_name(hostname);
   XBT_DEBUG("Attach process %s on host '%s'", name, hostname);
 
-  if (host->isOff()) {
+  if (host->is_off()) {
     XBT_WARN("Cannot launch process '%s' on failed host '%s'", name, hostname);
     return nullptr;
   }
@@ -711,7 +711,7 @@ void SIMIX_process_yield(smx_actor_t self)
     /* execute the on_exit functions */
     SIMIX_process_on_exit_runall(self);
     /* Add the process to the list of process to restart, only if the host is down */
-    if (self->auto_restart && self->host->isOff()) {
+    if (self->auto_restart && self->host->is_off()) {
       SIMIX_host_add_auto_restart_process(self->host, self->get_cname(), self->code, self->getUserData(),
                                           SIMIX_timer_get_date(self->kill_timer), self->getProperties(),
                                           self->auto_restart);
index 0ff9a9e..3a22697 100644 (file)
@@ -86,7 +86,7 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host, const char* name, std::
       new simgrid::kernel::actor::ProcessArg(name, code, data, host, kill_time, nullptr, auto_restart);
   arg->properties.reset(properties, [](decltype(properties)) {});
 
-  if (host->isOff() && watched_hosts.find(host->get_cname()) == watched_hosts.end()) {
+  if (host->is_off() && watched_hosts.find(host->get_cname()) == watched_hosts.end()) {
     watched_hosts.insert(host->get_cname());
     XBT_DEBUG("Push host %s to watched_hosts because state == SURF_RESOURCE_OFF", host->get_cname());
   }
@@ -232,7 +232,7 @@ void SIMIX_execution_finish(smx_activity_t synchro)
         xbt_die("Internal error in SIMIX_execution_finish: unexpected synchro state %d", (int)exec->state_);
     }
     /* Fail the process if the host is down */
-    if (simcall->issuer->host->isOff())
+    if (simcall->issuer->host->is_off())
       simcall->issuer->context->iwannadie = 1;
 
     simcall->issuer->waiting_synchro = nullptr;
index bdc9166..9e6591f 100644 (file)
@@ -80,7 +80,7 @@ void SIMIX_io_finish(smx_activity_t synchro)
         xbt_die("Internal error in SIMIX_io_finish: unexpected synchro state %d", static_cast<int>(synchro->state_));
     }
 
-    if (simcall->issuer->host->isOff()) {
+    if (simcall->issuer->host->is_off()) {
       simcall->issuer->context->iwannadie = 1;
     }
 
index 6a599e8..c95d8b3 100644 (file)
@@ -528,7 +528,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
 
     /* Check out for errors */
 
-    if (simcall->issuer->host->isOff()) {
+    if (simcall->issuer->host->is_off()) {
       simcall->issuer->context->iwannadie = 1;
       SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
     } else {
@@ -616,7 +616,7 @@ void SIMIX_comm_finish(smx_activity_t synchro)
       }
     }
 
-    if (simcall->issuer->host->isOff()) {
+    if (simcall->issuer->host->is_off()) {
       simcall->issuer->context->iwannadie = 1;
     }
 
index d8575d2..95c7284 100644 (file)
@@ -93,21 +93,21 @@ Host::Host(simgrid::s4u::Host *ptr) : host(ptr)
   if (not Host::EXTENSION_ID.valid())
     Host::EXTENSION_ID = simgrid::s4u::Host::extension_create<Host>();
 
-  const char* orecv_string = host->getProperty("smpi/or");
+  const char* orecv_string = host->get_property("smpi/or");
   if (orecv_string != nullptr) {
     orecv_parsed_values = parse_factor(orecv_string);
   } else {
     orecv_parsed_values = parse_factor(simgrid::config::get_value<std::string>("smpi/or"));
   }
 
-  const char* osend_string = host->getProperty("smpi/os");
+  const char* osend_string = host->get_property("smpi/os");
   if (osend_string != nullptr) {
     osend_parsed_values = parse_factor(osend_string);
   } else {
     osend_parsed_values = parse_factor(simgrid::config::get_value<std::string>("smpi/os"));
   }
 
-  const char* oisend_string = host->getProperty("smpi/ois");
+  const char* oisend_string = host->get_property("smpi/ois");
   if (oisend_string != nullptr) {
     oisend_parsed_values = parse_factor(oisend_string);
   } else {
index e5ea579..af8ccc4 100644 (file)
@@ -41,7 +41,7 @@ public:
 
   void init()
   {
-    const char* local_sampling_rate_config = host_->getProperty(property_sampling_rate);
+    const char* local_sampling_rate_config = host_->get_property(property_sampling_rate);
     double global_sampling_rate_config     = simgrid::config::get_value<double>(property_sampling_rate);
     if (local_sampling_rate_config != nullptr) {
       sampling_rate = std::stod(local_sampling_rate_config);
@@ -240,9 +240,9 @@ static void on_host_added(simgrid::s4u::Host& host)
     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()->getProperty(property_governor);
+    const char* host_conf = daemon_proc->get_host()->get_property(property_governor);
     if (host_conf != nullptr) {
-      dvfs_governor = std::string(daemon_proc->get_host()->getProperty(property_governor));
+      dvfs_governor = std::string(daemon_proc->get_host()->get_property(property_governor));
       boost::algorithm::to_lower(dvfs_governor);
     } else {
       dvfs_governor = simgrid::config::get_value<std::string>(property_governor);
index 3f76a5b..82fe90d 100644 (file)
@@ -176,14 +176,14 @@ void HostEnergy::update()
   }
 
   /* Save data for the upcoming time interval: whether it's on/off and the pstate if it's on */
-  this->pstate = host->isOn() ? host->getPstate() : pstate_off;
+  this->pstate = host->is_on() ? host->getPstate() : pstate_off;
 }
 
 HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host(ptr), last_updated(surf_get_clock())
 {
   initWattsRangeList();
 
-  const char* off_power_str = host->getProperty("watt_off");
+  const char* off_power_str = host->get_property("watt_off");
   if (off_power_str != nullptr) {
     try {
       this->watts_off = std::stod(std::string(off_power_str));
@@ -314,7 +314,7 @@ double HostEnergy::getConsumedEnergy()
 
 void HostEnergy::initWattsRangeList()
 {
-  const char* all_power_values_str = host->getProperty("watt_per_state");
+  const char* all_power_values_str = host->get_property("watt_per_state");
   if (all_power_values_str == nullptr)
     return;
 
index 2401959..9003103 100644 (file)
@@ -22,10 +22,9 @@ static void worker()
 static void master()
 {
   simgrid::s4u::this_actor::sleep_for(1);
-  std::vector<simgrid::s4u::ActorPtr>* actor_list = new std::vector<simgrid::s4u::ActorPtr>();
-  simgrid::s4u::this_actor::get_host()->actorList(actor_list);
+  std::vector<simgrid::s4u::ActorPtr> actor_list = simgrid::s4u::this_actor::get_host()->get_all_actors();
 
-  for (auto const& actor : *actor_list) {
+  for (auto const& actor : actor_list) {
     XBT_INFO("Actor (pid=%ld, ppid=%ld, name=%s)", actor->get_pid(), actor->get_ppid(), actor->get_cname());
     if (simgrid::s4u::this_actor::get_pid() != actor->get_pid())
       actor->kill();
@@ -48,7 +47,6 @@ static void master()
   simgrid::s4u::this_actor::sleep_for(2);
   actor->kill();
 
-  delete actor_list;
   XBT_INFO("Goodbye now!");
 }
 
index 007b894..280536e 100644 (file)
@@ -14,7 +14,7 @@ static void master()
   simgrid::s4u::this_actor::sleep_for(1);
 
   XBT_INFO("Turning off the worker host");
-  jupiter->turnOff();
+  jupiter->turn_off();
   XBT_INFO("Master has finished");
 }