Skip to content

Commit

Permalink
continue working on OpenMP
Browse files Browse the repository at this point in the history
  • Loading branch information
scalandr committed Nov 23, 2021
1 parent 813687d commit 40bdda9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions components/mpas-ocean/src/shared/mpas_ocn_ke_triskCV.F
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,22 @@ subroutine Wlsqr(domain, meshPool)
allocate(eprp(nEdgesHalo(3),3))
allocate(elen(nEdgesAll))

#ifdef MPAS_OPENACC
!$acc parallel loop gang vector &
!$acc present(nEdgesHalo, xVertex, yVertex, zVertex, verticesOnEdge, &
!$acc xEdge, yEdge, zEdge, sphere_radius, nEdgesOnEdge, &
!$acc edgesOnEdge, cellsOnEdge, nCellsAll, xCell, yCell, &
!$acc zCell, weightsOnEdge_lsqr) &
!$acc private(iEdge, tmat, matt, rmat, rinv, eprp, jEdge, norm, &
!$acc enrm, iEoE, cell1, edir, elen, xmul, ymul, zmul, &
!$acc rinv, rdet)
#else
!$omp parallel
!$omp do schedule(runtime) &
!$omp private(iEdge, tmat, matt, rmat, rinv, eprp, jEdge, norm, &
!$omp enrm, iEoE, cell1, edir, elen, xmul, ymul, zmul, &
!$omp rinv, rdet)
#endif
!- build lsqr weights for each edge in the mesh
do iEdge = 1, nEdgesHalo(3)
tmat(:,:) = 0.0_RKIND
Expand Down Expand Up @@ -267,6 +283,10 @@ subroutine Wlsqr(domain, meshPool)

end do
end do
#ifndef MPAS_OPENACC
!$omp end do
!$omp end parallel
#endif

call mpas_dmpar_field_halo_exch(domain, 'weightsOnEdge_lsqr')

Expand Down

0 comments on commit 40bdda9

Please sign in to comment.