Skip to content

Commit d477f14

Browse files
author
Chuck Atkins
committed
Fortran: Restore debug interface and deprecate for supported compilers
1 parent 75b52c7 commit d477f14

File tree

4 files changed

+88
-10
lines changed

4 files changed

+88
-10
lines changed

bindings/Fortran/modules/adios2_adios_init_mod.F90

+38-10
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,75 @@
77
!
88

99
module adios2_adios_init_mod
10-
1110
#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
1211
use adios2_parameters_mod
1312
implicit none
1413

1514
interface adios2_init
16-
1715
module subroutine adios2_init_serial(adios, ierr)
1816
type(adios2_adios), intent(out) :: adios
1917
integer, intent(out) :: ierr
2018
end subroutine
19+
module subroutine adios2_init_debug_serial(adios, adios2_debug_mode, ierr)
20+
type(adios2_adios), intent(out) :: adios
21+
logical, intent(in) :: adios2_debug_mode
22+
integer, intent(out) :: ierr
23+
end subroutine
2124
module subroutine adios2_init_config_serial(adios, config_file, ierr)
2225
type(adios2_adios), intent(out) :: adios
2326
character*(*), intent(in) :: config_file
2427
integer, intent(out) :: ierr
2528
end subroutine
29+
module subroutine adios2_init_config_debug_serial(adios, config_file, adios2_debug_mode, ierr)
30+
type(adios2_adios), intent(out) :: adios
31+
character*(*), intent(in) :: config_file
32+
logical, intent(in) :: adios2_debug_mode
33+
integer, intent(out) :: ierr
34+
end subroutine
2635

27-
# ifdef ADIOS2_HAVE_MPI_F
28-
36+
#ifdef ADIOS2_HAVE_MPI_F
2937
module subroutine adios2_init_mpi(adios, comm, ierr)
3038
type(adios2_adios), intent(out) :: adios
3139
integer, intent(in) :: comm
3240
integer, intent(out) :: ierr
3341
end subroutine
42+
module subroutine adios2_init_debug_mpi(adios, comm, adios2_debug_mode, ierr)
43+
type(adios2_adios), intent(out) :: adios
44+
integer, intent(in) :: comm
45+
logical, intent(in) :: adios2_debug_mode
46+
integer, intent(out) :: ierr
47+
end subroutine
3448
module subroutine adios2_init_config_mpi(adios, config_file, comm, ierr)
3549
type(adios2_adios), intent(out) :: adios
3650
character*(*), intent(in) :: config_file
3751
integer, intent(in) :: comm
3852
integer, intent(out) :: ierr
3953
end subroutine
40-
# endif
41-
54+
module subroutine adios2_init_config_debug_mpi(adios, config_file, comm, adios2_debug_mode, ierr)
55+
type(adios2_adios), intent(out) :: adios
56+
character*(*), intent(in) :: config_file
57+
integer, intent(in) :: comm
58+
logical, intent(in) :: adios2_debug_mode
59+
integer, intent(out) :: ierr
60+
end subroutine
61+
#endif
4262
end interface
43-
4463
#else
4564

4665
use adios2_adios_init_serial_mod
47-
# ifdef ADIOS2_HAVE_MPI_F
66+
67+
#ifdef ADIOS2_HAVE_MPI_F
4868
use adios2_adios_init_mpi_mod
49-
# endif
69+
#endif /*ADIOS2_HAVE_MPI_F*/
70+
#endif /*ADIOS2_HAVE_FORTRAN_SUBMODULES*/
5071

51-
#endif
72+
#if defined(__GFORTRAN__) && defined(__GNUC__) && (__GNUC__ >= 11)
73+
!GCC$ ATTRIBUTES DEPRECATED :: adios2_init_debug_serial, adios2_init_config_debug_serial
74+
#endif /*DEPRECATED*/
75+
#ifdef ADIOS2_HAVE_MPI_F
76+
#if defined(__GFORTRAN__) && defined(__GNUC__) && (__GNUC__ >= 11)
77+
!GCC$ ATTRIBUTES DEPRECATED :: adios2_init_debug_mpi, adios2_init_config_debug_mpi
78+
#endif /*DEPRECATED*/
79+
#endif /*ADIOS2_HAVE_MPI_F*/
5280

5381
end module

bindings/Fortran/modules/adios2_adios_init_mpi_smod.F90

+25
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# define ADIOS2_MODULE_PROCEDURE
1313
#endif
1414

