From 3a5d6bae3d2ff621aa6f3b1f19494f6589a8d79f Mon Sep 17 00:00:00 2001 From: Jan Streffing Date: Tue, 8 Oct 2024 15:48:03 +0200 Subject: [PATCH] Revert "update mpif.h to use mpi" This reverts commit 0e5bfdc1b402347cc1b707cfb6396142e8aba447. --- src/MOD_PARTIT.F90 | 4 ++-- src/fortran_utils.F90 | 2 +- src/gen_modules_partitioning.F90 | 3 ++- src/ifs_interface/mpp_io.F90 | 3 ++- src/io_restart.F90 | 6 ++++-- src/temp/MOD_PARTIT.F90 | 4 ++-- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/MOD_PARTIT.F90 b/src/MOD_PARTIT.F90 index 2e8330a4b..6603b8922 100644 --- a/src/MOD_PARTIT.F90 +++ b/src/MOD_PARTIT.F90 @@ -5,12 +5,12 @@ module MOD_PARTIT USE, intrinsic :: ISO_FORTRAN_ENV, only : int32 USE MOD_WRITE_BINARY_ARRAYS USE MOD_READ_BINARY_ARRAYS -USE mpi #if defined(_OPENMP) USE OMP_LIB #endif IMPLICIT NONE SAVE +include 'mpif.h' integer, parameter :: MAX_LAENDERECK=16 integer, parameter :: MAX_NEIGHBOR_PARTITIONS=32 @@ -217,4 +217,4 @@ subroutine READ_T_PARTIT(partit, unit, iostat, iomsg) read(unit, iostat=iostat, iomsg=iomsg) partit%pe_status end subroutine READ_T_PARTIT -end module MOD_PARTIT \ No newline at end of file +end module MOD_PARTIT diff --git a/src/fortran_utils.F90 b/src/fortran_utils.F90 index 86a93d226..35efdb742 100644 --- a/src/fortran_utils.F90 +++ b/src/fortran_utils.F90 @@ -1,6 +1,5 @@ ! synopsis: basic Fortran utilities, no MPI, dependencies only to INTRINSIC modules module fortran_utils - use mpi implicit none contains @@ -49,6 +48,7 @@ function mpirank_to_txt(mpicomm) result(txt) integer mype integer npes integer mpierr + include 'mpif.h' call MPI_Comm_Rank(mpicomm, mype, mpierr) call MPI_Comm_Size(mpicomm, npes, mpierr) diff --git a/src/gen_modules_partitioning.F90 b/src/gen_modules_partitioning.F90 index 2e701e427..04ecd94d3 100644 --- a/src/gen_modules_partitioning.F90 +++ b/src/gen_modules_partitioning.F90 @@ -113,7 +113,7 @@ subroutine par_ex(COMM, mype, abort) ! finalizes MPI #ifndef __oasis if (present(abort)) then if (mype==0) write(*,*) 'Run finished unexpectedly!' - call MPI_ABORT(MPI_COMM_WORLD, 1, error) + call MPI_ABORT(MPI_COMM_WORLD, 1 ) else ! TODO: this is where fesom standalone, ifsinterface etc get to !1. there no abort actually even when model calls abort, and barrier may hang @@ -580,3 +580,4 @@ subroutine status_check(partit) call par_ex(partit%MPI_COMM_FESOM, partit%mype, 1) endif end subroutine status_check + diff --git a/src/ifs_interface/mpp_io.F90 b/src/ifs_interface/mpp_io.F90 index d7838cd32..6c57995e3 100644 --- a/src/ifs_interface/mpp_io.F90 +++ b/src/ifs_interface/mpp_io.F90 @@ -6,7 +6,6 @@ !----------------------------------------------------- MODULE mpp_io - USE mpi #if defined(__MULTIO) USE iom, only : iom_enable_multio, iom_initialize, iom_init_server, iom_finalize #endif @@ -31,6 +30,7 @@ MODULE mpp_io SUBROUTINE mpp_io_init( iicomm, lio, irequired, iprovided, lmpi1 ) + INCLUDE "mpif.h" INTEGER, INTENT(INOUT) :: iicomm LOGICAL, INTENT(INOUT) :: lio INTEGER, INTENT(INOUT) :: irequired, iprovided @@ -126,6 +126,7 @@ SUBROUTINE mpp_io_init_2( iicomm ) INTEGER :: icode, ierr, icolor, iicommx, iicommm, iicommo INTEGER :: ji,inum LOGICAL :: lcompp + INCLUDE "mpif.h" ! Construct multio server communicator diff --git a/src/io_restart.F90 b/src/io_restart.F90 index fd1121278..9077e27af 100644 --- a/src/io_restart.F90 +++ b/src/io_restart.F90 @@ -12,7 +12,6 @@ MODULE io_RESTART use MOD_PARTIT use MOD_PARSUP use fortran_utils - use mpi #if defined(__recom) use recom_glovar use recom_config @@ -772,6 +771,7 @@ subroutine read_all_raw_restarts(mpicomm, mype) integer fileunit integer status integer mpierr + include 'mpif.h' if(mype == RAW_RESTART_METADATA_RANK) then ! read metadata info for the raw restart @@ -860,6 +860,7 @@ subroutine finalize_restart() ! !_______________________________________________________________________________ subroutine read_restart(path, filegroup, mpicomm, mype) + include 'mpif.h' character(len=*), intent(in) :: path type(restart_file_group), intent(inout) :: filegroup integer, intent(in) :: mpicomm @@ -1003,6 +1004,7 @@ function is_due(unit, frequency, istep) result(d) ! integer mype ! integer npes ! integer mpierr +! include 'mpif.h' ! ! call MPI_Comm_Rank(mpicomm, mype, mpierr) ! call MPI_Comm_Size(mpicomm, npes, mpierr) @@ -1010,4 +1012,4 @@ function is_due(unit, frequency, istep) result(d) ! end function !!PS --> move this function also to fortran_utils.F90 -end module \ No newline at end of file +end module diff --git a/src/temp/MOD_PARTIT.F90 b/src/temp/MOD_PARTIT.F90 index 818b46541..bd3b7dec2 100644 --- a/src/temp/MOD_PARTIT.F90 +++ b/src/temp/MOD_PARTIT.F90 @@ -5,9 +5,9 @@ module MOD_PARTIT USE, intrinsic :: ISO_FORTRAN_ENV USE MOD_WRITE_BINARY_ARRAYS USE MOD_READ_BINARY_ARRAYS -USE mpi IMPLICIT NONE SAVE +include 'mpif.h' integer, parameter :: MAX_LAENDERECK=16 integer, parameter :: MAX_NEIGHBOR_PARTITIONS=32 @@ -186,4 +186,4 @@ subroutine READ_T_PARTIT(partit, unit, iostat, iomsg) read(unit, iostat=iostat, iomsg=iomsg) partit%pe_status end subroutine READ_T_PARTIT -end module MOD_PARTIT \ No newline at end of file +end module MOD_PARTIT