Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: every state should also save a copy of the communication action associated...
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 20 Jan 2011 15:45:15 +0000 (15:45 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 20 Jan 2011 15:45:15 +0000 (15:45 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9458 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/mc/mc_state.c
src/mc/private.h

index 6163c7c..8f88efe 100644 (file)
@@ -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;
     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;
 
       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.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;
 
       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;
     default:
       state->internal_req = *req;
       break;
index 6dbfe04..a219245 100644 (file)
@@ -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 */
 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
   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