Skip to content

Commit 38fdfa6

Browse files
committed
sessions: fixes to accomodate ULFM
- fix arguments to ompi_comm_set in comm_ft.c - use accessor function to acquire local cid from a comm - add back in PMIx event handler to handle PMIX_ERR_PROC_ABORTED default event handler approach doesn't work - only use the excid algorithm for communicators being created from MPI_Comm_create_from_group to avoid issues with trying to use ULFM method on communicators not using a global cid Improving interoperability of ULFM with communicators derived from sessions can be addressed by later PRs. Related to hpc#67 Note that at the time this commit was made the ulfm api tests 5, 10,11, 12 fail, but this is a subset of the failures seen with master. For master failures are observd with 5,9,10,11,12. Signed-off-by: Howard Pritchard <[email protected]>
1 parent 44fccb7 commit 38fdfa6

File tree

7 files changed

+30
-15
lines changed

7 files changed

+30
-15
lines changed

ompi/communicator/comm_cid.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,8 @@ int ompi_comm_nextcid_nb (ompi_communicator_t *newcomm, ompi_communicator_t *com
421421
{
422422
ompi_comm_cid_context_t *context;
423423
ompi_comm_request_t *request;
424-
if (mca_pml_base_supports_extended_cid() && OMPI_COMM_CID_INTER != mode &&
425-
OMPI_COMM_CID_INTRA_BRIDGE != mode && OMPI_COMM_CID_INTRA_PMIX != mode &&
426-
OMPI_COMM_CID_INTRA_FT != mode && OMPI_COMM_CID_INTER_FT != mode &&
427-
OMPI_COMM_CID_INTRA_PMIX_FT != mode) {
424+
425+
if (mca_pml_base_supports_extended_cid() && NULL == comm) {
428426
return ompi_comm_nextcid_ext_nb (newcomm, comm, bridgecomm, arg0, arg1, send_first, mode, req);
429427
}
430428

ompi/communicator/ft/comm_ft.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
169169
*/
170170
/* --------------------------------------------------------- */
171171
OPAL_OUTPUT_VERBOSE((5, ompi_ftmpi_output_handle,
172-
"%s ompi: comm_shrink: Determine ranking for new communicator",
173-
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME) ));
172+
"%s ompi: comm_shrink: Determine ranking for new communicator intra %d",
173+
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), OMPI_COMM_IS_INTRA(comm)));
174174
start = PMPI_Wtime();
175175

