- * \ingroup simix_process_management
- * \brief Creates a synchro that executes some computation of an host.
- *
- * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX synchro. It can raise a host_error exception if the host crashed.
- *
- * \param name Name of the execution synchro to create
- * \param flops_amount amount Computation amount (in flops)
- * \param priority computation priority
- * \param bound
- * \param host host where the synchro will be executed
- * \return A new SIMIX execution synchronization
- */
-smx_activity_t simcall_execution_start(const char* name, double flops_amount, double priority, double bound,
- simgrid::s4u::Host* host)
-{
- /* checking for infinite values */
- xbt_assert(std::isfinite(flops_amount), "flops_amount is not finite!");
- xbt_assert(std::isfinite(priority), "priority is not finite!");
-
- return simgrid::simix::simcall([name, flops_amount, priority, bound, host] {
- return SIMIX_execution_start(name, flops_amount, priority, bound, host);
- });
-}
-
-/**
- * \ingroup simix_process_management
- * \brief Creates a synchro that may involve parallel computation on
- * several hosts and communication between them.
- *
- * \param name Name of the execution synchro to create
- * \param host_nb Number of hosts where the synchro will be executed
- * \param host_list Array (of size host_nb) of hosts where the synchro will be executed
- * \param flops_amount Array (of size host_nb) of computation amount of hosts (in bytes)
- * \param bytes_amount Array (of size host_nb * host_nb) representing the communication
- * amount between each pair of hosts
- * \param rate the SURF action rate
- * \param timeout timeout
- * \return A new SIMIX execution synchronization
- */
-smx_activity_t simcall_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list,
- double* flops_amount, double* bytes_amount, double rate, double timeout)
-{
- /* 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::simcall([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 (exec->surf_action_ == nullptr) // FIXME: One test fails if I remove this, but I don't get why...
- return;
- simgrid::simix::simcall([exec] { exec->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::simcall([execution, priority] {
-
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
- exec->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::simcall([execution, bound] {
- simgrid::kernel::activity::ExecImplPtr exec =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
- exec->set_bound(bound);
- });
-}
-
-/**
- * \ingroup simix_host_management
- * \brief Waits for the completion of an execution synchro and destroy it.