Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Return the host failures in the same process sleep requests.
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 28 Jan 2011 16:25:50 +0000 (16:25 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 28 Jan 2011 16:25:50 +0000 (16:25 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9528 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/msg/gos.c
src/simix/smx_process.c

index 4993ae0..e581ab0 100644 (file)
@@ -243,22 +243,16 @@ MSG_error_t MSG_process_sleep(double nb_sec)
   proc->simdata->waiting_action = NULL;*/
   
   if (state == SIMIX_DONE) {
   proc->simdata->waiting_action = NULL;*/
   
   if (state == SIMIX_DONE) {
-    if (SIMIX_req_host_get_state(SIMIX_host_self()) == SURF_RESOURCE_OFF) {
 #ifdef HAVE_TRACING
 #ifdef HAVE_TRACING
-      TRACE_msg_process_sleep_out(MSG_process_self());
+  TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
 #endif
-      MSG_RETURN(MSG_HOST_FAILURE);
-    }
+    MSG_RETURN(MSG_OK);
   } else {
 #ifdef HAVE_TRACING
     TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
     MSG_RETURN(MSG_HOST_FAILURE);
   }
   } else {
 #ifdef HAVE_TRACING
     TRACE_msg_process_sleep_out(MSG_process_self());
 #endif
     MSG_RETURN(MSG_HOST_FAILURE);
   }
-#ifdef HAVE_TRACING
-  TRACE_msg_process_sleep_out(MSG_process_self());
-#endif
-  MSG_RETURN(MSG_OK);
 }
 
 /** \ingroup msg_gos_functions
 }
 
 /** \ingroup msg_gos_functions
index d267eb9..c24f922 100644 (file)
@@ -454,15 +454,28 @@ smx_action_t SIMIX_process_sleep(smx_process_t process, double duration)
 
 void SIMIX_post_process_sleep(smx_action_t action)
 {
 
 void SIMIX_post_process_sleep(smx_action_t action)
 {
-  e_smx_state_t state = SIMIX_action_map_state(surf_workstation_model->action_state_get(action->sleep.surf_sleep));
   smx_req_t req;
   smx_req_t req;
+  e_smx_state_t state;
 
   while ((req = xbt_fifo_shift(action->request_list))) {
 
   while ((req = xbt_fifo_shift(action->request_list))) {
+
+    switch(surf_workstation_model->action_state_get(action->sleep.surf_sleep)){
+      case SURF_ACTION_FAILED:
+        state = SIMIX_SRC_HOST_FAILURE;
+        break;
+
+      case SURF_ACTION_DONE:
+        state = SIMIX_DONE;
+        break;
+
+      default:
+        THROW_IMPOSSIBLE;
+        break;
+    }
     req->process_sleep.result = state;
     req->issuer->waiting_action = NULL;
     SIMIX_request_answer(req);
   }
     req->process_sleep.result = state;
     req->issuer->waiting_action = NULL;
     SIMIX_request_answer(req);
   }
-
   SIMIX_process_sleep_destroy(action);
 }
 
   SIMIX_process_sleep_destroy(action);
 }