Skip to content

Commit

Permalink
Merge pull request #6087 from hzhou/2207_nth_pset
Browse files Browse the repository at this point in the history
init: fix error checking in  MPI_Session_get_nth_pset

Approved-by: Ken Raffenetti
  • Loading branch information
hzhou committed Jul 25, 2022
2 parents 3a1f618 + bd246fb commit 1c277e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/mpi/errhan/errnames.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
**finalized:MPI has already called MPI_Finalize
**inittwice:Cannot call MPI_INIT or MPI_INIT_THREAD more than once
**psetinvalidn:Invalid pset number
**psetinvalidn %d:Invalid pset number - %d
**psetinvalidname:Invalid pset name
**session:Invalid MPI_Session handle
**sessionnull: NULL MPI_Session
Expand Down
5 changes: 3 additions & 2 deletions src/mpi/init/init_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ int MPIR_Session_get_nth_pset_impl(MPIR_Session * session_ptr, MPIR_Info * info_
i++;
}

if (i != n) {
MPIR_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, goto fn_fail, "**psetinvalidn");
if (!MPIR_pset_list[i]) {
MPIR_ERR_SETANDSTMT1(mpi_errno, MPI_ERR_ARG, goto fn_fail, "**psetinvalidn",
"**psetinvalidn %d", n);
}

int len = strlen(MPIR_pset_list[i]);
Expand Down

0 comments on commit 1c277e1

Please sign in to comment.