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

Single precision support for MPI messages #70

Open
semi-h opened this issue Mar 5, 2024 · 3 comments
Open

Single precision support for MPI messages #70

semi-h opened this issue Mar 5, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@semi-h
Copy link
Member

semi-h commented Mar 5, 2024

There is the compile time seleciton mechanism for the precision in the code base, however the MPI modules are currently hardcoded for MPI_DOUBLE_PRECISION. We need to figure out a way to fix this so that we can run single precision simulations.

A very incomplete attemt is here (albeit the wrong place, it should be in base backend)

integer :: MPI_FP_PREC = dp

Then based on the dp parameter MPI_FP_PREC can be set and used everywhere afterwards. This probably will require converting mpi_sendrecv modules into classes, so that they can be instantiated at the backends with the MPI_FP_PREC

Thanks @JamieJQuinn for pointing out this in #67.

@pbartholomew08
Copy link
Member

This is not the correct way to do it - dp = kind(0.0d0) (or something similar) will be compiler-specific, and not necessarily aligned with the MPI library. Something equivalent to

#ifdef DOUBLE_PREC
integer, parameter :: MPI_FP_PREC = MPI_DOUBLE_PRECISION
#else
integer, parameter :: MPI_FP_PREC = MPI_REAL
#endif

is what should be used (could also do with functions, but then can't make it constant)

@pbartholomew08
Copy link
Member

it might also be worth looking into MPI_F08 - this is a better module than the default MPI one, however it isn't very well supported and tends to break tools so I haven't really used it... But it is a bit better on the type safety side of things.

@semi-h
Copy link
Member Author

semi-h commented Mar 5, 2024

Parameter is actually very simple way of implementing this, and probably most robust. I think we can go ahead with it.

@Nanoseb Nanoseb added the enhancement New feature or request label Mar 6, 2024
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

3 participants