Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
First step in the implementation of topologies in SMPI
[simgrid.git] / src / smpi / smpi_global.c
index 876889f..966ec52 100644 (file)
@@ -7,6 +7,7 @@
 #include "private.h"
 #include "smpi_mpi_dt_private.h"
 #include "mc/mc.h"
+#include "xbt/replay.h"
 #include "surf/surf.h"
 #include "simix/smx_private.h"
 #include "simgrid/sg_config.h"
@@ -85,6 +86,8 @@ void smpi_process_init(int *argc, char ***argv)
     simcall_rdv_set_receiver(data->mailbox_small, proc);
     XBT_DEBUG("<%d> New process in the game: %p", index, proc);
   }
+  if (smpi_process_data() == NULL)
+    xbt_die("smpi_process_data() returned NULL. You probably gave a NULL parameter to MPI_Init. Although it's required by MPI-2, this is currently not supported by SMPI.");
 }
 
 void smpi_process_destroy(void)
@@ -287,7 +290,7 @@ MPI_Comm smpi_process_comm_self(void)
   smpi_process_data_t data = smpi_process_data();
   if(data->comm_self==MPI_COMM_NULL){
     MPI_Group group = smpi_group_new(1);
-    data->comm_self = smpi_comm_new(group);
+    data->comm_self = smpi_comm_new(group, NULL);
     smpi_group_set_mapping(group, smpi_process_index(), 0);
   }
 
@@ -318,6 +321,7 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm,
                                            void *buff, size_t buff_size)
 {
   XBT_DEBUG("Copy the data over");
+  if(_xbt_replay_is_active()) return;
   memcpy(comm->comm.dst_buff, buff, buff_size);
   if (comm->comm.detached) {
     // if this is a detached send, the source buffer was duplicated by SMPI
@@ -356,7 +360,7 @@ void smpi_global_init(void)
     process_data[i]->sampling = 0;
   }
   group = smpi_group_new(process_count);
-  MPI_COMM_WORLD = smpi_comm_new(group);
+  MPI_COMM_WORLD = smpi_comm_new(group, NULL);
   MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD);
   for (i = 0; i < process_count; i++) {
     smpi_group_set_mapping(group, i, i);
@@ -417,7 +421,6 @@ int __attribute__ ((weak)) smpi_simulated_main_(int argc, char **argv)
 {
   smpi_process_init(&argc, &argv);
   user_main_();
-  //xbt_die("Should not be in this smpi_simulated_main");
   return 0;
 }