Skip to content

Commit 1c277e1

Browse files
authored
Merge pull request #6087 from hzhou/2207_nth_pset
init: fix error checking in MPI_Session_get_nth_pset Approved-by: Ken Raffenetti
2 parents 3a1f618 + bd246fb commit 1c277e1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/mpi/errhan/errnames.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
**finalized:MPI has already called MPI_Finalize
1111
**inittwice:Cannot call MPI_INIT or MPI_INIT_THREAD more than once
1212
**psetinvalidn:Invalid pset number
13+
**psetinvalidn %d:Invalid pset number - %d
1314
**psetinvalidname:Invalid pset name
1415
**session:Invalid MPI_Session handle
1516
**sessionnull: NULL MPI_Session

src/mpi/init/init_impl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ int MPIR_Session_get_nth_pset_impl(MPIR_Session * session_ptr, MPIR_Info * info_
194194
i++;
195195
}
196196

197-
if (i != n) {
198-
MPIR_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, goto fn_fail, "**psetinvalidn");
197+
if (!MPIR_pset_list[i]) {
198+
MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_ARG, goto fn_fail, "**psetinvalidn",
199+
"**psetinvalidn %d", n);
199200
}
200201

201202
int len = strlen(MPIR_pset_list[i]);

0 commit comments

Comments
 (0)