Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pure virtual MPIComm() method in Comm #169

Closed
tom-j-h opened this issue Feb 28, 2025 · 1 comment
Closed

Pure virtual MPIComm() method in Comm #169

tom-j-h opened this issue Feb 28, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@tom-j-h
Copy link

tom-j-h commented Feb 28, 2025

Is your feature request related to a problem? Please describe.

The Atlas function atlas::mpi::comm() returns a Comm. From this, I need to get the internal MPI_Comm, to pass to the netCDF C API functions. Parallel (derived from Comm) has the method MPIComm() which will give me this, but since I've only got a Comm, I'd have to use a dynamic_cast to access this.

Describe the solution you'd like

It would be nice if MPIComm() was a pure virtual function of Comm, and it's implementation in Serial could perhaps throw an exception or return MPI_COMM_SELF (not sure what would be best here...).

Describe alternatives you've considered

dynamic_cast, as explained.

Additional context

Related to same work described in ecmwf/atlas#260 !

Organisation

Met Office

@tom-j-h tom-j-h added the enhancement New feature or request label Feb 28, 2025
@tom-j-h
Copy link
Author

tom-j-h commented Mar 6, 2025

On reflection I'm happy with the dynamic cast here

@tom-j-h tom-j-h closed this as completed Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant