Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
smpi replayed waitall was not working, as request vector is destroyed inside the...
authordegomme <augustin.degomme@unibas.ch>
Thu, 20 Oct 2016 12:33:05 +0000 (14:33 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Thu, 20 Oct 2016 13:09:42 +0000 (15:09 +0200)
Store information before the call to trace them properly at the end of the wait

src/smpi/smpi_replay.cpp

index 149ec5f..4e8afaa 100644 (file)
@@ -436,13 +436,25 @@ static void action_waitall(const char *const *action){
    extra->type = TRACING_WAITALL;
    extra->send_size=count_requests;
    TRACE_smpi_ptp_in(rank_traced, -1, -1, __FUNCTION__,extra);
-
+   int* recvs_snd= xbt_new0(int,count_requests);
+   int* recvs_rcv= xbt_new0(int,count_requests);
+   unsigned int i=0;
+   for (auto req : *(get_reqq_self())){
+     if (req && req->recv){
+       recvs_snd[i]=req->src;
+       recvs_rcv[i]=req->dst;
+     }else
+       recvs_snd[i]=-100;
+     i++;
+   }
    smpi_mpi_waitall(count_requests, &(*get_reqq_self())[0], status);
 
-   for (auto req : *(get_reqq_self())){
-     if (req && req->recv)
-       TRACE_smpi_recv(rank_traced, req->src, req->dst);
+   for (i=0; i<count_requests;i++){
+     if (recvs_snd[i]!=-100)
+       TRACE_smpi_recv(rank_traced, recvs_snd[i], recvs_rcv[i]);
    }
+   xbt_free(recvs_rcv);
+   xbt_free(recvs_snd);
    TRACE_smpi_ptp_out(rank_traced, -1, -1, __FUNCTION__);
   }
   log_timed_action (action, clock);