From: Frederic Suter Date: Wed, 19 Jul 2017 11:59:57 +0000 (+0200) Subject: kill another old-fashioned simcall X-Git-Tag: v3_17~364^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7c4bef6efee6ba4a06f99e78ea1198d74dc520fc?ds=sidebyside kill another old-fashioned simcall --- diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 6921451ecc..81cf2385b9 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -219,7 +219,6 @@ XBT_PUBLIC(void) simcall_process_set_data(smx_actor_t process, void *data); XBT_PUBLIC(xbt_dict_t) simcall_process_get_properties(smx_actor_t host); XBT_PUBLIC(void) simcall_process_set_kill_time(smx_actor_t process, double kill_time); XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data); -XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart); XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process); XBT_PUBLIC(void) simcall_process_join(smx_actor_t process, double timeout); /* Sleep control */ diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index 2cabc4796d..cb1dd50a9d 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -464,7 +464,7 @@ void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) { * If the flag is set to 1, the process will be automatically restarted when its host comes back up. */ XBT_PUBLIC(void) MSG_process_auto_restart_set(msg_process_t process, int auto_restart) { - simcall_process_auto_restart_set(process->getImpl(), auto_restart); + simgrid::simix::kernelImmediate([process, auto_restart]() { process->getImpl()->auto_restart = auto_restart; }); } /** * \ingroup m_process_management diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 3d8a38ed30..859dfe7c79 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -62,7 +62,7 @@ void Actor::join() { } void Actor::setAutoRestart(bool autorestart) { - simcall_process_auto_restart_set(pimpl_,autorestart); + simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; }); } void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index f9b0f73f6b..afdedc1bc5 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -191,7 +191,7 @@ ActorImpl* ActorImpl::restart(ActorImpl* issuer) if (arg.kill_time >= 0) simcall_process_set_kill_time(actor, arg.kill_time); if (arg.auto_restart) - simcall_process_auto_restart_set(actor, arg.auto_restart); + actor->auto_restart = arg.auto_restart; return actor; } diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index f05e1f1f4f..1d1b2a682b 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -267,16 +267,6 @@ XBT_PUBLIC(void) simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_ { simcall_BODY_process_on_exit(process, fun, data); } -/** - * \ingroup simix_process_management - * \brief Sets the process to be auto-restarted or not by SIMIX when its host comes back up. - * Will restart the process when the host comes back up if auto_restart is set to 1. - */ - -XBT_PUBLIC(void) simcall_process_auto_restart_set(smx_actor_t process, int auto_restart) -{ - simcall_BODY_process_auto_restart_set(process, auto_restart); -} /** * \ingroup simix_process_management diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index 1966f288e8..2cf9ba506d 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -443,31 +443,6 @@ static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, voi simgrid::simix::marshal(simcall->args[2], arg); } -static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args[0]); -} -static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args[0]); -} -static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg) -{ - simgrid::simix::marshal(simcall->args[0], arg); -} -static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal(simcall->args[1]); -} -static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall) -{ - return simgrid::simix::unmarshal_raw(simcall->args[1]); -} -static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg) -{ - simgrid::simix::marshal(simcall->args[1], arg); -} - static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall) { return simgrid::simix::unmarshal(simcall->args[0]); diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index 486da232b7..8d687e5b3e 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -135,12 +135,6 @@ inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid return simcall(SIMCALL_PROCESS_ON_EXIT, process, fun, data); } -inline static void simcall_BODY_process_auto_restart_set(smx_actor_t process, int auto_restart) { - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_process_auto_restart_set(process, auto_restart); - return simcall(SIMCALL_PROCESS_AUTO_RESTART_SET, process, auto_restart); - } - inline static smx_actor_t simcall_BODY_process_restart(smx_actor_t process) { /* Go to that function to follow the code flow through the simcall barrier */ if (0) simcall_HANDLER_process_restart(&SIMIX_process_self()->simcall, process); diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index eede34ffb7..9b88602630 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -32,7 +32,6 @@ typedef enum { SIMCALL_EXECUTION_SET_BOUND, SIMCALL_EXECUTION_WAIT, SIMCALL_PROCESS_ON_EXIT, - SIMCALL_PROCESS_AUTO_RESTART_SET, SIMCALL_PROCESS_RESTART, SIMCALL_COMM_IPROBE, SIMCALL_COMM_SEND, diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index 0de896d6bf..d5e4940672 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -38,7 +38,6 @@ const char* simcall_names[] = { "SIMCALL_EXECUTION_SET_BOUND", "SIMCALL_EXECUTION_WAIT", "SIMCALL_PROCESS_ON_EXIT", - "SIMCALL_PROCESS_AUTO_RESTART_SET", "SIMCALL_PROCESS_RESTART", "SIMCALL_COMM_IPROBE", "SIMCALL_COMM_SEND", @@ -162,11 +161,6 @@ case SIMCALL_PROCESS_ON_EXIT: SIMIX_simcall_answer(simcall); break; -case SIMCALL_PROCESS_AUTO_RESTART_SET: - SIMIX_process_auto_restart_set(simgrid::simix::unmarshal(simcall->args[0]), simgrid::simix::unmarshal(simcall->args[1])); - SIMIX_simcall_answer(simcall); - break; - case SIMCALL_PROCESS_RESTART: simgrid::simix::marshal(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal(simcall->args[0]))); SIMIX_simcall_answer(simcall); diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 69734e4673..25fc2e37f9 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -50,7 +50,6 @@ void execution_set_bound(boost::intrusive_ptr execution) [[block]]; void process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]]; -void process_auto_restart_set(smx_actor_t process, int auto_restart) [[nohandler]]; smx_actor_t process_restart(smx_actor_t process); boost::intrusive_ptr comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 18e9829064..bc6c5a7877 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -63,7 +63,7 @@ namespace simgrid { if (arg->kill_time >= 0) simcall_process_set_kill_time(actor, arg->kill_time); if (arg->auto_restart) - simcall_process_auto_restart_set(actor, arg->auto_restart); + actor->auto_restart = arg->auto_restart; } } @@ -147,7 +147,7 @@ void SIMIX_host_autorestart(sg_host_t host) if (arg->kill_time >= 0) simcall_process_set_kill_time(actor, arg->kill_time); if (arg->auto_restart) - simcall_process_auto_restart_set(actor, arg->auto_restart); + actor->auto_restart = arg->auto_restart; } process_list.clear(); }