simgrid::kernel::activity::ExecImplPtr exec =
boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro);
- if (exec != nullptr) {
- SIMIX_execution_cancel(process->waiting_synchro);
- }
+ if (exec != nullptr && exec->surf_exec)
+ exec->surf_exec->cancel();
simgrid::kernel::activity::CommImplPtr comm =
boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro);
*/
void simcall_execution_cancel(smx_activity_t execution)
{
- simcall_BODY_execution_cancel(execution);
+ simgrid::simix::kernelImmediate([execution] {
+ XBT_DEBUG("Cancel synchro %p", execution.get());
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+
+ if (exec->surf_exec)
+ exec->surf_exec->cancel();
+ });
}
/**
{
/* checking for infinite values */
xbt_assert(std::isfinite(priority), "priority is not finite!");
+ simgrid::simix::kernelImmediate([execution, priority] {
- simcall_BODY_execution_set_priority(execution, priority);
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+ if (exec->surf_exec)
+ exec->surf_exec->setSharingWeight(priority);
+ });
}
/**
*/
void simcall_execution_set_bound(smx_activity_t execution, double bound)
{
- simcall_BODY_execution_set_bound(execution, bound);
+ simgrid::simix::kernelImmediate([execution, bound] {
+ simgrid::kernel::activity::ExecImplPtr exec =
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
+ if (exec->surf_exec)
+ static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
+ });
}
/**
simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl>>(simcall->result, result);
}
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_cancel__get__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_cancel__getraw__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_cancel__set__execution(smx_simcall_t simcall,
- boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
-{
- simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
-}
-
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_set_priority__get__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_set_priority__getraw__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_set_priority__set__execution(smx_simcall_t simcall,
- boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
-{
- simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
-}
-static inline double simcall_execution_set_priority__get__priority(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<double>(simcall->args[1]);
-}
-static inline double simcall_execution_set_priority__getraw__priority(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
-}
-static inline void simcall_execution_set_priority__set__priority(smx_simcall_t simcall, double arg)
-{
- simgrid::simix::marshal<double>(simcall->args[1], arg);
-}
-
-static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
-simcall_execution_set_bound__get__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]);
-}
-static inline simgrid::kernel::activity::ActivityImpl*
-simcall_execution_set_bound__getraw__execution(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->args[0]);
-}
-static inline void
-simcall_execution_set_bound__set__execution(smx_simcall_t simcall,
- boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> arg)
-{
- simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0], arg);
-}
-static inline double simcall_execution_set_bound__get__bound(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal<double>(simcall->args[1]);
-}
-static inline double simcall_execution_set_bound__getraw__bound(smx_simcall_t simcall)
-{
- return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
-}
-static inline void simcall_execution_set_bound__set__bound(smx_simcall_t simcall, double arg)
-{
- simgrid::simix::marshal<double>(simcall->args[1], arg);
-}
-
static inline boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>
simcall_execution_wait__get__execution(smx_simcall_t simcall)
{
bytes_amount, rate, timeout);
}
- inline static void
- simcall_BODY_execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
- {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_execution_cancel(execution);
- return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(SIMCALL_EXECUTION_CANCEL,
- execution);
- }
-
- inline static void
- simcall_BODY_execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
- double priority)
- {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_execution_set_priority(execution, priority);
- return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
- SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
- }
-
- inline static void
- simcall_BODY_execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution,
- double bound)
- {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_execution_set_bound(execution, bound);
- return simcall<void, boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, double>(
- SIMCALL_EXECUTION_SET_BOUND, execution, bound);
- }
-
inline static int simcall_BODY_execution_wait(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution)
{
/* Go to that function to follow the code flow through the simcall barrier */
SIMCALL_PROCESS_SLEEP,
SIMCALL_EXECUTION_START,
SIMCALL_EXECUTION_PARALLEL_START,
- SIMCALL_EXECUTION_CANCEL,
- SIMCALL_EXECUTION_SET_PRIORITY,
- SIMCALL_EXECUTION_SET_BOUND,
SIMCALL_EXECUTION_WAIT,
SIMCALL_PROCESS_ON_EXIT,
SIMCALL_COMM_IPROBE,
"SIMCALL_PROCESS_SLEEP",
"SIMCALL_EXECUTION_START",
"SIMCALL_EXECUTION_PARALLEL_START",
- "SIMCALL_EXECUTION_CANCEL",
- "SIMCALL_EXECUTION_SET_PRIORITY",
- "SIMCALL_EXECUTION_SET_BOUND",
"SIMCALL_EXECUTION_WAIT",
"SIMCALL_PROCESS_ON_EXIT",
"SIMCALL_COMM_IPROBE",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_EXECUTION_CANCEL:
- SIMIX_execution_cancel(
- simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]));
- SIMIX_simcall_answer(simcall);
- break;
-
-case SIMCALL_EXECUTION_SET_PRIORITY:
- SIMIX_execution_set_priority(
- simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
- simgrid::simix::unmarshal<double>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
-
-case SIMCALL_EXECUTION_SET_BOUND:
- SIMIX_execution_set_bound(
- simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->args[0]),
- simgrid::simix::unmarshal<double>(simcall->args[1]));
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_EXECUTION_WAIT:
simcall_HANDLER_execution_wait(
simcall,
boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_start(const char* name, double flops_amount, double priority, double bound);
boost::intrusive_ptr<simgrid::kernel::activity::ExecImpl> execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double rate, double timeout) [[nohandler]];
-void execution_cancel(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution) [[nohandler]];
-void execution_set_priority(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double priority) [[nohandler]];
-void execution_set_bound(boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> execution, double bound) [[nohandler]];
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]];
return exec;
}
-void SIMIX_execution_cancel(smx_activity_t synchro)
-{
- XBT_DEBUG("Cancel synchro %p", synchro.get());
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
-
- if (exec->surf_exec)
- exec->surf_exec->cancel();
-}
-
-void SIMIX_execution_set_priority(smx_activity_t synchro, double priority)
-{
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
- if(exec->surf_exec)
- exec->surf_exec->setSharingWeight(priority);
-}
-
-void SIMIX_execution_set_bound(smx_activity_t synchro, double bound)
-{
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(synchro);
- if(exec->surf_exec)
- static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
-}
-
void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
{
simgrid::kernel::activity::ExecImplPtr exec =
std::map<std::string, std::string>* properties, int auto_restart);
XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
-XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
-XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::ExecImplPtr exec);