@@ -280,6 +280,7 @@ opal_list_t ompi_registered_datareps = {{0}};
280280
281281bool ompi_enable_timing = false, ompi_enable_timing_ext = false;
282282extern bool ompi_mpi_yield_when_idle ;
283+ extern bool ompi_mpi_lazy_wait_in_init ;
283284extern int ompi_mpi_event_tick_rate ;
284285
285286/**
@@ -532,7 +533,12 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
532533 opal_pmix .register_evhandler (NULL , & info , ompi_errhandler_callback ,
533534 ompi_errhandler_registration_callback ,
534535 (void * )& errtrk );
535- OMPI_WAIT_FOR_COMPLETION (errtrk .active );
536+ if ( ompi_mpi_lazy_wait_in_init ){
537+ OMPI_LAZY_WAIT_FOR_COMPLETION (errtrk .active );
538+ } else {
539+ OMPI_WAIT_FOR_COMPLETION (errtrk .active );
540+ }
541+
536542 OPAL_LIST_DESTRUCT (& info );
537543 if (OPAL_SUCCESS != errtrk .status ) {
538544 error = "Error handler registration" ;
@@ -658,7 +664,11 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
658664 if (NULL != opal_pmix .fence_nb ) {
659665 opal_pmix .fence_nb (NULL , opal_pmix_collect_all_data ,
660666 fence_release , (void * )& active );
661- OMPI_WAIT_FOR_COMPLETION (active );
667+ if ( ompi_mpi_lazy_wait_in_init ){
668+ OMPI_LAZY_WAIT_FOR_COMPLETION (active );
669+ } else {
670+ OMPI_WAIT_FOR_COMPLETION (active );
671+ }
662672 } else {
663673 opal_pmix .fence (NULL , opal_pmix_collect_all_data );
664674 }
@@ -835,7 +845,11 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided)
835845 if (NULL != opal_pmix .fence_nb ) {
836846 opal_pmix .fence_nb (NULL , opal_pmix_collect_all_data ,
837847 fence_release , (void * )& active );
838- OMPI_WAIT_FOR_COMPLETION (active );
848+ if ( ompi_mpi_lazy_wait_in_init ){
849+ OMPI_LAZY_WAIT_FOR_COMPLETION (active );
850+ } else {
851+ OMPI_WAIT_FOR_COMPLETION (active );
852+ }
839853 } else {
840854 opal_pmix .fence (NULL , opal_pmix_collect_all_data );
841855 }
0 commit comments