Skip to content

Commit f4f2dd2

Browse files
authored
Merge pull request #12389 from jiaxiyan/fix_warning
Fix compiler warning
2 parents 05758bb + e87a17b commit f4f2dd2

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ompi/communicator/comm_cid.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
315315
opal_process_name_t *name_array = NULL;
316316
char *tag = NULL;
317317
size_t proc_count;
318-
size_t cid_base;
318+
size_t cid_base = 0;
319+
bool cid_base_set = false;
319320
int rc, leader_rank;
320321
int ret = OMPI_SUCCESS;
321322
pmix_proc_t *procs = NULL;
@@ -385,6 +386,7 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
385386
ret = opal_pmix_convert_status(rc);
386387
goto fn_exit;
387388
}
389+
cid_base_set = true;
388390
break;
389391
}
390392
}
@@ -395,6 +397,12 @@ static int ompi_comm_ext_cid_new_block (ompi_communicator_t *newcomm, ompi_commu
395397
goto fn_exit;
396398
}
397399

400+
if (!cid_base_set) {
401+
opal_show_help("help-comm.txt", "cid-base-not-set", true);
402+
ret = OMPI_ERROR;
403+
goto fn_exit;
404+
}
405+
398406
ompi_comm_extended_cid_block_initialize (new_block, cid_base, 0, 0);
399407

400408
fn_exit:

ompi/communicator/help-comm.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,12 @@ Detected an unexpected split type in a call to MPI_Comm_split_type.
3737
[disjointness-set-again]
3838
Communicator disjointness should only be set once at initialization.
3939
Attempts to modify the state are illegal and shall be ignored.
40+
[cid-base-not-set]
41+
An internal error has occurred when creating a new communicator. This
42+
should probably never happen:
43+
44+
* cid_base is not set. Either nresults
45+
is zero or no returned info matches PMIX_GROUP_CONTEXT_ID.
46+
47+
Please contact the Open MPI developer community with this message and
48+
a small example code that reproduces the issue.

0 commit comments

Comments
 (0)