Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
root should be optional for gather replay (as it is everywhere else)
[simgrid.git] / src / smpi / smpi_replay.c
index a8ffb170c1c0d93e613341cc41eac835caff164d..6cbe6ae2d762be94cbe11217dd40fed6ae82cb83 100644 (file)
@@ -351,15 +351,19 @@ static void action_test(const char *const *action){
   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
-  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.
@@ -369,7 +373,7 @@ static void action_test(const char *const *action){
 #ifdef HAVE_TRACING
   TRACE_smpi_testing_out(rank);
 #endif
-
+  }
   log_timed_action (action, clock);
 }
 
@@ -679,8 +683,9 @@ static void action_gather(const char *const *action) {
   }
   void *send = smpi_get_tmp_sendbuffer(send_size* smpi_datatype_size(MPI_CURRENT_TYPE));
   void *recv = NULL;
-
-  int root=atoi(action[4]);
+  int root=0;
+  if(action[4])
+    root=atoi(action[4]);
   int rank = smpi_comm_rank(MPI_COMM_WORLD);
 
   if(rank==root)