From 4178d48270a11c7893b6425ff35ed9545cb1a163 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 11 Jul 2013 15:58:52 +0200 Subject: [PATCH] MPI_UNIVERSE_SIZE is initialized at runtime with MPI_COMM_WORLD --- include/smpi/smpi.h | 2 +- src/smpi/smpi_global.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 9803ff2c29..9cff118109 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -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; diff --git a/src/smpi/smpi_global.c b/src/smpi/smpi_global.c index de39759a21..659388c376 100644 --- a/src/smpi/smpi_global.c +++ b/src/smpi/smpi_global.c @@ -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); } -- 2.20.1