176176
/* Create 'alive' groups */
@@ -198,9 +198,9 @@ int ompi_comm_shrink_internal(ompi_communicator_t* comm, ompi_communicator_t** n
198198
NULL, /* remote_ranks */
199199
comm->c_keyhash, /* attrs */
200200
comm->error_handler, /* error handler */
201-
NULL, /* topo component */
202201
alive_group, /* local group */
203-
alive_rgroup /* remote group */
202+
alive_rgroup, /* remote group */
203+
0 /* flags */
204204
);
205205
if( OMPI_SUCCESS != ret ) {
206206
exit_status = ret;

ompi/communicator/ft/comm_ft_detector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ static int fd_heartbeat_request(comm_detector_t* detector) {
382382
detector->hb_observing = rank;
383383

384384
ompi_comm_heartbeat_req_t* msg = calloc(sizeof(*msg)+regsize, 1);
385-
msg->super.cid = comm->c_index;
385+
msg->super.cid = ompi_comm_get_local_cid(comm);
386386
msg->super.epoch = comm->c_epoch;
387387
msg->super.type = comm_heartbeat_request_cb_type;
388388
msg->from = comm->c_my_rank;
@@ -676,7 +676,7 @@ static int fd_heartbeat_send(comm_detector_t* detector) {
676676

677677
/* send the heartbeat with eager send */
678678
ompi_comm_heartbeat_message_t msg;
679-
msg.super.cid = comm->c_index;
679+
msg.super.cid = ompi_comm_get_local_cid(comm);
680680
msg.super.epoch = comm->c_epoch;
681681
msg.super.type = comm_heartbeat_recv_cb_type;
682682
msg.from = detector->hb_rdma_rank; /* comm->c_my_rank; except during finalize when it is equal to detector->hb_observer */

ompi/communicator/ft/comm_ft_propagator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int ompi_comm_failure_propagate(ompi_communicator_t* comm, ompi_proc_t* proc, in
7474

7575
ompi_comm_failure_propagator_message_t msg;
7676
/* Broadcast the 'failure_propagator' signal to all other processes. */
77-
msg.rbcast_msg.cid = comm->c_index;
77+
msg.rbcast_msg.cid = ompi_comm_get_local_cid(comm);
7878
msg.rbcast_msg.epoch = comm->c_epoch;
7979
msg.rbcast_msg.type = comm_failure_propagator_cb_type;
8080
msg.proc_name = proc->super.proc_name;

ompi/communicator/ft/comm_ft_reliable_bcast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static void ompi_comm_rbcast_bml_recv_cb(
182182
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), __func__, msg->cid, msg->epoch));
183183
return;
184184
}
185-
if(OPAL_UNLIKELY( msg->cid != comm->c_index )) {
185+
if(OPAL_UNLIKELY( msg->cid != ompi_comm_get_local_cid(comm))) {
186186
OPAL_OUTPUT_VERBOSE((2, ompi_ftmpi_output_handle,
187187
"%s %s: Info: received a late rbcast message with CID %3d:%d during an MPI_COMM_DUP that is trying to reuse that CID (thus increasing the epoch) - ignoring, nothing to do",
188188
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), __func__, msg->cid, msg->epoch));

ompi/communicator/ft/comm_ft_revoke.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int ompi_comm_revoke_internal(ompi_communicator_t* comm)
5858
if( ompi_comm_revoke_local(comm, NULL) ) {
5959
/* Broadcast the 'revoke' signal to all other processes. */
6060
ompi_comm_rbcast_message_t msg;
61-
msg.cid = comm->c_index;
61+
msg.cid = ompi_comm_get_local_cid(comm);
6262
msg.epoch = comm->c_epoch;
6363
msg.type = comm_revoke_cb_type;
6464
ret = ompi_comm_rbcast(comm, &msg, sizeof(msg));

ompi/instance/instance.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,28 @@ static int ompi_mpi_instance_init_common (void)
376376
ompi_rte_initialized = true;
377377

378378
/* Register the default errhandler callback */
379+
/* give it a name so we can distinguish it */
380+
PMIX_INFO_LOAD(&info[0], PMIX_EVENT_HDLR_NAME, "MPI-Default", PMIX_STRING);
381+
OPAL_PMIX_CONSTRUCT_LOCK(&mylock);
382+
PMIx_Register_event_handler(NULL, 0, info, 1, ompi_errhandler_callback, evhandler_reg_callbk, (void*)&mylock);
383+
OPAL_PMIX_WAIT_THREAD(&mylock);
384+
rc = mylock.status;
385+
OPAL_PMIX_DESTRUCT_LOCK(&mylock);
386+
PMIX_INFO_DESTRUCT(&info[0]);
387+
if (PMIX_SUCCESS != rc) {
388+
ret = opal_pmix_convert_status(rc);
389+
return ret;
390+
}
391+
392+
#if OPAL_ENABLE_FT_MPI
393+
/* Register the ULFM errhandler callback */
379394
/* we want to go first */
380395
PMIX_INFO_LOAD(&info[0], PMIX_EVENT_HDLR_PREPEND, NULL, PMIX_BOOL);
381396
/* give it a name so we can distinguish it */
382-
PMIX_INFO_LOAD(&info[1], PMIX_EVENT_HDLR_NAME, "MPI-Default", PMIX_STRING);
397+
PMIX_INFO_LOAD(&info[1], PMIX_EVENT_HDLR_NAME, "ULFM-Event-handler", PMIX_STRING);
383398
OPAL_PMIX_CONSTRUCT_LOCK(&mylock);
384-
PMIx_Register_event_handler(NULL, 0, info, 2, ompi_errhandler_callback, evhandler_reg_callbk, (void*)&mylock);
399+
pmix_status_t codes[1] = { PMIX_ERR_PROC_ABORTED };
400+
PMIx_Register_event_handler(codes, 1, info, 2, ompi_errhandler_callback, evhandler_reg_callbk, (void*)&mylock);
385401
OPAL_PMIX_WAIT_THREAD(&mylock);
386402
rc = mylock.status;
387403
OPAL_PMIX_DESTRUCT_LOCK(&mylock);
@@ -391,6 +407,7 @@ static int ompi_mpi_instance_init_common (void)
391407
ret = opal_pmix_convert_status(rc);
392408
return ret;
393409
}
410+
#endif
394411

395412
/* initialize info */
396413
if (OMPI_SUCCESS != (ret = ompi_mpiinfo_init_mpi3())) {

0 commit comments

Comments
 (0)