- try {
- simdata->setUsed();
-
- if (simdata->host_nb > 0) {
- simdata->compute =
- boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(simcall_execution_parallel_start(
- task->name, simdata->host_nb, simdata->host_list, simdata->flops_parallel_amount,
- simdata->bytes_parallel_amount, -1.0, timeout));
- XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get());
- } else {
- simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
- simcall_execution_start(task->name, simdata->flops_amount, simdata->priority, simdata->bound,
- MSG_process_get_host(MSG_process_self())));
- }
- simcall_set_category(simdata->compute, task->category);
- comp_state = simcall_execution_wait(simdata->compute);
-
- simdata->setNotUsed();
-
- XBT_DEBUG("Execution task '%s' finished in state %d", task->name, (int)comp_state);
- }
- catch (xbt_ex& e) {
- switch (e.category) {
- case cancel_error:
- status = MSG_TASK_CANCELED;
- break;
- case host_error:
- status = MSG_HOST_FAILURE;
- break;
- case timeout_error:
- status = MSG_TIMEOUT;
- break;
- default:
- throw;
- }
- }
-
- /* action ended, set comm and compute = nullptr, the actions is already destroyed in the main function */
- simdata->flops_amount = 0.0;
- simdata->comm = nullptr;
- simdata->compute = nullptr;
- TRACE_msg_task_execute_end(task);
-
- return status;
-}
-
-/** \ingroup msg_task_usage
- * \brief Sleep for the specified number of seconds
- *
- * Makes the current process sleep until \a time seconds have elapsed.
- *
- * \param nb_sec a number of second
- */
-msg_error_t MSG_process_sleep(double nb_sec)
-{
- msg_error_t status = MSG_OK;
-