From bb99caf0d1e373c711970acf86fcc4850c4948c1 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Sun, 11 Feb 2018 22:23:40 +0100
Subject: [PATCH] Move rank/comm_size initialization to upper level for all
 runtimes

---
 control/control.c                        | 4 ++++
 runtime/starpu/control/runtime_control.c | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/control/control.c b/control/control.c
index b478c7eb3..546353686 100644
--- a/control/control.c
+++ b/control/control.c
@@ -105,6 +105,10 @@ int MORSE_InitPar(int ncpus, int ncudas, int nthreads_per_worker)
 #  endif
 #endif
     RUNTIME_init( morse, ncpus, ncudas, nthreads_per_worker );
+
+    morse->my_mpi_rank   = RUNTIME_comm_rank( morse );
+    morse->mpi_comm_size = RUNTIME_comm_size( morse );
+
     return MORSE_SUCCESS;
 }
 
diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c
index 82ba00606..a6980cbb1 100644
--- a/runtime/starpu/control/runtime_control.c
+++ b/runtime/starpu/control/runtime_control.c
@@ -102,8 +102,6 @@ int RUNTIME_init( MORSE_context_t *morse,
         MPI_Initialized( &flag );
 #endif
         starpu_mpi_init(NULL, NULL, !flag);
-        morse->my_mpi_rank = RUNTIME_comm_rank( morse );
-        morse->mpi_comm_size = RUNTIME_comm_size( morse );
     }
 #endif
 
-- 
GitLab