Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Bugfix: the result of waitany calls should be determined by SIMIX_comm_finish
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 7 Jan 2011 08:23:56 +0000 (08:23 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 7 Jan 2011 08:23:56 +0000 (08:23 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9380 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/smx_network.c

index 41192b6..008da75 100644 (file)
@@ -408,7 +408,6 @@ void SIMIX_pre_comm_waitany(smx_req_t req, unsigned int idx)
     /* Associate this request to the action */
     xbt_fifo_push(action->request_list, req);
     if (action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING){
     /* Associate this request to the action */
     xbt_fifo_push(action->request_list, req);
     if (action->state != SIMIX_WAITING && action->state != SIMIX_RUNNING){
-      req->comm_waitany.result = cursor;
       SIMIX_comm_finish(action);
       break;
     }
       SIMIX_comm_finish(action);
       break;
     }
@@ -481,6 +480,8 @@ void SIMIX_comm_finish(smx_action_t action)
        return it as the result of the call */
     if (req->call == REQ_COMM_WAITANY) {
       SIMIX_waitany_req_remove_from_actions(req);
        return it as the result of the call */
     if (req->call == REQ_COMM_WAITANY) {
       SIMIX_waitany_req_remove_from_actions(req);
+      if(!MC_IS_ENABLED)
+        req->comm_waitany.result = xbt_dynar_search(req->comm_waitany.comms, &action);
     }
 
     /* If the action is still in a rendez-vous point then remove from it */
     }
 
     /* If the action is still in a rendez-vous point then remove from it */