Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
replace SIMIX_process_auto_restart_set() with ActorImpl::set_auto_restart()
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 30 Jun 2018 16:26:05 +0000 (18:26 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 30 Jun 2018 16:26:05 +0000 (18:26 +0200)
src/s4u/s4u_Actor.cpp
src/simix/ActorImpl.cpp
src/simix/ActorImpl.hpp
src/surf/sg_platf.cpp

index 4dc1133..220675b 100644 (file)
@@ -71,7 +71,7 @@ void Actor::join(double timeout)
 
 void Actor::set_auto_restart(bool autorestart)
 {
-  simgrid::simix::simcall([this, autorestart]() { pimpl_->auto_restart_ = autorestart; });
+  simgrid::simix::simcall([this, autorestart]() { pimpl_->set_auto_restart(autorestart); });
 }
 
 void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
index 943889d..55cd833 100644 (file)
@@ -771,14 +771,6 @@ void SIMIX_process_on_exit(smx_actor_t process, std::function<void(int, void*)>
   process->on_exit.emplace_back(s_smx_process_exit_fun_t{fun, data});
 }
 
-/**
- * \brief Sets the auto-restart status of the process.
- * If set to 1, the process will be automatically restarted when its host comes back.
- */
-void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart) {
-  process->auto_restart_ = auto_restart;
-}
-
 /** @brief Restart a process, starting it again from the beginning. */
 /**
  * \ingroup simix_process_management
index 605e6d8..5d610f7 100644 (file)
@@ -51,6 +51,8 @@ public:
   ActorImpl() : piface_(this) {}
   ~ActorImpl();
 
+  void set_auto_restart(bool autorestart) { auto_restart_ = autorestart; }
+
   boost::intrusive::list_member_hook<> host_process_list_hook; /* simgrid::simix::Host::process_list */
   boost::intrusive::list_member_hook<> smx_destroy_list_hook;  /* simix_global->process_to_destroy */
   boost::intrusive::list_member_hook<> smx_synchro_hook;       /* {mutex,cond,sem}->sleeping */
@@ -148,8 +150,6 @@ XBT_PRIVATE void SIMIX_process_empty_trash();
 XBT_PRIVATE void SIMIX_process_yield(smx_actor_t self);
 XBT_PRIVATE void SIMIX_process_change_host(smx_actor_t process, sg_host_t dest);
 
-XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_actor_t process, int auto_restart);
-
 extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor);
 
 XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
index 7dd21c8..02e4503 100644 (file)
@@ -456,7 +456,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
       if (arg->kill_time >= 0)
         simcall_process_set_kill_time(actor, arg->kill_time);
       if (auto_restart)
-        SIMIX_process_auto_restart_set(actor, auto_restart);
+        actor->set_auto_restart(auto_restart);
       delete arg;
     });
   } else {                      // start_time <= SIMIX_get_clock()
@@ -470,7 +470,7 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
       if (arg->kill_time >= 0)
         simcall_process_set_kill_time(actor, arg->kill_time);
       if (auto_restart)
-        SIMIX_process_auto_restart_set(actor, auto_restart);
+        actor->set_auto_restart(auto_restart);
     }
   }
 }