Skip to content

Commit

Permalink
Merge branch 'clang-cleanup' of github.com:sourceryinstitute/OpenCoar…
Browse files Browse the repository at this point in the history
…rays
  • Loading branch information
zbeekman committed Apr 22, 2019
2 parents 7ecd4d5 + 0212148 commit d13375d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ string(REGEX REPLACE "-rc[0-9]+$"
project(opencoarrays VERSION "${OPENCOARRAYS_CMAKE_PROJECT_VERSION}" LANGUAGES C Fortran)

if(DEFINED CMAKE_BUILD_TYPE AND "${CMAKE_BUILD_TYPE}" MATCHES "[Rr][Ee][Ll]")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-working-directory")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-working-directory")
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-working-directory")
endif()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-working-directory")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdebug-prefix-map=${CMAKE_SOURCE_DIR}=.")
endif()

message( STATUS "Building OpenCoarrays version: ${full_git_describe}" )
Expand Down Expand Up @@ -718,8 +724,6 @@ if(opencoarrays_aware_compiler)
add_caf_test(allocate_as_barrier_proc 8 allocate_as_barrier_proc)
endif()
if (gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
message( STATUS "Allocatable components of coarray derived types only supported in GFortran >= 7 with OpenCoarrays > 1.8.4" )
message( STATUS "(but full support not anticipated until OpenCoarrays 2.0 release)" )
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0)
message( AUTHOR_WARNING "Allocatable components of coarray derived type developer tests enabled, despite lack of support in GFortran < 7\n These tests should fail." )
endif()
Expand Down
14 changes: 8 additions & 6 deletions src/mpi/mpi_caf.c
Original file line number Diff line number Diff line change
Expand Up @@ -2157,7 +2157,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
else
{
dprint("allocating %zd bytes for dst_t_buff.\n", dst_size * size);
if (free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL))
if ((free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL)))
{
dst_t_buff = malloc(dst_size * size);
if (dst_t_buff == NULL)
Expand All @@ -2184,7 +2184,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,
/* When replication is needed, only access the scalar on the remote. */
const size_t src_real_size = src_rank > 0 ?
(src_size * size) : src_size;
if (free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL))
if ((free_dst_t_buff = ((dst_t_buff = alloca(dst_size * size)) == NULL)))
{
dst_t_buff = malloc(dst_size * size);
if (dst_t_buff == NULL)
Expand All @@ -2194,7 +2194,7 @@ PREFIX(sendget) (caf_token_t token_s, size_t offset_s, int image_index_s,

if (dst_kind != src_kind || src_rank == 0 || dest_char_array_is_longer)
{
if (free_src_t_buff = ((src_t_buff = alloca(src_size * size)) == NULL))
if ((free_src_t_buff = ((src_t_buff = alloca(src_size * size)) == NULL)))
{
src_t_buff = malloc(src_size * size);
if (src_t_buff == NULL)
Expand Down Expand Up @@ -6169,7 +6169,7 @@ case kind: \

cap *= GFC_DESCRIPTOR_SIZE(src);
temp_src.base.base_addr = alloca(cap);
if (free_temp_src = (temp_src.base.base_addr == NULL))
if ((free_temp_src = (temp_src.base.base_addr == NULL)))
{
temp_src.base.base_addr = malloc(cap);
if (temp_src.base.base_addr == NULL)
Expand Down Expand Up @@ -6772,7 +6772,8 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
/* The first descriptor is accessible by the mpi_token->memptr_win.
* Count the dims to fetch. */
for (ref_rank = 0; riter->u.a.mode[ref_rank] != CAF_ARR_REF_NONE;
++ref_rank) ;
++ref_rank)
;
dprint("Getting remote descriptor of rank %zd from win: %d, "
"sizeof() %zd\n", ref_rank, mpi_token->memptr_win,
sizeof_desc_for_rank(ref_rank));
Expand All @@ -6787,7 +6788,8 @@ PREFIX(is_present) (caf_token_t token, int image_index, caf_reference_t *refs)
/* All inner descriptors go by the dynamic window.
* Count the dims to fetch. */
for (ref_rank = 0; riter->u.a.mode[ref_rank] != CAF_ARR_REF_NONE;
++ref_rank) ;
++ref_rank)
;
dprint("Getting remote descriptor of rank %zd from: %p, "
"sizeof() %zd\n", ref_rank, remote_base_memptr,
sizeof_desc_for_rank(ref_rank));
Expand Down

0 comments on commit d13375d

Please sign in to comment.