Skip to content

Allow use of default MPI Communicator with Fortran API#161

Merged
mo-mglover merged 7 commits intoMetOffice:mainfrom
andrewcoughtrie:default_comm
May 9, 2025
Merged

Allow use of default MPI Communicator with Fortran API#161
mo-mglover merged 7 commits intoMetOffice:mainfrom
andrewcoughtrie:default_comm

Conversation

@andrewcoughtrie
Copy link
Collaborator

Although Vernier will use a default MPI communicator when called from the C++ API this has not been passed through to the Fortran API. Have added the capability here.

I haven't been able to get the testing working using pFUnit, I'm not sure why, for some reason it hangs. I do know that pFUnit controls the MPI communicator and duplicates it, it does state in the source not to use MPI_COMM_WORLD outside the main pFUnit program MpiContext.F90#L65 so perhaps they are doing some thing that doesn't play well if we try to use MPI_COMM_WORLD for Vernier as well.

As it is I've created a simple system test to check the call without an argument works, we perhaps need a better mechanism for testing this at some point.

I've also done a bit of tidying up of all the test names.

@andrewcoughtrie andrewcoughtrie linked an issue Apr 22, 2025 that may be closed by this pull request
Copy link
Collaborator

@mo-mglover mo-mglover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I agree that the optional argument approach is the right way to do this.

I've made a couple of inline comments.
[Noticed a few capitalisation issues, too, but I haven't nit-picked about those!]

Also noted, just for the papertrail, that there's a number of other bits of tidying up mixed in, such as a cmake function to facilitate adding new Fortran pfunit tests and removal of trailing whitespace.

@andrewcoughtrie andrewcoughtrie requested a review from mo-mglover May 9, 2025 12:20
@mo-mglover mo-mglover merged commit 06cedf2 into MetOffice:main May 9, 2025
10 checks passed
@andrewcoughtrie andrewcoughtrie deleted the default_comm branch May 9, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need for initialisation?

2 participants