Fix the bug where MPI_is_thread_main returns true for all
threads when not in MPI_THREAD_MULTIPLE mode. Thanks to Lisandro Dalcin for pointing it out. This commit was SVN r29113.
Этот коммит содержится в:
родитель
d9f0505952
Коммит
2aed876be6
@ -49,11 +49,7 @@ int MPI_Is_thread_main(int *flag)
|
||||
|
||||
/* Compare this thread ID to the main thread ID */
|
||||
|
||||
#if OMPI_ENABLE_THREAD_MULTIPLE
|
||||
*flag = (int) opal_thread_self_compare(ompi_mpi_main_thread);
|
||||
#else
|
||||
*flag = 1;
|
||||
#endif
|
||||
|
||||
return MPI_SUCCESS;
|
||||
}
|
||||
|
@ -333,15 +333,14 @@ void ompi_mpi_thread_level(int requested, int *provided)
|
||||
|
||||
if (OMPI_ENABLE_THREAD_MULTIPLE == 1) {
|
||||
ompi_mpi_thread_provided = *provided = requested;
|
||||
ompi_mpi_main_thread = opal_thread_get_self();
|
||||
} else {
|
||||
if (MPI_THREAD_MULTIPLE == requested) {
|
||||
ompi_mpi_thread_provided = *provided = MPI_THREAD_SERIALIZED;
|
||||
} else {
|
||||
ompi_mpi_thread_provided = *provided = requested;
|
||||
}
|
||||
ompi_mpi_main_thread = (OPAL_ENABLE_MULTI_THREADS ? opal_thread_get_self() : NULL);
|
||||
}
|
||||
ompi_mpi_main_thread = opal_thread_get_self();
|
||||
|
||||
ompi_mpi_thread_multiple = (ompi_mpi_thread_provided ==
|
||||
MPI_THREAD_MULTIPLE);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user