Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
previous commit was a mistake. Handle the case more gracefully.
authordegomme <degomme@localhost.localdomain>
Thu, 30 Oct 2014 14:56:48 +0000 (15:56 +0100)
committerdegomme <degomme@localhost.localdomain>
Thu, 30 Oct 2014 14:56:48 +0000 (15:56 +0100)
src/smpi/smpi_replay.c

index 685f7f3..682a49f 100644 (file)
@@ -351,26 +351,29 @@ static void action_test(const char *const *action){
   int flag = TRUE;
 
   request = xbt_dynar_pop_as(reqq[smpi_process_index()],MPI_Request);
   int flag = TRUE;
 
   request = xbt_dynar_pop_as(reqq[smpi_process_index()],MPI_Request);
-  xbt_assert(request != NULL, "found null request in reqq");
-
+  //if request is null here, this may mean that a previous test has succeeded 
+  //Different times in traced application and replayed version may lead to this 
+  //In this case, ignore the extra calls.
+  if(request){
 #ifdef HAVE_TRACING
   int rank = smpi_process_index();
   instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
   extra->type=TRACING_TEST;
   TRACE_smpi_testing_in(rank, extra);
 #endif
 #ifdef HAVE_TRACING
   int rank = smpi_process_index();
   instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1);
   extra->type=TRACING_TEST;
   TRACE_smpi_testing_in(rank, extra);
 #endif
-  flag = smpi_mpi_test(&request, &status);
+
+    flag = smpi_mpi_test(&request, &status);
+
   XBT_DEBUG("MPI_Test result: %d", flag);
   /* push back request in dynar to be caught by a subsequent wait. if the test
    * did succeed, the request is now NULL.
    */
   XBT_DEBUG("MPI_Test result: %d", flag);
   /* push back request in dynar to be caught by a subsequent wait. if the test
    * did succeed, the request is now NULL.
    */
-   if(request)
   xbt_dynar_push_as(reqq[smpi_process_index()],MPI_Request, request);
 
 #ifdef HAVE_TRACING
   TRACE_smpi_testing_out(rank);
 #endif
   xbt_dynar_push_as(reqq[smpi_process_index()],MPI_Request, request);
 
 #ifdef HAVE_TRACING
   TRACE_smpi_testing_out(rank);
 #endif
-
+  }
   log_timed_action (action, clock);
 }
 
   log_timed_action (action, clock);
 }