/* Getters and Setters */
XBT_PUBLIC void simcall_process_set_data(smx_actor_t process, void* data);
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_join(smx_actor_t process, double timeout);
/* Sleep control */
XBT_PUBLIC e_smx_state_t simcall_process_sleep(double duration);
return nullptr;
}
- simcall_process_on_exit(process, (int_f_pvoid_pvoid_t)TRACE_msg_process_kill, process);
+ process->ciface()->on_exit((int_f_pvoid_pvoid_t)TRACE_msg_process_kill, process);
return process->ciface();
}
SIMIX_process_attach(name, new simgrid::msg::ActorExt(data), host->get_cname(), &props, nullptr);
if (not process)
xbt_die("Could not attach");
- simcall_process_on_exit(process,(int_f_pvoid_pvoid_t)TRACE_msg_process_kill,process);
+ process->ciface()->on_exit((int_f_pvoid_pvoid_t)TRACE_msg_process_kill, process);
return process->ciface();
}
* You should use them to free the data used by your process.
*/
void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) {
- simcall_process_on_exit(SIMIX_process_self(), fun, data);
+ simgrid::s4u::this_actor::on_exit(fun, data);
}
/**
* \ingroup m_process_management
void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data)
{
- simcall_process_on_exit(pimpl_, fun, data);
+ simgrid::simix::kernelImmediate([&] { SIMIX_process_on_exit(pimpl_, fun, data); });
}
/** @brief Moves the actor to another host
void on_exit(int_f_pvoid_pvoid_t fun, void* data)
{
- simcall_process_on_exit(SIMIX_process_self(), fun, data);
+ SIMIX_process_self()->iface()->on_exit(fun, data);
}
/** @brief Moves the current actor to another host
});
}
-/**
- * \ingroup simix_process_management
- * \brief Add an on_exit function
- * Add an on_exit function which will be executed when the process exits/is killed.
- */
-XBT_PUBLIC void simcall_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data)
-{
- simcall_BODY_process_on_exit(process, fun, data);
-}
-
/**
* \ingroup simix_process_management
* \brief Creates a new sleep SIMIX synchro.
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_actor_t simcall_process_on_exit__get__process(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_on_exit__getraw__process(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_on_exit__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
- simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline int_f_pvoid_pvoid_t simcall_process_on_exit__get__fun(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]);
-}
-static inline int_f_pvoid_pvoid_t simcall_process_on_exit__getraw__fun(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<int_f_pvoid_pvoid_t>(simcall->args[1]);
-}
-static inline void simcall_process_on_exit__set__fun(smx_simcall_t simcall, int_f_pvoid_pvoid_t arg)
-{
- simgrid::simix::marshal<int_f_pvoid_pvoid_t>(simcall->args[1], arg);
-}
-static inline void* simcall_process_on_exit__get__data(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<void*>(simcall->args[2]);
-}
-static inline void* simcall_process_on_exit__getraw__data(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
-}
-static inline void simcall_process_on_exit__set__data(smx_simcall_t simcall, void* arg)
-{
- simgrid::simix::marshal<void*>(simcall->args[2], arg);
-}
-
static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall)
{
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
return simcall<int, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_TEST, execution);
}
-inline static void simcall_BODY_process_on_exit(smx_actor_t process, int_f_pvoid_pvoid_t fun, void* data)
-{
- if (0) /* Go to that function to follow the code flow through the simcall barrier */
- SIMIX_process_on_exit(process, fun, data);
- return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
-}
-
inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data)
{
if (0) /* Go to that function to follow the code flow through the simcall barrier */
SIMCALL_EXECUTION_PARALLEL_START,
SIMCALL_EXECUTION_WAIT,
SIMCALL_EXECUTION_TEST,
- SIMCALL_PROCESS_ON_EXIT,
SIMCALL_COMM_IPROBE,
SIMCALL_COMM_SEND,
SIMCALL_COMM_ISEND,
"SIMCALL_EXECUTION_PARALLEL_START",
"SIMCALL_EXECUTION_WAIT",
"SIMCALL_EXECUTION_TEST",
- "SIMCALL_PROCESS_ON_EXIT",
"SIMCALL_COMM_IPROBE",
"SIMCALL_COMM_SEND",
"SIMCALL_COMM_ISEND",
simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
break;
-case SIMCALL_PROCESS_ON_EXIT:
- SIMIX_process_on_exit(simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]), simgrid::simix::unmarshal<int_f_pvoid_pvoid_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]));
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_COMM_IPROBE:
simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[2]), simgrid::simix::unmarshal<void*>(simcall->args[3])));
SIMIX_simcall_answer(simcall);
int execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[block]];
int execution_test(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]];
-
boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_iprobe(smx_mailbox_t mbox, int type, simix_match_func_t match_fun, void* data);
void comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);