Ignore:
Timestamp:
Dec 18, 2018 12:31:28 PM (3 years ago)
Author:
knoop
Message:

OpenACC port for SPEC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/pres.f90

    r3347 r3634  
    2525! -----------------
    2626! $Id$
     27! OpenACC port for SPEC
     28!
     29! 3347 2018-10-15 14:21:08Z suehring
    2730! Bugfixes in offline nesting.
    2831! Add comment.
     
    232235
    233236    CALL cpu_log( log_point(8), 'pres', 'start' )
     237
     238!$ACC DATA COPYOUT(d, tend) &
     239!$ACC COPY(u, v, w, p) &
     240!$ACC COPYIN(rho_air, rho_air_zw, ddzu, ddzw, wall_flags_0)
     241
     242!$ACC DATA &
     243!$ACC COPYIN(bc_h(0:1)) &
     244!$ACC COPYIN(bc_h(0)%i(1:bc_h(0)%ns)) &
     245!$ACC COPYIN(bc_h(0)%j(1:bc_h(0)%ns)) &
     246!$ACC COPYIN(bc_h(0)%k(1:bc_h(0)%ns)) &
     247!$ACC COPYIN(bc_h(1)%i(1:bc_h(1)%ns)) &
     248!$ACC COPYIN(bc_h(1)%j(1:bc_h(1)%ns)) &
     249!$ACC COPYIN(bc_h(1)%k(1:bc_h(1)%ns))
    234250
    235251
     
    442458    ELSE
    443459       !$OMP PARALLEL DO SCHEDULE( STATIC ) PRIVATE (i,j,k)
     460       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     461       !$ACC PRESENT(d)
    444462       DO  i = nxl, nxr
    445463          DO  j = nys, nyn
     
    490508    !$OMP PARALLEL PRIVATE (i,j,k)
    491509    !$OMP DO SCHEDULE( STATIC )
     510    !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     511    !$ACC PRESENT(u, v, w, rho_air, rho_air_zw, ddzw, wall_flags_0) &
     512    !$ACC PRESENT(d)
    492513    DO  i = nxl, nxr
    493514       DO  j = nys, nyn
     
    513534       !$OMP PARALLEL PRIVATE (i,j,k) FIRSTPRIVATE(threadsum) REDUCTION(+:localsum)
    514535       !$OMP DO SCHEDULE( STATIC )
     536       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i,j,k) &
     537       !$ACC REDUCTION(+:threadsum) COPY(threadsum) &
     538       !$ACC PRESENT(d)
    515539       DO  i = nxl, nxr
    516540          DO  j = nys, nyn
     
    547571!--    z-direction
    548572       !$OMP PARALLEL DO PRIVATE (i,j,k)
     573       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     574       !$ACC PRESENT(d, tend)
    549575       DO  i = nxl, nxr
    550576          DO  j = nys, nyn
     
    565591!--       Upward facing
    566592          !$OMP PARALLEL DO PRIVATE( i, j, k )
     593          !$ACC PARALLEL LOOP PRIVATE(i, j, k) &
     594          !$ACC PRESENT(bc_h, tend)
    567595          DO  m = 1, bc_h(0)%ns
    568596             i = bc_h(0)%i(m)
     
    574602!--       Downward facing
    575603          !$OMP PARALLEL DO PRIVATE( i, j, k )
     604          !$ACC PARALLEL LOOP PRIVATE(i, j, k) &
     605          !$ACC PRESENT(bc_h, tend)
    576606          DO  m = 1, bc_h(1)%ns
    577607             i = bc_h(1)%i(m)
     
    621651!--       Dirichlet
    622652          !$OMP PARALLEL DO PRIVATE (i,j,k)
     653          !$ACC PARALLEL LOOP COLLAPSE(2) PRIVATE(i, j) &
     654          !$ACC PRESENT(tend)
    623655          DO  i = nxlg, nxrg
    624656             DO  j = nysg, nyng
     
    688720       !$OMP PARALLEL PRIVATE (i,j,k)
    689721       !$OMP DO
     722       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     723       !$ACC PRESENT(p, tend)
    690724       DO  i = nxl-1, nxr+1
    691725          DO  j = nys-1, nyn+1
     
    701735       !$OMP PARALLEL PRIVATE (i,j,k)
    702736       !$OMP DO
     737       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     738       !$ACC PRESENT(p, tend)
    703739       DO  i = nxl-1, nxr+1
    704740          DO  j = nys-1, nyn+1
     
    733769    !$OMP PARALLEL PRIVATE (i,j,k)
    734770    !$OMP DO
     771    !$ACC PARALLEL LOOP COLLAPSE(2) PRIVATE(i, j, k) &
     772    !$ACC PRESENT(u, v, w, tend, ddzu, wall_flags_0)
    735773    DO  i = nxl, nxr   
    736774       DO  j = nys, nyn
     
    900938#else
    901939       !$OMP DO SCHEDULE( STATIC )
     940       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     941       !$ACC PRESENT(u, v, w, rho_air, rho_air_zw, ddzw, wall_flags_0) &
     942       !$ACC PRESENT(d)
    902943       DO  i = nxl, nxr
    903944          DO  j = nys, nyn
     
    916957!--    Compute possible PE-sum of divergences for flow_statistics
    917958       !$OMP DO SCHEDULE( STATIC )
     959       !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) &
     960       !$ACC REDUCTION(+:threadsum) COPY(threadsum) &
     961       !$ACC PRESENT(d)
    918962       DO  i = nxl, nxr
    919963          DO  j = nys, nyn
     
    939983    CALL cpu_log( log_point(8), 'pres', 'stop' )
    940984
     985!$ACC END DATA
     986!$ACC END DATA
    941987
    942988 END SUBROUTINE pres
Note: See TracChangeset for help on using the changeset viewer.