Skip to content

Commit

Permalink
Fortran: Fix submodule and preprocessor issues with Cray Fortran
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed Oct 19, 2020
1 parent 7263faa commit 3eb2b17
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 29 deletions.
7 changes: 6 additions & 1 deletion bindings/Fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ FortranCInterface_HEADER(FC.h MACRO_NAMESPACE "FC_")
FortranCInterface_VERIFY(CXX QUIET)

# Check whether the compiler supports Fortran submodule constructs we need.
adios2_check_fortran_submodules(ADIOS2_HAVE_FORTRAN_SUBMODULES)
if(CMAKE_Fortran_COMPILER_ID MATCHES "Cray")
# Cray submodules have naming issues so just don't use them for now
set(ADIOS2_HAVE_FORTRAN_SUBMODULES 0 CACHE INTERNAL "" FORCE)
else()
adios2_check_fortran_submodules(ADIOS2_HAVE_FORTRAN_SUBMODULES)
endif()

if(ADIOS2_USE_Fortran_flag_argument_mismatch)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
Expand Down
16 changes: 6 additions & 10 deletions bindings/Fortran/modules/adios2_adios_init_mod_mpi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
!

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
# define ADIOS2_MODULE_PROCEDURE module &
# define ADIOS2_MODULE_SUBROUTINE module subroutine
#else
# define ADIOS2_MODULE_PROCEDURE
# define ADIOS2_MODULE_SUBROUTINE subroutine
#endif

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
Expand All @@ -33,8 +33,7 @@ module adios2_adios_init_mod_mpi

contains

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_mpi(adios, comm, adios2_debug_mode, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_mpi(adios, comm, adios2_debug_mode, ierr)
type(adios2_adios), intent(out) :: adios
integer, intent(in) :: comm
logical, intent(in) :: adios2_debug_mode
Expand All @@ -44,8 +43,7 @@ subroutine adios2_init_mpi(adios, comm, adios2_debug_mode, ierr)

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_debug_mpi(adios, comm, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_debug_mpi(adios, comm, ierr)
type(adios2_adios), intent(out) :: adios
integer, intent(in) :: comm
integer, intent(out) :: ierr
Expand All @@ -54,8 +52,7 @@ subroutine adios2_init_debug_mpi(adios, comm, ierr)

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_config_mpi(adios, config_file, comm, adios2_debug_mode, &
ADIOS2_MODULE_SUBROUTINE adios2_init_config_mpi(adios, config_file, comm, adios2_debug_mode, &
ierr)
type(adios2_adios), intent(out) :: adios
character*(*), intent(in) :: config_file
Expand All @@ -73,8 +70,7 @@ subroutine adios2_init_config_mpi(adios, config_file, comm, adios2_debug_mode, &

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_config_debug_mpi(adios, config_file, comm, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_config_debug_mpi(adios, config_file, comm, ierr)
type(adios2_adios), intent(out) :: adios
character*(*), intent(in) :: config_file
integer, intent(in) :: comm
Expand Down
16 changes: 6 additions & 10 deletions bindings/Fortran/modules/adios2_adios_init_mod_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
!

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
# define ADIOS2_MODULE_PROCEDURE module &
# define ADIOS2_MODULE_SUBROUTINE module subroutine
#else
# define ADIOS2_MODULE_PROCEDURE
# define ADIOS2_MODULE_SUBROUTINE subroutine
#endif

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
Expand All @@ -33,8 +33,7 @@ module adios2_adios_init_mod_serial

contains

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_serial(adios, adios2_debug_mode, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_serial(adios, adios2_debug_mode, ierr)
type(adios2_adios), intent(out) :: adios
logical, intent(in) :: adios2_debug_mode
integer, intent(out) :: ierr
Expand All @@ -43,17 +42,15 @@ subroutine adios2_init_serial(adios, adios2_debug_mode, ierr)

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_debug_serial(adios, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_debug_serial(adios, ierr)
type(adios2_adios), intent(out) :: adios
integer, intent(out) :: ierr

call adios2_init_config_serial(adios, char(0), .true., ierr)

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_config_serial(adios, config_file, adios2_debug_mode, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_config_serial(adios, config_file, adios2_debug_mode, ierr)
type(adios2_adios), intent(out) :: adios
character*(*), intent(in) :: config_file
logical, intent(in) :: adios2_debug_mode
Expand All @@ -67,8 +64,7 @@ subroutine adios2_init_config_serial(adios, config_file, adios2_debug_mode, ierr

end subroutine

ADIOS2_MODULE_PROCEDURE
subroutine adios2_init_config_debug_serial(adios, config_file, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_init_config_debug_serial(adios, config_file, ierr)
type(adios2_adios), intent(out) :: adios
character*(*), intent(in) :: config_file
integer, intent(out) :: ierr
Expand Down
7 changes: 3 additions & 4 deletions bindings/Fortran/modules/adios2_io_open_mod_mpi.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
!

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
# define ADIOS2_MODULE_PROCEDURE module &
# define ADIOS2_MODULE_SUBROUTINE module subroutine
#else
# define ADIOS2_MODULE_PROCEDURE
# define ADIOS2_MODULE_SUBROUTINE subroutine
#endif

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
Expand All @@ -29,8 +29,7 @@ module adios2_io_open_mod_mpi

contains

ADIOS2_MODULE_PROCEDURE
subroutine adios2_open_new_comm(engine, io, name, adios2_mode, comm, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_open_new_comm(engine, io, name, adios2_mode, comm, ierr)
type(adios2_engine), intent(out) :: engine
type(adios2_io), intent(in) :: io
character*(*), intent(in) :: name
Expand Down
7 changes: 3 additions & 4 deletions bindings/Fortran/modules/adios2_io_open_mod_serial.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
!

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
# define ADIOS2_MODULE_PROCEDURE module &
# define ADIOS2_MODULE_SUBROUTINE module subroutine
#else
# define ADIOS2_MODULE_PROCEDURE
# define ADIOS2_MODULE_SUBROUTINE subroutine
#endif

#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
Expand All @@ -29,8 +29,7 @@ module adios2_io_open_mod_serial

contains

ADIOS2_MODULE_PROCEDURE
subroutine adios2_open_old_comm(engine, io, name, adios2_mode, ierr)
ADIOS2_MODULE_SUBROUTINE adios2_open_old_comm(engine, io, name, adios2_mode, ierr)
type(adios2_engine), intent(out) :: engine
type(adios2_io), intent(in) :: io
character*(*), intent(in) :: name
Expand Down

0 comments on commit 3eb2b17

Please sign in to comment.