@@ -401,7 +401,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
401
401
volatile bool active ;
402
402
bool background_fence = false;
403
403
pmix_info_t info [2 ];
404
- pmix_status_t codes [1 ] = { PMIX_ERR_PROC_ABORTED };
404
+ pmix_status_t codes [2 ] = { PMIX_ERR_PROC_ABORTED , PMIX_ERR_LOST_CONNECTION };
405
405
pmix_status_t rc ;
406
406
OMPI_TIMING_INIT (64 );
407
407
opal_pmix_lock_t mylock ;
@@ -576,12 +576,27 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided,
576
576
}
577
577
578
578
/* Register the default errhandler callback */
579
+ /* give it a name so we can distinguish it */
580
+ PMIX_INFO_LOAD (& info [0 ], PMIX_EVENT_HDLR_NAME , "MPI-Default" , PMIX_STRING );
581
+ OPAL_PMIX_CONSTRUCT_LOCK (& mylock );
582
+ PMIx_Register_event_handler (NULL , 0 , info , 1 , ompi_errhandler_callback , evhandler_reg_callbk , (void * )& mylock );
583
+ OPAL_PMIX_WAIT_THREAD (& mylock );
584
+ rc = mylock .status ;
585
+ OPAL_PMIX_DESTRUCT_LOCK (& mylock );
586
+ PMIX_INFO_DESTRUCT (& info [0 ]);
587
+ if (PMIX_SUCCESS != rc ) {
588
+ error = "Error handler registration" ;
589
+ ret = opal_pmix_convert_status (rc );
590
+ goto error ;
591
+ }
592
+
593
+ /* Register the ULFM errhandler callback */
579
594
/* we want to go first */
580
595
PMIX_INFO_LOAD (& info [0 ], PMIX_EVENT_HDLR_PREPEND , NULL , PMIX_BOOL );
581
596
/* give it a name so we can distinguish it */
582
- PMIX_INFO_LOAD (& info [1 ], PMIX_EVENT_HDLR_NAME , "MPI -Default" , PMIX_STRING );
597
+ PMIX_INFO_LOAD (& info [1 ], PMIX_EVENT_HDLR_NAME , "ULFM -Default" , PMIX_STRING );
583
598
OPAL_PMIX_CONSTRUCT_LOCK (& mylock );
584
- PMIx_Register_event_handler (codes , 1 , info , 2 , ompi_errhandler_callback , evhandler_reg_callbk , (void * )& mylock );
599
+ PMIx_Register_event_handler (codes , 2 , info , 2 , ompi_errhandler_callback , evhandler_reg_callbk , (void * )& mylock );
585
600
OPAL_PMIX_WAIT_THREAD (& mylock );
586
601
rc = mylock .status ;
587
602
OPAL_PMIX_DESTRUCT_LOCK (& mylock );
0 commit comments