MPI: use mpi module instead of Fortran include statement#389
Conversation
apcraig
left a comment
There was a problem hiding this comment.
I have tested this on izumi and it seems to work fine. I am sort of curious about the changes in the MPI calls (MPI_Send and MPI_Abort), why they worked before, and why they work with the updated arguments. Are there multiple supported versions of the interfaces in the implementation even though that does not seem to be documented?
|
The reason why it compiled correctly before is because the old way for CICE to have MPI functionality ( So I think all along we were not correctly using these subroutines. Since they are now defined in a module, the compiler automatically generates an interface and can thus check that they are called correctly. Citing the latest MPI specification (emphasis added):
The reason it ran correctly before... that's murkier. It's kind of above my technical knowledge, but I can speculate:
|
|
Also, the |
|
@phil-blain, thanks for the clarifications/speculation. That makes sense to me. It's surprising to me that there was never a problem before. These have probably been implemented incorrectly for a decade or more! |
PR checklist
Switch to
mpiFortran module instead of FortranincludestatementP Blain.
I did checked that it compiles correctly, was not sure if full-blown tests were necessary.
This is a first step towards #363. I tried to use the
mpi_f08module but this required more extensive changes to the code, so I chose to do it incrementally by first switching to thempimodule.I had done this a while ago bu had not submitted it yet.