@@ -51,6 +51,10 @@ module opencoarrays
51
51
integer (atomic_int_kind), allocatable :: atom[:]
52
52
end type
53
53
#endif
54
+ #ifdef EXPOSE_INIT_FINALIZE
55
+ public :: caf_init
56
+ public :: caf_finalize
57
+ #endif
54
58
55
59
! Generic interface to co_broadcast with implementations for various types, kinds, and ranks
56
60
interface co_reduce
@@ -196,6 +200,29 @@ pure function logical_operator(lhs,rhs) result(lhs_op_rhs)
196
200
! Bindings for OpenCoarrays C procedures
197
201
interface
198
202
203
+ ! C function signature from ../mpi/mpi_caf.c:
204
+ ! void
205
+ ! PREFIX (init) (int *argc, char ***argv)
206
+ #ifdef COMPILER_SUPPORTS_CAF_INTRINSICS
207
+ subroutine caf_init (argc ,argv ) bind(C,name= " _caf_extensions_init" )
208
+ #else
209
+ subroutine caf_init (argc ,argv ) bind(C,name= " _gfortran_caf_init" )
210
+ #endif
211
+ import :: c_int,c_ptr
212
+ type (c_ptr), value :: argc
213
+ type (c_ptr), value :: argv
214
+ end subroutine
215
+
216
+ ! C function signature from ../mpi/mpi_caf.c:
217
+ ! void
218
+ ! PREFIX (finalize) (void)
219
+ #ifdef COMPILER_SUPPORTS_CAF_INTRINSICS
220
+ subroutine caf_finalize () bind(C,name= " _caf_extensions_finalize" )
221
+ #else
222
+ subroutine caf_finalize () bind(C,name= " _gfortran_caf_finalize" )
223
+ #endif
224
+ end subroutine
225
+
199
226
! C function signature from ../mpi/mpi_caf.c:
200
227
! void
201
228
! PREFIX (co_min) (gfc_descriptor_t *a, int result_image, int *stat, char *errmsg,
0 commit comments