Skip to content

Commit bb83027

Browse files
committed
Sessions: improve error checking for PMIX MEMBERSHIP
Improve error handling when querying PMIx for available process sets. Related to #12217 also related to openpmix/openpmix#3267 Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 58e54b5 commit bb83027

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

ompi/instance/instance.c

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,6 @@ static int ompi_instance_group_pmix_pset (ompi_instance_t *instance, const char
12501250
* First try finding in the local PMIx cache, if not found, try a refresh
12511251
*/
12521252
fn_try_again:
1253-
rc = PMIx_Query_info(&query, 1, &info, &ninfo);
12541253
if (PMIX_SUCCESS != (rc = PMIx_Query_info(&query, 1, &info, &ninfo)) || 0 == ninfo) {
12551254
if ((PMIX_ERR_NOT_FOUND == rc) && (false == try_again)) {
12561255
try_again = true;
@@ -1260,9 +1259,39 @@ static int ompi_instance_group_pmix_pset (ompi_instance_t *instance, const char
12601259
PMIX_INFO_CREATE(query.qualifiers, 2);
12611260
PMIX_INFO_LOAD(&query.qualifiers[0], PMIX_PSET_NAME, pset_name, PMIX_STRING);
12621261
PMIX_INFO_LOAD(&query.qualifiers[1], PMIX_QUERY_REFRESH_CACHE, &refresh, PMIX_BOOL);
1262+
query.nqual = 2;
12631263
goto fn_try_again;
12641264
}
1265-
ret = opal_pmix_convert_status(rc);
1265+
}
1266+
1267+
if (PMIX_SUCCESS != rc) {
1268+
char msg_string[1024];
1269+
switch (rc) {
1270+
case PMIX_ERR_NOT_FOUND:
1271+
ret = MPI_ERR_ARG; /* pset_name not valid */
1272+
break;
1273+
case PMIX_ERR_UNREACH:
1274+
sprintf(msg_string,"PMIx server unreachable");
1275+
opal_show_help("help-comm.txt",
1276+
"MPI function not supported",
1277+
true,
1278+
"MPI_Group_from_session_pset",
1279+
msg_string);
1280+
ret = MPI_ERR_UNSUPPORTED_OPERATION;
1281+
break;
1282+
case PMIX_ERR_NOT_SUPPORTED:
1283+
sprintf(msg_string,"PMIx server does not support PMIX_QUERY_PSET_MEMBERSHIP operation");
1284+
opal_show_help("help-comm.txt",
1285+
"MPI function not supported",
1286+
true,
1287+
"MPI_Group_from_session_pset",
1288+
msg_string);
1289+
ret = MPI_ERR_UNSUPPORTED_OPERATION;
1290+
break;
1291+
default:
1292+
ret = opal_pmix_convert_status(rc);
1293+
break;
1294+
}
12661295
ompi_instance_print_error ("PMIx_Query_info() failed", ret);
12671296
goto fn_w_query;
12681297
}

0 commit comments

Comments
 (0)