QUICK
QUICK copied to clipboard
Update Fortran MPI support
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 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 basicinteger
datatype totype(MPI_Status)
. - Some variables in QUICK have naming comflicts with variables in the
mpi_f08
module. For example,MPI_STATUS
insrc/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 insrc/modules/quick_mpi_module.F90
is defined astype(MPI_Status)
. Surrounding with the conditional preprocessor directiveMPIV
can work around these errors for at least this source file (and maybe other source files usingQUICK_MPI_STATUS
), but this raises the larger question of whyMPIV
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 #328 already caught one issue (in
src/modules/quick_method_module.f90
-- see src/modules/quick_method_module.f90).
OK, we can change to the mpi
module and then work on using mpi_f08
when we have more time.
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.