15+
#define UNUSED_ARG(x) if (.false.) print*,loc(x)
16+
1517
#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
1618
submodule ( adios2_adios_init_mod ) adios2_adios_init_mpi_smod
1719
#else
@@ -25,7 +27,9 @@ module adios2_adios_init_mpi_mod
2527
#ifndef ADIOS2_HAVE_FORTRAN_SUBMODULES
2628
interface adios2_init
2729
module procedure adios2_init_mpi
30+
module procedure adios2_init_debug_mpi
2831
module procedure adios2_init_config_mpi
32+
module procedure adios2_init_config_debug_mpi
2933
end interface
3034
#endif
3135
external adios2_init_config_mpi_f2c
@@ -39,7 +43,17 @@ ADIOS2_MODULE_PROCEDURE subroutine adios2_init_mpi( &
3943
integer, intent(out) :: ierr
4044

4145
call adios2_init_config_mpi(adios, char(0), comm, ierr)
46+
end subroutine
47+
48+
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_debug_mpi( &
49+
adios, comm, adios2_debug_mode, ierr)
50+
type(adios2_adios), intent(out) :: adios
51+
integer, intent(in) :: comm
52+
logical, intent(in) :: adios2_debug_mode
53+
integer, intent(out) :: ierr
4254

55+
UNUSED_ARG(adios2_debug_mode)
56+
call adios2_init_mpi(adios, comm, ierr)
4357
end subroutine
4458

4559
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_mpi( &
@@ -54,7 +68,18 @@ ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_mpi( &
5468
TRIM(ADJUSTL(config_file))//char(0), &
5569
comm, ierr)
5670
if( ierr == 0 ) adios%valid = .true.
71+
end subroutine
72+
73+
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_debug_mpi( &
74+
adios, config_file, comm, adios2_debug_mode, ierr)
75+
type(adios2_adios), intent(out) :: adios
76+
character*(*), intent(in) :: config_file
77+
integer, intent(in) :: comm
78+
logical, intent(in) :: adios2_debug_mode
79+
integer, intent(out) :: ierr
5780

81+
UNUSED_ARG(adios2_debug_mode)
82+
call adios2_init_config_mpi(adios, config_file, comm, ierr)
5883
end subroutine
5984

6085
#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES

bindings/Fortran/modules/adios2_adios_init_serial_smod.F90

+21
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# define ADIOS2_MODULE_PROCEDURE
1313
#endif
1414

15+
#define UNUSED_ARG(x) if (.false.) print*,loc(x)
16+
1517
#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES
1618
submodule ( adios2_adios_init_mod ) adios2_adios_init_serial_smod
1719
#else
@@ -40,7 +42,16 @@ ADIOS2_MODULE_PROCEDURE subroutine adios2_init_serial( &
4042
integer, intent(out) :: ierr
4143

4244
call adios2_init_config_serial(adios, char(0), ierr)
45+
end subroutine
46+
47+
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_debug_serial( &
48+
adios, adios2_debug_mode, ierr)
49+
type(adios2_adios), intent(out) :: adios
50+
logical, intent(in) :: adios2_debug_mode
51+
integer, intent(out) :: ierr
4352

53+
UNUSED_ARG(adios2_debug_mode)
54+
call adios2_init_serial(adios, ierr)
4455
end subroutine
4556

4657
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_serial( &
@@ -52,7 +63,17 @@ ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_serial( &
5263

5364
call adios2_init_config_serial_f2c(adios%f2c, config_file, ierr)
5465
if( ierr == 0 ) adios%valid = .true.
66+
end subroutine
67+
68+
ADIOS2_MODULE_PROCEDURE subroutine adios2_init_config_debug_serial( &
69+
adios, config_file, adios2_debug_mode, ierr)
70+
type(adios2_adios), intent(out) :: adios
71+
character*(*), intent(in) :: config_file
72+
logical, intent(in) :: adios2_debug_mode
73+
integer, intent(out) :: ierr
5574

75+
UNUSED_ARG(adios2_debug_mode)
76+
call adios2_init_config_serial(adios, config_file, ierr)
5677
end subroutine
5778

5879
#ifdef ADIOS2_HAVE_FORTRAN_SUBMODULES

bindings/Fortran/modules/adios2_parameters_mod.f90

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
module adios2_parameters_mod
1212
implicit none
1313

14+
! DEPRECATED Debug mode
15+
logical, parameter :: adios2_debug_mode_on = .true.
16+
logical, parameter :: adios2_debug_mode_off = .false.
17+
1418
! Types
1519
integer, parameter :: adios2_type_unknown = -1
1620

0 commit comments

Comments
 (0)