Skip to content

Commit a098d5d

Browse files
Upstream mnerge
2 parents 9f946a0 + 723822d commit a098d5d

File tree

5 files changed

+28
-13
lines changed

5 files changed

+28
-13
lines changed

src/common/include/parallel_macros.fpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,28 @@
2424
& copy=None, copyin=None, copyinReadOnly=None, copyout=None, create=None, &
2525
& no_create=None, present=None, deviceptr=None, attach=None, extraAccArgs=None, extraOmpArgs=None)
2626

27+
#:set acc_directive = ACC_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
28+
#:set omp_directive = OMP_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)
29+
2730
#if defined(MFC_OpenACC)
28-
#:set directive = ACC_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraAccArgs)
31+
$:acc_directive
2932
#elif defined(MFC_OpenMP)
30-
#:set directive = OMP_PARALLEL_LOOP(collapse, private, parallelism, default, firstprivate, reduction, reductionOp, copy, copyin, copyinReadOnly, copyout, create, no_create, present, deviceptr, attach, extraOmpArgs)
33+
$:omp_directive
3134
#endif
3235

33-
$:directive
34-
3536
#:enddef
3637

3738
#:def END_GPU_PARALLEL_LOOP()
3839

40+
#:set acc_end_directive = '!$acc end parallel loop'
41+
#:set omp_end_directive = END_OMP_PARALLEL_LOOP()
42+
3943
#if defined(MFC_OpenACC)
40-
#:set end_directive = '!$acc end parallel loop'
44+
$:acc_end_directive
4145
#elif defined(MFC_OpenMP)
42-
#:set end_directive = END_OMP_PARALLEL_LOOP()
46+
$:omp_end_directive
4347
#endif
4448

45-
$:end_directive
46-
4749
#:enddef
4850

4951
#:def GPU_ROUTINE(function_name=None, parallelism=None, nohost=False, cray_inline=False, extraAccArgs=None, extraOmpArgs=None)

src/common/m_chemistry.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ contains
129129
real(wp), dimension(num_species) :: Ys
130130
real(wp), dimension(num_species) :: omega
131131

132-
$:GPU_PARALLEL_LOOP(collapse=3, private='[Ys, omega, eqn, T, rho, omega_m]', copyin='[bounds]')
132+
$:GPU_PARALLEL_LOOP(collapse=3, private='[Ys, omega, eqn, T, rho, omega, omega_m]', copyin='[bounds]')
133133
do z = bounds(3)%beg, bounds(3)%end
134134
do y = bounds(2)%beg, bounds(2)%end
135135
do x = bounds(1)%beg, bounds(1)%end

src/simulation/m_bubbles_EE.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ contains
177177
integer :: dmBub_id !< Dummy variables for unified subgrid bubble subroutines
178178
real(wp) :: dmMass_v, dmMass_n, dmBeta_c, dmBeta_t, dmCson
179179

180-
$:GPU_PARALLEL_LOOP(private='[j,k,l]', collapse=3)
180+
$:GPU_PARALLEL_LOOP(private='[j,k,l,q]', collapse=3)
181181
do l = 0, p
182182
do k = 0, n
183183
do j = 0, m
@@ -333,7 +333,7 @@ contains
333333
if (adap_dt .and. adap_dt_stop_max > 0) call s_mpi_abort("Adaptive time stepping failed to converge.")
334334

335335
if (.not. adap_dt) then
336-
$:GPU_PARALLEL_LOOP(private='[i,l,q]', collapse=3)
336+
$:GPU_PARALLEL_LOOP(private='[i,k,l,q]', collapse=3)
337337
do l = 0, p
338338
do q = 0, n
339339
do i = 0, m

src/simulation/m_bubbles_EL.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ contains
617617

618618
! Radial motion model
619619
adap_dt_stop_max = 0
620-
$:GPU_PARALLEL_LOOP(private='[k,myalpha_rho,myalpha,Re,cell]', &
620+
$:GPU_PARALLEL_LOOP(private='[k,i,myalpha_rho,myalpha,Re,cell]', &
621621
& reduction='[[adap_dt_stop_max]]',reductionOp='[MAX]', &
622622
& copy='[adap_dt_stop_max]',copyin='[stage]')
623623
do k = 1, nBubs

src/simulation/m_bubbles_EL_kernels.fpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ contains
121121
smearGridz = smearGrid
122122
if (p == 0) smearGridz = 1
123123

124+
<<<<<<< HEAD
124125
$:GPU_PARALLEL_LOOP(private='[nodecoord,l,s_coord,cell,center]', copyin='[smearGrid,smearGridz]')
125126
do l = 1, nBubs
126127
nodecoord(1:3) = 0
@@ -131,6 +132,18 @@ contains
131132
if (p > 0) center(3) = lbk_pos(l, 3, 2)
132133
call s_get_cell(s_coord, cell)
133134
call s_compute_stddsv(cell, volpart, stddsv)
135+
=======
136+
$:GPU_PARALLEL_LOOP(private='[nodecoord,i,j,k,l,s_coord,cell,center]', copyin='[smearGrid,smearGridz]')
137+
do l = 1, nBubs
138+
nodecoord(1:3) = 0
139+
center(1:3) = 0._wp
140+
volpart = 4._wp/3._wp*pi*lbk_rad(l, 2)**3._wp
141+
s_coord(1:3) = lbk_s(l, 1:3, 2)
142+
center(1:2) = lbk_pos(l, 1:2, 2)
143+
if (p > 0) center(3) = lbk_pos(l, 3, 2)
144+
call s_get_cell(s_coord, cell)
145+
call s_compute_stddsv(cell, volpart, stddsv)
146+
>>>>>>> 723822d0b71c437e734f7ca0fcd386b0e3884a79
134147

135148
strength_vol = volpart
136149
strength_vel = 4._wp*pi*lbk_rad(l, 2)**2._wp*lbk_vel(l, 2)
@@ -381,7 +394,7 @@ contains
381394
!> The purpose of this procedure is to calculate the characteristic cell volume
382395
!! @param cell Computational coordinates (x, y, z)
383396
!! @param Charvol Characteristic volume
384-
elemental subroutine s_get_char_vol(cellx, celly, cellz, Charvol)
397+
subroutine s_get_char_vol(cellx, celly, cellz, Charvol)
385398
$:GPU_ROUTINE(function_name='s_get_char_vol',parallelism='[seq]', &
386399
& cray_inline=True)
387400

0 commit comments

Comments
 (0)