Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_UNIVERSE_SIZE is initialized at runtime with MPI_COMM_WORLD
authorAugustin Degomme <degomme@idpann.imag.fr>
Thu, 11 Jul 2013 13:58:52 +0000 (15:58 +0200)
committerAugustin Degomme <degomme@idpann.imag.fr>
Thu, 11 Jul 2013 19:26:35 +0000 (21:26 +0200)
include/smpi/smpi.h
src/smpi/smpi_global.c

index 9803ff2..9cff118 100644 (file)
@@ -243,7 +243,7 @@ typedef struct s_smpi_mpi_communicator *MPI_Comm;
 
 #define MPI_COMM_NULL NULL
 XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
-#define MPI_UNIVERSE_SIZE smpi_comm_size(MPI_COMM_WORLD)
+XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
 #define MPI_COMM_SELF smpi_process_comm_self()
 
 struct s_smpi_mpi_request;
index de39759..659388c 100644 (file)
@@ -35,6 +35,7 @@ static smpi_process_data_t *process_data = NULL;
 static int process_count = 0;
 
 MPI_Comm MPI_COMM_WORLD = MPI_COMM_NULL;
+int MPI_UNIVERSE_SIZE;
 
 MPI_Errhandler* MPI_ERRORS_RETURN = NULL;
 MPI_Errhandler* MPI_ERRORS_ARE_FATAL = NULL;
@@ -267,6 +268,7 @@ void smpi_global_init(void)
   }
   group = smpi_group_new(process_count);
   MPI_COMM_WORLD = smpi_comm_new(group);
+  MPI_UNIVERSE_SIZE = smpi_comm_size(MPI_COMM_WORLD);
   for (i = 0; i < process_count; i++) {
     smpi_group_set_mapping(group, i, i);
   }