@@ -51,6 +51,10 @@ module opencoarrays
5151 integer (atomic_int_kind), allocatable :: atom[:]
5252 end type
5353#endif
54+ #ifdef EXPOSE_INIT_FINALIZE
55+ public :: caf_init
56+ public :: caf_finalize
57+ #endif
5458
5559 ! Generic interface to co_broadcast with implementations for various types, kinds, and ranks
5660 interface co_reduce
@@ -196,6 +200,29 @@ pure function logical_operator(lhs,rhs) result(lhs_op_rhs)
196200 ! Bindings for OpenCoarrays C procedures
197201 interface
198202
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+
199226 ! C function signature from ../mpi/mpi_caf.c:
200227 ! void
201228 ! PREFIX (co_min) (gfc_descriptor_t *a, int result_image, int *stat, char *errmsg,
0 commit comments