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 */
* 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
}
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)
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;
}
{
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
simgrid::simix::marshal<void*>(simcall->args[2], arg);
}
-static inline smx_actor_t simcall_process_auto_restart_set__get__process(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_auto_restart_set__getraw__process(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_auto_restart_set__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
- simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline int simcall_process_auto_restart_set__get__auto_restart(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<int>(simcall->args[1]);
-}
-static inline int simcall_process_auto_restart_set__getraw__auto_restart(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
-}
-static inline void simcall_process_auto_restart_set__set__auto_restart(smx_simcall_t simcall, int arg)
-{
- simgrid::simix::marshal<int>(simcall->args[1], arg);
-}
-
static inline smx_actor_t simcall_process_restart__get__process(smx_simcall_t simcall)
{
return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(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<void, smx_actor_t, int>(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);
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,
"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",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_PROCESS_AUTO_RESTART_SET:
- SIMIX_process_auto_restart_set(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_PROCESS_RESTART:
simgrid::simix::marshal<smx_actor_t>(simcall->result, simcall_HANDLER_process_restart(simcall, simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0])));
SIMIX_simcall_answer(simcall);
int execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
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;
}
}
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();
}