1
1

to be squashed: move wait-for-init loop to ompi_mpi_init()

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
Jeff Squyres 2018-06-06 05:35:19 -07:00
родитель 67ba8da76f
Коммит 9b9cb5fef0
2 изменённых файлов: 5 добавлений и 8 удалений

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

@ -401,8 +401,12 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
} else if (expected >= OMPI_MPI_STATE_INIT_STARTED) {
// In some cases (e.g., oshmem_shmem_init()), we may call
// ompi_mpi_init() multiple times. In such cases, just
// silently return successfully.
// silently return successfully once the initializing
// thread has completed.
if (reinit_ok) {
while (ompi_mpi_state < OMPI_MPI_STATE_INIT_COMPLETED) {
usleep(1);
}
return MPI_SUCCESS;
}

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

@ -148,13 +148,6 @@ int oshmem_shmem_init(int argc, char **argv, int requested, int *provided)
if (!oshmem_shmem_initialized) {
ret = ompi_mpi_init(argc, argv, requested, provided, true);
// It's posible that another thread is initializing MPI and
// has not completed yet. Keep checking until it is
// completed.
while (ompi_mpi_state < OMPI_MPI_STATE_INIT_COMPLETED) {
usleep(1);
}
OMPI_TIMING_NEXT("ompi_mpi_init");
if (OSHMEM_SUCCESS != ret) {