- /* checking for infinite values */
- for (int i = 0 ; i < host_nb ; ++i) {
- xbt_assert(std::isfinite(flops_amount[i]), "flops_amount[%d] is not finite!", i);
- if (bytes_amount != nullptr) {
- for (int j = 0 ; j < host_nb ; ++j) {
- xbt_assert(std::isfinite(bytes_amount[i + host_nb * j]),
- "bytes_amount[%d+%d*%d] is not finite!", i, host_nb, j);
- }
- }
- }
-
- xbt_assert(std::isfinite(rate), "rate is not finite!");
-
- return simgrid::simix::kernelImmediate([name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout] {
- return SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, rate, timeout);
- });
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Cancels an execution synchro.
- *
- * This functions stops the execution. It calls a surf function.
- * \param execution The execution synchro to cancel
- */
-void simcall_execution_cancel(smx_activity_t execution)
-{
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
- if (not exec->surfAction_)
- return;
- simgrid::simix::kernelImmediate([exec] {
- XBT_DEBUG("Cancel synchro %p", exec.get());
- if (exec->surfAction_)
- exec->surfAction_->cancel();
- });
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Changes the priority of an execution synchro.
- *
- * This functions changes the priority only. It calls a surf function.
- * \param execution The execution synchro
- * \param priority The new priority
- */
-void simcall_execution_set_priority(smx_activity_t execution, double priority)
-{
- /* checking for infinite values */
- xbt_assert(std::isfinite(priority), "priority is not finite!");
- simgrid::simix::kernelImmediate([execution, priority] {
-
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
- if (exec->surfAction_)
- exec->surfAction_->set_priority(priority);
- });
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Changes the capping (the maximum CPU utilization) of an execution synchro.
- *
- * This functions changes the capping only. It calls a surf function.
- * \param execution The execution synchro
- * \param bound The new bound
- */
-void simcall_execution_set_bound(smx_activity_t execution, double bound)
-{
- simgrid::simix::kernelImmediate([execution, bound] {
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
- if (exec->surfAction_)
- exec->surfAction_->set_bound(bound);
- });
-}
-
-/**
- * \ingroup simix_host_management
- * \brief Waits for the completion of an execution synchro and destroy it.
- *
- * \param execution The execution synchro
- */
-e_smx_state_t simcall_execution_wait(smx_activity_t execution)
-{
- return (e_smx_state_t) simcall_BODY_execution_wait(execution);
-}
-
-e_smx_state_t simcall_execution_test(smx_activity_t execution)
-{
- return (e_smx_state_t)simcall_BODY_execution_test(execution);