From: Christian Heinrich Date: Thu, 11 Jan 2018 21:25:40 +0000 (+0100) Subject: [SMPI] Move SMPI_init() call to other location X-Git-Tag: v3.19~312^2~51 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c0a8dc4347a48934194fcc4b1db60613bc816cc8 [SMPI] Move SMPI_init() call to other location --- 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);