The greqf.f test in MPICH 5.0.1 (directory test/mpi/f77/pt2pt/) contains the line
extrastate = extrastate - 1
I think this is wrong. extrastate is conceptually a pointer (it's a void* in C, and MPI_Aint in Fortran), and the free_fn callback must not modify it.
greqf90 and greqf08 contain equivalent code which is also wrong.
The Fortran 2008 MPI standard shows this argument as
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
which implies that the callee must not modify it. Instead, MPICH captures this argument by reference and modifies it in free_fn. I think that the Fortran subroutine is a transcription of the C function, and that extrastate would usually be a pointer in both cases.
The
greqf.ftest in MPICH 5.0.1 (directorytest/mpi/f77/pt2pt/) contains the lineI think this is wrong.
extrastateis conceptually a pointer (it's avoid*in C, andMPI_Aintin Fortran), and thefree_fncallback must not modify it.greqf90andgreqf08contain equivalent code which is also wrong.The Fortran 2008 MPI standard shows this argument as
which implies that the callee must not modify it. Instead, MPICH captures this argument by reference and modifies it in
free_fn. I think that the Fortran subroutine is a transcription of the C function, and thatextrastatewould usually be a pointer in both cases.