diff --git a/CMakeLists.txt b/CMakeLists.txt index 701f6f4e..412d245f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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") diff --git a/README.md b/README.md index e85b093f..e992deb4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/mod_layer_submodule.f90 b/src/mod_layer_submodule.f90 index 6bbfcf61..514542e0 100644 --- a/src/mod_layer_submodule.f90 +++ b/src/mod_layer_submodule.f90 @@ -59,9 +59,7 @@ 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 @@ -69,9 +67,7 @@ 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 diff --git a/src/mod_network_submodule.f90 b/src/mod_network_submodule.f90 index 2a32d376..30757661 100644 --- a/src/mod_network_submodule.f90 +++ b/src/mod_network_submodule.f90 @@ -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