Skip to content

Commit 674fcfa

Browse files
committed
use cpp macro to exclude collectives from the build in serial mode
1 parent b89d0a5 commit 674fcfa

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib/mod_layer.f90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ subroutine db_co_sum(db)
103103
type(array1d), allocatable, intent(in out) :: db(:)
104104
integer(ik) :: n
105105
do n = 2, size(db)
106+
#ifdef CAF
106107
call co_sum(db(n) % array)
108+
#endif
107109
end do
108110
end subroutine db_co_sum
109111

@@ -112,7 +114,9 @@ subroutine dw_co_sum(dw)
112114
type(array2d), allocatable, intent(in out) :: dw(:)
113115
integer(ik) :: n
114116
do n = 1, size(dw) - 1
117+
#ifdef CAF
115118
call co_sum(dw(n) % array)
119+
#endif
116120
end do
117121
end subroutine dw_co_sum
118122

src/lib/mod_network.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ subroutine sync(self, image)
226226
integer(ik) :: n
227227
if (num_images() == 1) return
228228
layers: do n = 1, size(self % dims)
229+
#ifdef CAF
229230
call co_broadcast(self % layers(n) % b, image)
230231
call co_broadcast(self % layers(n) % w, image)
232+
#endif
231233
end do layers
232234
end subroutine sync
233235

0 commit comments

Comments
 (0)