Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable executing atm_bdy_set_scalars_work on gpus #1265

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/core_atmosphere/dynamics/mpas_atm_time_integration.F
Original file line number Diff line number Diff line change
Expand Up @@ -6913,13 +6913,20 @@ subroutine atm_bdy_set_scalars_work( scalars_driving, scalars_new, &

!---

MPAS_ACC_TIMER_START('atm_bdy_set_scalars_work [ACC_data_xfer]')
!$acc enter data copyin(scalars_new, scalars_driving)
MPAS_ACC_TIMER_STOP('atm_bdy_set_scalars_work [ACC_data_xfer]')

!$acc parallel default(present)
mgduda marked this conversation as resolved.
Show resolved Hide resolved
!$acc loop gang worker
do iCell = cellSolveStart, cellSolveEnd ! threaded over cells

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

! update the specified-zone values
!
!DIR$ IVDEP
!$acc loop vector collapse(2)
do k=1,nVertLevels
do iScalar = 1, num_scalars
scalars_new(iScalar,k,iCell) = scalars_driving(iScalar,k,iCell)
Expand All @@ -6929,6 +6936,12 @@ subroutine atm_bdy_set_scalars_work( scalars_driving, scalars_new, &
end if

end do ! updates now in temp storage
!$acc end parallel

MPAS_ACC_TIMER_START('atm_bdy_set_scalars_work [ACC_data_xfer]')
!$acc exit data copyout(scalars_new)
!$acc exit data delete(scalars_driving)
mgduda marked this conversation as resolved.
Show resolved Hide resolved
MPAS_ACC_TIMER_STOP('atm_bdy_set_scalars_work [ACC_data_xfer]')

end subroutine atm_bdy_set_scalars_work

Expand Down