Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Return action state on SIMIX_req_host_execution_wait().
[simgrid.git] / src / msg / gos.c
index e281bf7..46124d8 100644 (file)
@@ -38,6 +38,7 @@ MSG_error_t MSG_task_execute(m_task_t task)
 {
   simdata_task_t simdata = NULL;
   m_process_t self = MSG_process_self();
+  e_smx_state_t comp_state;
   CHECK_HOST();
 
   simdata = task->simdata;
@@ -64,20 +65,20 @@ MSG_error_t MSG_task_execute(m_task_t task)
   simdata->isused=1;
   simdata->compute =
       SIMIX_req_host_execute(task->name, SIMIX_host_self(),
-                           simdata->computation_amount);
-  SIMIX_req_host_execution_set_priority(simdata->compute, simdata->priority);
+                           simdata->computation_amount,
+                           simdata->priority);
 #ifdef HAVE_TRACING
   SIMIX_req_set_category(simdata->compute, task->category);
 #endif
 
   self->simdata->waiting_action = simdata->compute;
-  SIMIX_req_host_execution_wait(simdata->compute);
+  comp_state = SIMIX_req_host_execution_wait(simdata->compute);
   self->simdata->waiting_action = NULL;
 
   simdata->isused=0;
 
-  DEBUG2("Execution task '%s' finished in state %d", task->name, SIMIX_req_host_execution_get_state(task->simdata->compute));
-  if (SIMIX_req_host_execution_get_state(task->simdata->compute) == SIMIX_DONE) {
+  DEBUG2("Execution task '%s' finished in state %d", task->name, comp_state);
+  if (comp_state == SIMIX_DONE) {
     /* action ended, set comm and compute = NULL, the actions is already destroyed in the main function */
     SIMIX_req_host_execution_destroy(task->simdata->compute);
     simdata->computation_amount = 0.0;