Skip to content

Delete CAF C preprocessor macro #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if(SERIAL)
message(STATUS "Configuring build for serial execution")
else()
message(STATUS "Configuring build for parallel execution")
add_definitions(-DCAF)
endif()

# compiler flags for gfortran
Expand All @@ -60,6 +59,11 @@ endif()
# compiler flags for ifort
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)

if(SERIAL)
message(STATUS "Configuring to build with -coarray=single")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -coarray=single")
endif()

set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -assume byterecl,realloc_lhs -heap-arrays")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Once installed, use the compiler wrappers `caf` and `cafrun` to build and execut
in parallel, respectively:

```
fpm build --compiler caf --flag "-cpp -DCAF -O3 -ffast-math"
fpm build --compiler caf --flag "-cpp -O3 -ffast-math"
```

#### Testing with fpm
Expand Down
4 changes: 0 additions & 4 deletions src/mod_layer_submodule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,15 @@ module subroutine db_co_sum(db)
type(array1d), allocatable, intent(in out) :: db(:)
integer(ik) :: n
do n = 2, size(db)
#ifdef CAF
call co_sum(db(n) % array)
#endif
end do
end subroutine db_co_sum

module subroutine dw_co_sum(dw)
type(array2d), allocatable, intent(in out) :: dw(:)
integer(ik) :: n
do n = 1, size(dw) - 1
#ifdef CAF
call co_sum(dw(n) % array)
#endif
end do
end subroutine dw_co_sum

Expand Down
2 changes: 0 additions & 2 deletions src/mod_network_submodule.f90
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,8 @@ module subroutine sync(self, image)
integer(ik) :: n
if (num_images() == 1) return
layers: do n = 1, size(self % dims)
#ifdef CAF
call co_broadcast(self % layers(n) % b, image)
call co_broadcast(self % layers(n) % w, image)
#endif
end do layers
end subroutine sync

Expand Down