Provide support for the mpi_f08 module #497
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR add the new option
--mpi-f08
toconfigure
, which bases all of Rayleigh's MPI calls on thempi_f08
module instead of thempi
module. The default (mpi
) is left untouched but the hope is that the new option helps us work around many compiler warnings and errors due to stricter type checking. In the long term we probably have switch tompi_f08
as this is what the MPI standard highly recommends and the oldmpi
module might go away at some point.Ideally we should have the CI build and test all MPI variants. I don't want to replicate all the code in the Github actions though. If anyone knows of a more elegant way of running the same code with different
configure
parameters, I'd appreciate it.Rationale for adding this:
mpi_f08
is the only standard compliant way to use MPI from Fortran. See the discussion in Section 19.1.1 of the MPI-4.1 standard.mpi
) and the F77 bindings (mpif.h
), where the compiler inferred the type of the buffer argument on the first call and issued errors when the same routine was subsequently called with a different type.mpi_f08
usesType(*)
buffers to avoid this.This also includes some other MPI cleanups:
MPI_STATUS_IGNORE
instead we make the code simpler and don't force the MPI library to fill a status variable we never use.MPI_DOUBLE_PRECISION
as the data type, even though all our buffers are declared asReal*8
. While these are the same in most situations, the latter type of declaration is nonstandard and there is no guarantee this always yields an IEEE 754binary64
(double precision) number. MPI provides theMPI_REAL8
type to have something that's compatible with theReal*8
declaration in Rayleigh. In the long run we should switch to the standard way of declaring variables using thekind
parameter.