Skip to content

Commit d13375d

Browse files
committed
Merge branch 'clang-cleanup' of github.com:sourceryinstitute/OpenCoarrays
2 parents 7ecd4d5 + 0212148 commit d13375d

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ string(REGEX REPLACE "-rc[0-9]+$"
9595
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)
9696

9797
if(DEFINED CMAKE_BUILD_TYPE AND "${CMAKE_BUILD_TYPE}" MATCHES "[Rr][Ee][Ll]")
98-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-working-directory")
99-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-working-directory")
98+
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
99+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-working-directory")
100+
endif()
101+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
102+
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
103+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-working-directory")
104+
endif()
105+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
100106
endif()
101107

102108
message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
@@ -718,8 +724,6 @@ if(opencoarrays_aware_compiler)
718724
add_caf_test(allocate_as_barrier_proc 8 allocate_as_barrier_proc)
719725
endif()
720726
if (gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
721-
message( STATUS "Allocatable components of coarray derived types only supported in GFortran >= 7 with OpenCoarrays > 1.8.4" )
722-
message( STATUS "(but full support not anticipated until OpenCoarrays 2.0 release)" )
723727
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
724728
message( AUTHOR_WARNING "Allocatable components of coarray derived type developer tests enabled, despite lack of support in GFortran < 7\n These tests should fail." )
725729
endif()

src/mpi/mpi_caf.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
21572157
else
21582158
{
21592159
dprint("allocating %zd bytes for dst_t_buff.\n", dst_size * size);
2160-
if (free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL))
2160+
if ((free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL)))
21612161
{
21622162
dst_t_buff = malloc(dst_size * size);
21632163
if (dst_t_buff == NULL)
@@ -2184,7 +2184,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
21842184
/* When replication is needed, only access the scalar on the remote. */
21852185
const size_t src_real_size = src_rank > 0 ?
21862186
(src_size * size) : src_size;
2187-
if (free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL))
2187+
if ((free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL)))
21882188
{
21892189
dst_t_buff = malloc(dst_size * size);
21902190
if (dst_t_buff == NULL)
@@ -2194,7 +2194,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
21942194

21952195
if (dst_kind != src_kind || src_rank == 0 || dest_char_array_is_longer)
21962196
{
2197-
if (free_src_t_buff = ((src_t_buff = alloca(src_size * size)) == NULL))
2197+
if ((free_src_t_buff = ((src_t_buff = alloca(src_size * size)) == NULL)))
21982198
{
21992199
src_t_buff = malloc(src_size * size);
22002200
if (src_t_buff == NULL)
@@ -6169,7 +6169,7 @@ case kind: \
61696169

61706170
cap *= GFC_DESCRIPTOR_SIZE(src);
61716171
temp_src.base.base_addr = alloca(cap);
6172-
if (free_temp_src = (temp_src.base.base_addr == NULL))
6172+
if ((free_temp_src = (temp_src.base.base_addr == NULL)))
61736173
{
61746174
temp_src.base.base_addr = malloc(cap);
61756175
if (temp_src.base.base_addr == NULL)
@@ -6772,7 +6772,8 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
67726772
/* The first descriptor is accessible by the mpi_token->memptr_win.
67736773
* Count the dims to fetch. */
67746774
for (ref_rank = 0; riter->u.a.mode[ref_rank] != CAF_ARR_REF_NONE;
6775-
++ref_rank) ;
6775+
++ref_rank)
6776+
;
67766777
dprint("Getting remote descriptor of rank %zd from win: %d, "
67776778
"sizeof() %zd\n", ref_rank, mpi_token->memptr_win,
67786779
sizeof_desc_for_rank(ref_rank));
@@ -6787,7 +6788,8 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
67876788
/* All inner descriptors go by the dynamic window.
67886789
* Count the dims to fetch. */
67896790
for (ref_rank = 0; riter->u.a.mode[ref_rank] != CAF_ARR_REF_NONE;
6790-
++ref_rank) ;
6791+
++ref_rank)
6792+
;
67916793
dprint("Getting remote descriptor of rank %zd from: %p, "
67926794
"sizeof() %zd\n", ref_rank, remote_base_memptr,
67936795
sizeof_desc_for_rank(ref_rank));

0 commit comments

Comments
 (0)