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

Update Fortran MPI support #316

Open
agoetz opened this issue Feb 29, 2024 · 3 comments · Fixed by #328
Open

Update Fortran MPI support #316

agoetz opened this issue Feb 29, 2024 · 3 comments · Fixed by #328
Assignees
Labels
Code cleanup Code cleanup or refactoring

Comments

@agoetz
Copy link
Collaborator

agoetz commented Feb 29, 2024

Use of mpif.h is deprecated. Replace

implicit none
include 'mpif.h'

with

use mpi_f08
implicit none

See https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node408.htm

@agoetz agoetz added the Code cleanup Code cleanup or refactoring label Feb 29, 2024
@ohearnk
Copy link
Collaborator

ohearnk commented Mar 9, 2024

@agoetz I took a stab at this in #328. However, going from the legacy MPI Fortran include directives to using the mpi_f08 module is more involved (see the details in the next paragraph). As a first attempt, the mentioned PR instead changes to the mpi module.

As to converting to mpi_f08 usage, the following issues came up:

  • Some MPI datatypes have changed in the mpi_f08 module. For example, MPI_Status changed from a basic integer datatype to type(MPI_Status).
  • Some variables in QUICK have naming comflicts with variables in the mpi_f08 module. For example, MPI_STATUS in src/modules/quick_mpi_module.F90.
  • It appears that the CMake build system is currently compiling QUICK MPI-specific sources for non-MPI targets. I noticed this when I refactored code to address the above two points. After doing so, I run into build errors with the new QUICK_MPI_STATUS variable in src/modules/quick_mpi_module.F90 is defined as type(MPI_Status). Surrounding with the conditional preprocessor directive MPIV can work around these errors for at least this source file (and maybe other source files using QUICK_MPI_STATUS), but this raises the larger question of why MPIV is needed as a hack to work around build system issues.
  • There may be more issues lurking in MPI routine calls. The current changes in MPI Fortran modernization #328 already caught one issue (in src/modules/quick_method_module.f90 -- see src/modules/quick_method_module.f90).

@agoetz
Copy link
Collaborator Author

agoetz commented Mar 12, 2024

OK, we can change to the mpi module and then work on using mpi_f08 when we have more time.

@agoetz agoetz reopened this Mar 12, 2024
@agoetz
Copy link
Collaborator Author

agoetz commented Mar 12, 2024

I re-opened this issue as a reminder to look into transitioning to mpi_f08 after the release of QUICK-24.03 and AmberTools 24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Code cleanup or refactoring
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants