Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Changes to OpenMP directives
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 12, 2021
1 parent da07db9 commit 145d5e5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/kick/kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ module subroutine kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, Gmass, rad
if (present(radius)) then
!$omp parallel do default(private) schedule(static)&
!$omp shared(nplpl, k_plpl, x, Gmass, radius) &
!$omp lastprivate(rji2, rlim2, xr, yr, zr) &
!$omp lastprivate(i, j, rji2, rlim2, xr, yr, zr) &
!$omp reduction(+:ahi) &
!$omp reduction(-:ahj)
do k = 1_I8B, nplpl
Expand All @@ -124,7 +124,7 @@ module subroutine kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, Gmass, rad
else
!$omp parallel do default(private) schedule(static)&
!$omp shared(nplpl, k_plpl, x, Gmass, radius) &
!$omp lastprivate(rji2, xr, yr, zr) &
!$omp lastprivate(i, j, rji2, xr, yr, zr) &
!$omp reduction(+:ahi) &
!$omp reduction(-:ahj)
do k = 1_I8B, nplpl
Expand All @@ -137,12 +137,10 @@ module subroutine kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, Gmass, rad
call kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), &
ahi(1,i), ahi(2,i), ahi(3,i), ahj(1,j), ahj(2,j), ahj(3,j))
end do
!$omp end parallel do
!$omp end parallel do
end if

do concurrent(i = 1:npl)
acc(:,i) = acc(:,i) + ahi(:,i) + ahj(:,i)
end do
acc(:,:) = acc(:,:) + ahi(:,:) + ahj(:,:)

return
end subroutine kick_getacch_int_all_flat_pl
Expand Down

0 comments on commit 145d5e5

Please sign in to comment.