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(smx_actor_t) simcall_process_restart(smx_actor_t process);
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);
* \brief Restarts a process from the beginning.
*/
XBT_PUBLIC(msg_process_t) MSG_process_restart(msg_process_t process) {
- return simcall_process_restart(process->getImpl())->ciface();
+ return simgrid::simix::kernelImmediate(
+ [process]() { return process->getImpl()->restart(process->getImpl())->ciface(); });
}
/** @ingroup m_process_management
/**
* \brief Calling this function makes the process to yield.
*
- * Only the current process can call this function, giving back the control to
- * maestro.
+ * Only the current process can call this function, giving back the control to maestro.
*
* \param self the current process
*/
xbt_abort();
}
-/**
- * \brief Returns the list of processes to run.
- */
+/** @brief Returns the list of processes to run. */
xbt_dynar_t SIMIX_process_get_runnable()
{
return simix_global->process_to_run;
}
-/**
- * \brief Returns the process from PID.
- */
+/** @brief Returns the process from PID. */
smx_actor_t SIMIX_process_from_PID(aid_t PID)
{
if (simix_global->process_list.find(PID) == simix_global->process_list.end())
/**
* \brief Sets the auto-restart status of the process.
- * If set to 1, the process will be automatically restarted when its host
- * comes back.
+ * 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;
}
-smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process) {
- return process->restart(simcall->issuer);
-}
-
/** @brief Restart a process, starting it again from the beginning. */
/**
* \ingroup simix_process_management
simcall_BODY_process_on_exit(process, fun, data);
}
-/**
- * \ingroup simix_process_management
- * \brief Restarts the process, killing it and starting it again from scratch.
- */
-XBT_PUBLIC(smx_actor_t) simcall_process_restart(smx_actor_t process)
-{
- return (smx_actor_t) simcall_BODY_process_restart(process);
-}
/**
* \ingroup simix_process_management
* \brief Creates a new sleep SIMIX synchro.
fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization
xbt_abort();
}
- return simcall_BODY_mutex_init();
+ return simgrid::simix::kernelImmediate([] { return new simgrid::simix::MutexImpl(); });
}
/**
simgrid::simix::marshal<void*>(simcall->args[2], 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]);
-}
-static inline smx_actor_t simcall_process_restart__getraw__process(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_restart__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
- simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline smx_actor_t simcall_process_restart__get__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<smx_actor_t>(simcall->result);
-}
-static inline smx_actor_t simcall_process_restart__getraw__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->result);
-}
-static inline void simcall_process_restart__set__result(smx_simcall_t simcall, smx_actor_t result){
- simgrid::simix::marshal<smx_actor_t>(simcall->result, result);
-}
-
static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall)
{
return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]);
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_mutex_t simcall_mutex_init__get__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<smx_mutex_t>(simcall->result);
-}
-static inline smx_mutex_t simcall_mutex_init__getraw__result(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->result);
-}
-static inline void simcall_mutex_init__set__result(smx_simcall_t simcall, smx_mutex_t result){
- simgrid::simix::marshal<smx_mutex_t>(simcall->result, result);
-}
-
static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
{
return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
XBT_PRIVATE void
simcall_HANDLER_execution_wait(smx_simcall_t simcall,
boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution);
-XBT_PRIVATE smx_actor_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_actor_t process);
XBT_PRIVATE boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, simix_match_func_t match_fun,
void* data);
XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall,
boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms,
size_t count);
-XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
XBT_PRIVATE void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex);
return simcall<void, smx_actor_t, int_f_pvoid_pvoid_t, void*>(SIMCALL_PROCESS_ON_EXIT, process, fun, data);
}
-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);
- return simcall<smx_actor_t, smx_actor_t>(SIMCALL_PROCESS_RESTART, process);
- }
-
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)
{
comms, count);
}
-inline static smx_mutex_t simcall_BODY_mutex_init() {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) simcall_HANDLER_mutex_init(&SIMIX_process_self()->simcall);
- return simcall<smx_mutex_t>(SIMCALL_MUTEX_INIT);
- }
-
inline static void simcall_BODY_mutex_lock(smx_mutex_t mutex) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_mutex_lock(&SIMIX_process_self()->simcall, mutex);
SIMCALL_EXECUTION_SET_BOUND,
SIMCALL_EXECUTION_WAIT,
SIMCALL_PROCESS_ON_EXIT,
- SIMCALL_PROCESS_RESTART,
SIMCALL_COMM_IPROBE,
SIMCALL_COMM_SEND,
SIMCALL_COMM_ISEND,
SIMCALL_COMM_WAIT,
SIMCALL_COMM_TEST,
SIMCALL_COMM_TESTANY,
- SIMCALL_MUTEX_INIT,
SIMCALL_MUTEX_LOCK,
SIMCALL_MUTEX_TRYLOCK,
SIMCALL_COND_INIT,
"SIMCALL_EXECUTION_SET_BOUND",
"SIMCALL_EXECUTION_WAIT",
"SIMCALL_PROCESS_ON_EXIT",
- "SIMCALL_PROCESS_RESTART",
"SIMCALL_COMM_IPROBE",
"SIMCALL_COMM_SEND",
"SIMCALL_COMM_ISEND",
"SIMCALL_COMM_WAIT",
"SIMCALL_COMM_TEST",
"SIMCALL_COMM_TESTANY",
- "SIMCALL_MUTEX_INIT",
"SIMCALL_MUTEX_LOCK",
"SIMCALL_MUTEX_TRYLOCK",
"SIMCALL_COND_INIT",
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);
- 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<size_t>(simcall->args[1]));
break;
-case SIMCALL_MUTEX_INIT:
- simgrid::simix::marshal<smx_mutex_t>(simcall->result, simcall_HANDLER_mutex_init(simcall));
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_MUTEX_LOCK:
simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
break;
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]];
-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);
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]];
int comm_test(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm) [[block]];
int comm_testany(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>* comms, size_t count) [[block]];
-smx_mutex_t mutex_init();
void mutex_lock(smx_mutex_t mutex) [[block]];
int mutex_trylock(smx_mutex_t mutex);
intrusive_ptr_release(mutex);
}
-smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall)
-{
- return new simgrid::simix::MutexImpl();
-}
-
// Simcall handlers:
void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)