1
1

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.
Этот коммит содержится в:
George Bosilca 2013-09-04 11:10:51 +00:00
родитель d9f0505952
Коммит 2aed876be6
2 изменённых файлов: 1 добавлений и 6 удалений

Просмотреть файл

@ -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);