NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 62 forks source link

FOR DISCUSSION - PR "Add support to use mpi_f08 MPI module" extended to support no mpi, mpi (mpi_f90), mpi_f08 #530

Closed climbfuji closed 4 months ago

climbfuji commented 5 months ago

FOR DISCUSSION

@grantfirl @dustinswales @gold2718 THIS PR IS MEANT TO BE FOR DISCUSSION.

This PR builds on and includes everything from #523 , but generalizes CCPP (ccpp_prebuild, but also the capgen metadata parser; not yet the capgen code generator) to handle no-mpi, mpi (classic, mpi_f90 termed here) and mpi_f08 situations.

The workaround for the difference in types of the MPI communicator (integer for mpi, MPI_Comm for mpi_f08) and the fact that standard Fortran doesn't have type aliasing like C has is to create a new, fake Fortran standard type ccpp_mpi_comm_type. The metadata parser and code generator handle the type as if it was an integer. Preprocessor directives (standardized) are needed everywhere the type is used (host model var declaration, auto-generated caps, schemes using the MPI communicator from the host model). Note: the host model doesn't have to use this as long as it only ever uses ONE type of MPI and passes the correct cmake flag to the framework/physics.

Caveats:

Thoughts?

BELOW NOT UPDATED

[ 50 character, one line summary ]

[ Description of the changes in this commit. It should be enough information for someone not following this development to understand. Lines should be wrapped at about 72 characters. ]

User interface changes?: [ No/Yes ] [ If yes, describe what changed, and steps taken to ensure backward compatibilty ]

Fixes: [Github issue #s] And brief description of each issue.

Testing: test removed: unit tests: system tests: manual testing:

dustinswales commented 5 months ago

@climbfuji This seems like a fine solution to me. The only question I have is about using include files, which isn't a huge deal to me.

climbfuji commented 4 months ago

We've determined that we don't need to support mpi (mpi_f90) and mpi_f08, so this PR isn't necessary. Therefore we can close this PR.

We are still debating whether we need to support no_mpi and mpi_f08, or whether we can simply make mpi_f08 a requirement for CCPP (framework and physics). The discussion is continued in PR #523