48#include "fc_feature_defs.inc"
50 use,
INTRINSIC :: iso_c_binding, only: c_char, c_null_char, c_int
51#ifdef XT_INT_FC_KIND_IN_ISO_C_BINDING
52 use,
INTRINSIC :: iso_c_binding, only: xt_int_fc_kind
54 USE xt_mpi,
ONLY: xt_int_fc_mpidt, xt_mpi_fint_kind
57 INTEGER,
PUBLIC,
PARAMETER :: xt_int_kind = xt_int_fc_kind
58 INTEGER,
PUBLIC,
PARAMETER :: pi2 = 4
59 INTEGER,
PUBLIC,
PARAMETER :: pi4 = 9
60 INTEGER,
PUBLIC,
PARAMETER :: pi8 = 14
61 INTEGER,
PUBLIC,
PARAMETER :: i2 = selected_int_kind(pi2)
62 INTEGER,
PUBLIC,
PARAMETER :: i4 = selected_int_kind(pi4)
63 INTEGER,
PUBLIC,
PARAMETER :: i8 = selected_int_kind(pi8)
66 PUBLIC :: xt_slice_c_loc
67 PUBLIC ::
OPERATOR(==),
OPERATOR(/=)
69 PUBLIC :: xt_mpi_fint_kind
70 INTEGER,
PUBLIC,
PARAMETER :: xt_int_mpidt = xt_int_fc_mpidt
71 INTEGER(xt_int_kind),
PARAMETER :: dummy = 0_xt_int_kind
74 INTEGER,
PUBLIC,
PARAMETER :: xt_int_dec_len &
75 = ceiling(1.0 + real(digits(dummy)) * log10(real(radix(dummy))))
76 CHARACTER(9),
PARAMETER :: xt_stripe_tag =
'xt_stripe'
78 INTEGER,
PUBLIC,
PARAMETER :: xt_stripe2s_len &
79 = len(xt_stripe_tag) + 2 + 4 + 3 * xt_int_dec_len
81 TYPE,
BIND(C),
PUBLIC :: xt_stripe
82 INTEGER(xt_int_kind) :: start
83 INTEGER(xt_int_kind) :: stride
84 INTEGER(c_int) :: nstrides
87 TYPE,
BIND(C),
PUBLIC :: xt_bounds
88 INTEGER(xt_int_kind) :: start, size
94 TYPE,
BIND(c),
PUBLIC :: xt_pos_ext
95 INTEGER(c_int) :: start, size
100 FUNCTION xt_get_default_comm()
RESULT(comm) &
101 bind(c, name=
'xt_get_default_comm_f')
102 IMPORT :: xt_mpi_fint_kind
104 INTEGER(xt_mpi_fint_kind) :: comm
105 END FUNCTION xt_get_default_comm
107 SUBROUTINE xt_initialize(default_comm) bind(C, name='xt_initialize_f')
108 import:: xt_mpi_fint_kind
110 INTEGER(xt_mpi_fint_kind),
INTENT(in) :: default_comm
113 SUBROUTINE xt_finalize() bind(C, name='xt_finalize')
116 SUBROUTINE xt_restore_default_abort_hndl
117 END SUBROUTINE xt_restore_default_abort_hndl
122 MODULE PROCEDURE xt_abort4
123 MODULE PROCEDURE xt_abort3
124 END INTERFACE xt_abort
127 SUBROUTINE xt_abort_c(comm, msg, source, line) bind(c, name='xt_abort_f')
128 IMPORT :: c_char, xt_mpi_fint_kind
130 INTEGER(xt_mpi_fint_kind),
VALUE,
INTENT(in):: comm
131 CHARACTER(kind=c_char),
DIMENSION(*),
INTENT(in) :: msg
132 CHARACTER(kind=c_char),
DIMENSION(*),
INTENT(in) :: source
133 INTEGER(xt_mpi_fint_kind),
VALUE,
INTENT(in) :: line
134 END SUBROUTINE xt_abort_c
138 MODULE PROCEDURE xt_stripe2char
141 INTERFACE OPERATOR(==)
142 MODULE PROCEDURE xt_pos_ext_eq
143 END INTERFACE OPERATOR(==)
145 INTERFACE OPERATOR(/=)
146 MODULE PROCEDURE xt_pos_ext_ne
147 END INTERFACE OPERATOR(/=)
149 EXTERNAL :: xt_slice_c_loc
151 PUBLIC :: set_abort_handler, xt_restore_default_abort_hndl
154 ENUMERATOR :: xt_lib_pre_init, &
155 xt_lib_initialized, &
162 SUBROUTINE xt_abort4(comm, msg, source, line)
213 SUBROUTINE f(comm, msg, source, line)
219 SUBROUTINE f(comm, msg, source, line)