Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Test for failed host is wrong for parallel tasks.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 28 Jun 2012 09:28:19 +0000 (11:28 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 28 Jun 2012 09:51:11 +0000 (11:51 +0200)
src/simix/smx_host.c

index c54c9fb..f663ea2 100644 (file)
@@ -422,14 +422,18 @@ void SIMIX_execution_finish(smx_action_t action)
 
 void SIMIX_post_host_execute(smx_action_t action)
 {
 
 void SIMIX_post_host_execute(smx_action_t action)
 {
-  if (surf_workstation_model->extension.workstation.get_state(action->execution.host->host)==SURF_RESOURCE_OFF) {
-    /* if the host running the action failed, notice it so that the asking process can be killed if it runs on that host itself */
+  if (action->type == SIMIX_ACTION_EXECUTE && /* FIMXE: handle resource failure
+                                               * for parallel tasks too */
+      surf_workstation_model->extension.workstation.get_state(action->execution.host->host) == SURF_RESOURCE_OFF) {
+    /* If the host running the action failed, notice it so that the asking
+     * process can be killed if it runs on that host itself */
     action->state = SIMIX_FAILED;
   } else if (surf_workstation_model->action_state_get(action->execution.surf_exec) == SURF_ACTION_FAILED) {
     action->state = SIMIX_FAILED;
   } else if (surf_workstation_model->action_state_get(action->execution.surf_exec) == SURF_ACTION_FAILED) {
-    /* If the host running the action didn't fail, then the action was canceled */
-     action->state = SIMIX_CANCELED;
+    /* If the host running the action didn't fail, then the action was
+     * canceled */
+    action->state = SIMIX_CANCELED;
   } else {
   } else {
-     action->state = SIMIX_DONE;
+    action->state = SIMIX_DONE;
   }
 
   if (action->execution.surf_exec) {
   }
 
   if (action->execution.surf_exec) {