From: cristianrosa Date: Fri, 28 Jan 2011 16:25:50 +0000 (+0000) Subject: Return the host failures in the same process sleep requests. X-Git-Tag: v3.6_beta2~401 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f0cd4be195414e0a2db71f136f042a8b000f073e Return the host failures in the same process sleep requests. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9528 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/msg/gos.c b/src/msg/gos.c index 4993ae0de7..e581ab09f9 100644 --- a/src/msg/gos.c +++ b/src/msg/gos.c @@ -243,22 +243,16 @@ MSG_error_t MSG_process_sleep(double nb_sec) proc->simdata->waiting_action = NULL;*/ if (state == SIMIX_DONE) { - if (SIMIX_req_host_get_state(SIMIX_host_self()) == SURF_RESOURCE_OFF) { #ifdef HAVE_TRACING - TRACE_msg_process_sleep_out(MSG_process_self()); + TRACE_msg_process_sleep_out(MSG_process_self()); #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); } -#ifdef HAVE_TRACING - TRACE_msg_process_sleep_out(MSG_process_self()); -#endif - MSG_RETURN(MSG_OK); } /** \ingroup msg_gos_functions diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index d267eb9e47..c24f92204f 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -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) { - e_smx_state_t state = SIMIX_action_map_state(surf_workstation_model->action_state_get(action->sleep.surf_sleep)); smx_req_t req; + e_smx_state_t state; 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); } - SIMIX_process_sleep_destroy(action); }