Skip to content

Commit 241181b

Browse files
authored
Merge pull request #11496 from boi4/fix-missing-session-null
Add MPI_SESSION_NULL to fortran
2 parents 060ec81 + 7314f4e commit 241181b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

ompi/include/mpif-values.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ sub read_value_from_file {
148148
$handles->{MPI_REQUEST_NULL} = 0;
149149
$handles->{MPI_WIN_NULL} = 0;
150150
$handles->{MPI_MESSAGE_NULL} = 0;
151+
$handles->{MPI_SESSION_NULL} = 0;
151152

152153
$handles->{MPI_BYTE} = 1;
153154
$handles->{MPI_PACKED} = 2;

ompi/mpi/fortran/mpif-h/session_finalize_f.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,11 @@ void ompi_session_finalize_f(MPI_Fint *session, MPI_Fint *ierr)
8080

8181
c_ierr = PMPI_Session_finalize(&c_session);
8282
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr);
83+
84+
/* This value comes from the MPI_SESSION_NULL value in mpif.h. Do not
85+
change without consulting mpif.h! */
86+
87+
if (MPI_SUCCESS == c_ierr) {
88+
*session = 0;
89+
}
8390
}

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-types.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ module mpi_f08_types
7474
type(MPI_Request), parameter :: MPI_REQUEST_NULL = MPI_Request(OMPI_MPI_REQUEST_NULL)
7575
type(MPI_Win), parameter :: MPI_WIN_NULL = MPI_Win(OMPI_MPI_WIN_NULL)
7676
type(MPI_File), parameter :: MPI_FILE_NULL = MPI_File(OMPI_MPI_FILE_NULL)
77+
type(MPI_Session), parameter :: MPI_SESSION_NULL = MPI_Session(OMPI_MPI_SESSION_NULL)
7778

7879
!
7980
! Pre-defined datatype bindings

0 commit comments

Comments
 (0)