MSG_error_t status = MSG_OK;
simdata = task->simdata;
+ m_process_t self = SIMIX_process_self();
+ p_simdata = SIMIX_process_self_get_data(self);
#ifdef HAVE_TRACING
TRACE_msg_task_execute_start(task);
XBT_DEBUG("Computing on %s", MSG_process_get_name(MSG_process_self()));
- if (simdata->computation_amount == 0) {
+ if (simdata->computation_amount == 0 && !simdata->host_nb) {
#ifdef HAVE_TRACING
TRACE_msg_task_execute_end(task);
#endif
return MSG_OK;
}
- m_process_t self = SIMIX_process_self();
- p_simdata = SIMIX_process_self_get_data(self);
- p_simdata->waiting_action = simdata->compute;
TRY {
#ifdef HAVE_TRACING
simcall_set_category(simdata->compute, task->category);
simdata->isused=1;
- if (simdata->host_nb) {
- simcall_host_parallel_execute(task->name, simdata->host_nb,
+ if (simdata->host_nb > 0) {
+ simdata->compute = simcall_host_parallel_execute(task->name, simdata->host_nb,
simdata->host_list,
simdata->comp_amount,
simdata->comm_amount, 1.0, -1.0);
- comp_state = simcall_host_execution_wait(simdata->compute);
+ XBT_DEBUG("Parallel execution action created: %p", simdata->compute);
}
else {
simdata->compute =
simdata->computation_amount,
simdata->priority);
- comp_state = simcall_host_execution_wait(simdata->compute);
}
+ p_simdata->waiting_action = simdata->compute;
+ comp_state = simcall_host_execution_wait(simdata->compute);
p_simdata->waiting_action = NULL;
status = MSG_HOST_FAILURE;
break;
case cancel_error:
- /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
- simdata->comm = NULL;
- simdata->compute = NULL;
- #ifdef HAVE_TRACING
- TRACE_msg_task_execute_end(task);
- #endif
+ #ifdef HAVE_TRACING
+ TRACE_msg_task_execute_end(task);
+ #endif
status = MSG_TASK_CANCELED;
break;
default: