Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions ompi/runtime/ompi_mpi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,26 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
/* Indicate that we have *started* MPI_INIT* */
ompi_mpi_init_started = true;

/* Setup enough to check get/set MCA params */
/* Figure out the final MPI thread levels. If we were not
compiled for support for MPI threads, then don't allow
MPI_THREAD_MULTIPLE. Set this stuff up here early in the
process so that other components can make decisions based on
this value. */

ompi_mpi_thread_level(requested, provided);

/* Setup enough to check get/set MCA params */
if (OPAL_SUCCESS != (ret = opal_init_util(&argc, &argv))) {
error = "ompi_mpi_init: opal_init_util failed";
goto error;
}

/* If thread support was enabled, then setup OPAL to allow for them. This must be done
* early to prevent a race condition that can occur with orte_init(). */
if (*provided != MPI_THREAD_SINGLE) {
opal_set_using_threads(true);
}

/* Convince OPAL to use our naming scheme */
opal_process_name_print = _process_name_print_for_opal;
opal_compare_proc = _process_name_compare;
Expand Down Expand Up @@ -509,13 +522,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error;
}

/* Figure out the final MPI thread levels. If we were not
compiled for support for MPI threads, then don't allow
MPI_THREAD_MULTIPLE. Set this stuff up here early in the
process so that other components can make decisions based on
this value. */

ompi_mpi_thread_level(requested, provided);

/* determine the bitflag belonging to the threadlevel_support provided */
memset ( &threadlevel_bf, 0, sizeof(uint8_t));
Expand All @@ -529,13 +535,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
goto error;
}

/* If thread support was enabled, then setup OPAL to allow for
them. */
if ((OPAL_ENABLE_PROGRESS_THREADS == 1) ||
(*provided != MPI_THREAD_SINGLE)) {
opal_set_using_threads(true);
}

/* initialize datatypes. This step should be done early as it will
* create the local convertor and local arch used in the proc
* init.
Expand Down