If threads are not supported but were required we will go for SERIALIZED,
otherwise whatever was required. This commit was SVN r25653.
Этот коммит содержится в:
родитель
7e223b5799
Коммит
e3a373335d
@ -386,12 +386,18 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
MPI_THREAD_MULTIPLE. Set this stuff up here early in the
|
||||
process so that other components can make decisions based on
|
||||
this value. */
|
||||
|
||||
/**
|
||||
* These values are monotonic; MPI_THREAD_SINGLE < MPI_THREAD_FUNNELED
|
||||
* < MPI_THREAD_SERIALIZED < MPI_THREAD_MULTIPLE.
|
||||
* If possible, the call will return provided = required. Failing this,
|
||||
* the call will return the least supported level such that
|
||||
* provided > required. Finally, if the user requirement cannot be
|
||||
* satisfied, then the call will return in provided the highest
|
||||
* supported level.
|
||||
*/
|
||||
ompi_mpi_thread_requested = requested;
|
||||
if (OPAL_ENABLE_MULTI_THREADS == 0) {
|
||||
ompi_mpi_thread_provided = *provided = MPI_THREAD_SINGLE;
|
||||
ompi_mpi_main_thread = NULL;
|
||||
} else if (OMPI_ENABLE_THREAD_MULTIPLE == 1) {
|
||||
|
||||
if (OMPI_ENABLE_THREAD_MULTIPLE == 1) {
|
||||
ompi_mpi_thread_provided = *provided = requested;
|
||||
ompi_mpi_main_thread = opal_thread_get_self();
|
||||
} else {
|
||||
@ -400,21 +406,20 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
|
||||
} else {
|
||||
ompi_mpi_thread_provided = *provided = requested;
|
||||
}
|
||||
ompi_mpi_main_thread = opal_thread_get_self();
|
||||
ompi_mpi_main_thread = (OPAL_ENABLE_MULTI_THREADS ? opal_thread_get_self() : NULL);
|
||||
}
|
||||
|
||||
ompi_mpi_thread_multiple = (ompi_mpi_thread_provided ==
|
||||
MPI_THREAD_MULTIPLE);
|
||||
|
||||
|
||||
/* determine the bitflag belonging to the threadlevel_support provided */
|
||||
memset ( &threadlevel_bf, 0, sizeof(uint8_t));
|
||||
OMPI_THREADLEVEL_SET_BITFLAG ( ompi_mpi_thread_provided, threadlevel_bf );
|
||||
|
||||
/* add this bitflag to the modex */
|
||||
if ( OMPI_SUCCESS != (ret = ompi_modex_send_string("MPI_THREAD_LEVEL", &threadlevel_bf, sizeof(uint8_t)))) {
|
||||
error = "ompi_mpi_init: modex send thread level";
|
||||
goto error;
|
||||
error = "ompi_mpi_init: modex send thread level";
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Once we've joined the RTE, see if any MCA parameters were
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user