Skip to content

Commit 1f4a65b

Browse files
authored
Merge pull request #52 from rouson/delete-caf-macro
Delete CAF C preprocessor macro
2 parents 65d74e9 + ca6b07e commit 1f4a65b

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ if(SERIAL)
3535
message(STATUS "Configuring build for serial execution")
3636
else()
3737
message(STATUS "Configuring build for parallel execution")
38-
add_definitions(-DCAF)
3938
endif()
4039

4140
# compiler flags for gfortran
@@ -60,6 +59,11 @@ endif()
6059
# compiler flags for ifort
6160
if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
6261

62+
if(SERIAL)
63+
message(STATUS "Configuring to build with -coarray=single")
64+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -coarray=single")
65+
endif()
66+
6367
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -assume byterecl,realloc_lhs -heap-arrays")
6468
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C -traceback")
6569
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Once installed, use the compiler wrappers `caf` and `cafrun` to build and execut
6565
in parallel, respectively:
6666

6767
```
68-
fpm build --compiler caf --flag "-cpp -DCAF -O3 -ffast-math"
68+
fpm build --compiler caf --flag "-cpp -O3 -ffast-math"
6969
```
7070

7171
#### Testing with fpm

src/mod_layer_submodule.f90

-4
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,15 @@ module subroutine db_co_sum(db)
5959
type(array1d), allocatable, intent(in out) :: db(:)
6060
integer(ik) :: n
6161
do n = 2, size(db)
62-
#ifdef CAF
6362
call co_sum(db(n) % array)
64-
#endif
6563
end do
6664
end subroutine db_co_sum
6765

6866
module subroutine dw_co_sum(dw)
6967
type(array2d), allocatable, intent(in out) :: dw(:)
7068
integer(ik) :: n
7169
do n = 1, size(dw) - 1
72-
#ifdef CAF
7370
call co_sum(dw(n) % array)
74-
#endif
7571
end do
7672
end subroutine dw_co_sum
7773

src/mod_network_submodule.f90

-2
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,8 @@ module subroutine sync(self, image)
190190
integer(ik) :: n
191191
if (num_images() == 1) return
192192
layers: do n = 1, size(self % dims)
193-
#ifdef CAF
194193
call co_broadcast(self % layers(n) % b, image)
195194
call co_broadcast(self % layers(n) % w, image)
196-
#endif
197195
end do layers
198196
end subroutine sync
199197

0 commit comments

Comments
 (0)