Skip to content

Commit 3d0fa68

Browse files
committed
Merge branch 'vehre/issue-774-no-caf-aware-allocatable'
- Fixes #774 - Fixes #560
2 parents f08375f + 5166003 commit 3d0fa68

File tree

10 files changed

+2050
-675
lines changed

10 files changed

+2050
-675
lines changed

CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ endif()
233233
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 8.0.0 ) )
234234
add_definitions(-DGCC_GE_8) # Tell library to build against GFortran 8.x bindings w/ descriptor change
235235
endif()
236+
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 14.0.0 ) )
237+
add_definitions(-DGCC_GE_15) # Tell library to build against GFortran 15.x bindings
238+
endif()
236239

237240
if(gfortran_compiler)
238241
set(OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
@@ -661,7 +664,10 @@ define_property(TARGET
661664
# Add global openmpi property, because using a variable an setting in parent scope did
662665
# not work as expected, i.e., not at all, on Linux Fedora 39.
663666
#-------------------------------------------------------------------------------------
664-
define_property(GLOBAL PROPERTY openmpi BRIEF_DOCS "True when mpi is openMPI.")
667+
define_property(GLOBAL
668+
PROPERTY openmpi
669+
BRIEF_DOCS "True when mpi is openMPI."
670+
FULL_DOCS "Set internally when the mpi library to use is openmpi.")
665671

666672
#-------------------------------
667673
# Recurse into the src directory
@@ -807,6 +813,7 @@ if(opencoarrays_aware_compiler)
807813
add_caf_test(teams_coarray_sendget 5 teams_coarray_sendget)
808814
add_caf_test(sync_team 8 sync_team)
809815
add_caf_test(alloc_comp_multidim_shape 2 alloc_comp_multidim_shape)
816+
set_tests_properties(alloc_comp_multidim_shape PROPERTIES TIMEOUT 300)
810817
endif()
811818
endif()
812819

@@ -858,6 +865,7 @@ if(opencoarrays_aware_compiler)
858865

859866
# Pure sendget tests
860867
add_caf_test(strided_sendget 3 strided_sendget)
868+
add_caf_test(get_with_1d_vector_index 3 get_with_1d_vector_index)
861869
add_caf_test(get_with_vector_index 4 get_with_vector_index)
862870

863871
# Collective subroutine tests

src/application-binary-interface/libcaf.h

+44
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
3030

3131
#include <stdbool.h>
3232
#include <stddef.h> /* For size_t. */
33+
#include <stdint.h>
3334

3435
#include "libcaf-gfortran-descriptor.h"
3536
#include "libcaf-version-def.h"
@@ -261,6 +262,49 @@ void PREFIX(caf_sendget)(caf_token_t, size_t, int, gfc_descriptor_t *,
261262
gfc_descriptor_t *, caf_vector_t *, int, int, bool,
262263
int *);
263264

265+
#ifdef GCC_GE_15
266+
void PREFIX(register_accessor)(const int hash,
267+
void (*accessor)(void *, const int *, void **,
268+
int32_t *, void *, caf_token_t,
269+
const size_t, size_t *,
270+
const size_t *));
271+
272+
void PREFIX(register_accessors_finish)();
273+
274+
int PREFIX(get_remote_function_index)(const int hash);
275+
276+
void PREFIX(get_from_remote)(
277+
caf_token_t token, const gfc_descriptor_t *opt_src_desc,
278+
const size_t *opt_src_charlen, const int image_index, const size_t dst_size,
279+
void **dst_data, size_t *opt_dst_charlen, gfc_descriptor_t *opt_dst_desc,
280+
const bool may_realloc_dst, const int getter_index, void *get_data,
281+
const size_t get_data_size, int *stat, caf_team_t *team, int *team_number);
282+
283+
int32_t PREFIX(is_present_on_remote)(caf_token_t token, const int image_index,
284+
const int is_present_index, void *add_data,
285+
const size_t add_data_size);
286+
287+
void PREFIX(send_to_remote)(caf_token_t token, gfc_descriptor_t *opt_dst_desc,
288+
const size_t *opt_dst_charlen,
289+
const int image_index, const size_t src_size,
290+
const void *src_data, size_t *opt_src_charlen,
291+
const gfc_descriptor_t *opt_src_desc,
292+
const int setter_index, void *add_data,
293+
const size_t add_data_size, int *stat,
294+
caf_team_t *team, int *team_number);
295+
296+
void PREFIX(transfer_between_remotes)(
297+
caf_token_t dst_token, gfc_descriptor_t *opt_dst_desc,
298+
size_t *opt_dst_charlen, const int dst_image_index,
299+
const int dst_access_index, void *dst_add_data,
300+
const size_t dst_add_data_size, caf_token_t src_token,
301+
const gfc_descriptor_t *opt_src_desc, const size_t *opt_src_charlen,
302+
const int src_image_index, const int src_access_index, void *src_add_data,
303+
const size_t src_add_data_size, const size_t src_size,
304+
const bool scalar_transfer, int *dst_stat, int *src_stat,
305+
caf_team_t *dst_team, int *dst_team_number, caf_team_t *src_team,
306+
int *src_team_number);
307+
#endif
264308
#ifdef GCC_GE_8
265309
void PREFIX(get_by_ref)(caf_token_t, int, gfc_descriptor_t *dst,
266310
caf_reference_t *refs, int dst_kind, int src_kind,

src/runtime-libraries/mpi/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ set(HOST_NAME ${HOST_NAME} PARENT_SCOPE)
146146
execute_process(COMMAND ${MPIEXEC_EXECUTABLE} --version
147147
OUTPUT_VARIABLE mpi_version_out)
148148
if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
149+
if ( gfortran_compiler AND ( NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 14.0.0 ) )
150+
# OpenMPI uses addresses for windows instead of identical ids on all images for the same token.
151+
# Therefore we can't use it (yet; and probably never).
152+
message( FATAL_ERROR "OpenMPI is incompatible with gfortran's coarray implementation from gfortran version 15 on. Please use a different MPI implementation!")
153+
endif ()
149154
message( STATUS "OpenMPI detected")
150155
set_property(GLOBAL PROPERTY openmpi true)
151156
# Write out a host file because OMPI's mpiexec is dumb

0 commit comments

Comments
 (0)