From: Martin Quinson Date: Sat, 30 Jun 2018 16:26:05 +0000 (+0200) Subject: replace SIMIX_process_auto_restart_set() with ActorImpl::set_auto_restart() X-Git-Tag: v3_21~588 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5258a7df1e22166d51d64e58eaa5514fe7121735?ds=sidebyside replace SIMIX_process_auto_restart_set() with ActorImpl::set_auto_restart() --- diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 4dc113374c..220675bf4a 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -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 */ diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 943889d085..55cd83357b 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -771,14 +771,6 @@ void SIMIX_process_on_exit(smx_actor_t process, std::function 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 diff --git a/src/simix/ActorImpl.hpp b/src/simix/ActorImpl.hpp index 605e6d857f..5d610f7972 100644 --- a/src/simix/ActorImpl.hpp +++ b/src/simix/ActorImpl.hpp @@ -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); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 7dd21c8512..02e450387e 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -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); } } }