From c0a8dc4347a48934194fcc4b1db60613bc816cc8 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Thu, 11 Jan 2018 22:25:40 +0100 Subject: [PATCH] [SMPI] Move SMPI_init() call to other location --- src/smpi/internals/smpi_global.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 4ba19caf85..c9e5e7b24e 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -344,14 +344,6 @@ void smpi_global_init() } } #endif - - if (process_count == 0) { // The program has been dispatched but no other - // SMPI instances have been registered. We're using smpirun. - SMPI_app_instance_register(smpi_default_instance_name, nullptr, - SIMIX_process_count()); // This call has a side effect on process_count... - MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name); - } - smpi_universe_size = process_count; } void smpi_global_destroy() @@ -585,9 +577,13 @@ int smpi_main(const char* executable, int argc, char *argv[]) } + SMPI_init(); SIMIX_launch_application(argv[2]); + SMPI_app_instance_register(smpi_default_instance_name, nullptr, + SIMIX_process_count()); // This call has a side effect on process_count... + MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name); + smpi_universe_size = process_count; - SMPI_init(); /* Clean IO before the run */ fflush(stdout); -- 2.20.1