From: cristianrosa Date: Thu, 20 Jan 2011 15:45:15 +0000 (+0000) Subject: Bugfix: every state should also save a copy of the communication action associated... X-Git-Tag: v3.6_beta2~471 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/42cdb08adb14105f0a0398e9ede13ed3148cbcdc?ds=sidebyside Bugfix: every state should also save a copy of the communication action associated to the request. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9458 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/mc/mc_state.c b/src/mc/mc_state.c index 6163c7c1d4..8f88efe46f 100644 --- a/src/mc/mc_state.c +++ b/src/mc/mc_state.c @@ -58,8 +58,8 @@ void MC_state_set_executed_request(mc_state_t state, smx_req_t req, int value) case REQ_COMM_WAITANY: state->internal_req.call = REQ_COMM_WAIT; state->internal_req.issuer = req->issuer; - state->internal_req.comm_wait.comm = - xbt_dynar_get_as(req->comm_waitany.comms, value, smx_action_t); + state->internal_comm = *xbt_dynar_get_as(req->comm_waitany.comms, value, smx_action_t); + state->internal_req.comm_wait.comm = &state->internal_comm; state->internal_req.comm_wait.timeout = 0; break; @@ -68,14 +68,24 @@ void MC_state_set_executed_request(mc_state_t state, smx_req_t req, int value) state->internal_req.issuer = req->issuer; if(value > 0) - state->internal_req.comm_test.comm = - xbt_dynar_get_as(req->comm_testany.comms, value, smx_action_t); - else - state->internal_req.comm_test.comm = NULL; + state->internal_comm = *xbt_dynar_get_as(req->comm_testany.comms, value, smx_action_t); + state->internal_req.comm_wait.comm = &state->internal_comm; state->internal_req.comm_test.result = value; break; + case REQ_COMM_WAIT: + state->internal_req = *req; + state->internal_comm = *req->comm_wait.comm; + state->internal_req.comm_wait.comm = &state->internal_comm; + break; + + case REQ_COMM_TEST: + state->internal_req = *req; + state->internal_comm = *req->comm_test.comm; + state->internal_req.comm_test.comm = &state->internal_comm; + break; + default: state->internal_req = *req; break; diff --git a/src/mc/private.h b/src/mc/private.h index 6dbfe044d0..a21924521c 100644 --- a/src/mc/private.h +++ b/src/mc/private.h @@ -79,6 +79,7 @@ typedef struct mc_procstate{ typedef struct mc_state { unsigned long max_pid; /* Maximum pid at state's creation time */ mc_procstate_t proc_status; /* State's exploration status by process */ + s_smx_action_t internal_comm; /* To be referenced by the internal_req */ s_smx_req_t internal_req; /* Internal translation of request */ s_smx_req_t executed_req; /* The executed request of the state */ int req_num; /* The request number (in the case of a