Skip to content

Commit bb22eb6

Browse files
committed
Merge branch 'atmosphere/acc_atm_bdy_set_scalars_work' into develop (PR #1265)
This merge enables execution of the atm_bdy_set_scalars_work subroutine on GPUs through the addition of OpenACC directives. * atmosphere/acc_atm_bdy_set_scalars_work: Add OpenACC directives to enable executing atm_bdy_set_scalars_work on GPUs.
2 parents 03f6c1e + f3006fa commit bb22eb6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/core_atmosphere/dynamics/mpas_atm_time_integration.F

+13
Original file line numberDiff line numberDiff line change
@@ -7099,13 +7099,20 @@ subroutine atm_bdy_set_scalars_work( scalars_driving, scalars_new, &
70997099

71007100
!---
71017101

7102+
MPAS_ACC_TIMER_START('atm_bdy_set_scalars_work [ACC_data_xfer]')
7103+
!$acc enter data copyin(scalars_new, scalars_driving)
7104+
MPAS_ACC_TIMER_STOP('atm_bdy_set_scalars_work [ACC_data_xfer]')
7105+
7106+
!$acc parallel default(present)
7107+
!$acc loop gang worker
71027108
do iCell = cellSolveStart, cellSolveEnd ! threaded over cells
71037109

71047110
if ( bdyMaskCell(iCell) > nRelaxZone) then ! specified zone
71057111

71067112
! update the specified-zone values
71077113
!
71087114
!DIR$ IVDEP
7115+
!$acc loop vector collapse(2)
71097116
do k=1,nVertLevels
71107117
do iScalar = 1, num_scalars
71117118
scalars_new(iScalar,k,iCell) = scalars_driving(iScalar,k,iCell)
@@ -7115,6 +7122,12 @@ subroutine atm_bdy_set_scalars_work( scalars_driving, scalars_new, &
71157122
end if
71167123

71177124
end do ! updates now in temp storage
7125+
!$acc end parallel
7126+
7127+
MPAS_ACC_TIMER_START('atm_bdy_set_scalars_work [ACC_data_xfer]')
7128+
!$acc exit data copyout(scalars_new)
7129+
!$acc exit data delete(scalars_driving)
7130+
MPAS_ACC_TIMER_STOP('atm_bdy_set_scalars_work [ACC_data_xfer]')
71187131

71197132
end subroutine atm_bdy_set_scalars_work
71207133

0 commit comments

Comments
 (0)