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

Commit

Permalink
Removed SIMD declarations as they were incompatible with the strict f…
Browse files Browse the repository at this point in the history
…p flags anyway
  • Loading branch information
daminton committed Jun 29, 2021
1 parent 92d853c commit 658c916
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 26 deletions.
6 changes: 3 additions & 3 deletions Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ VTUNE_FLAGS = -g -O2 -vec -simd -shared-intel -qopenmp -debug inline-debug-info

IDEBUG = -O0 -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin -init=snan,arrays

STRICTREAL = -mp1 -fp-model strict -prec-div -prec-sqrt -assume protect-parens
STRICTREAL = -fp-model strict -fp-model no-except -prec-div -prec-sqrt -assume protect-parens
SIMDVEC = -simd -xhost -align all -assume contiguous_assumed_shape -vecabi=cmdtarget -prec-div -prec-sqrt -assume protect-parens
PAR = -parallel -qopenmp
HEAPARR = -heap-arrays 1048576
Expand All @@ -68,8 +68,8 @@ GPAR = -fopenmp -ftree-parallelize-loops=4
GMEM = -fsanitize=undefined -fsanitize=address -fsanitize=leak
GWARNINGS = -Wall -Warray-bounds -Wimplicit-interface -Wextra -Warray-temporaries

FFLAGS = $(IDEBUG) $(HEAPARR)
#FFLAGS = -init=snan,arrays -no-wrap-margin -fp-model strict -fp-model no-except -traceback -g $(OPTIMIZE) -O3 $(SIMDVEC) $(PAR) $(HEAPARR)
#FFLAGS = $(IDEBUG) $(HEAPARR)
FFLAGS = -init=snan,arrays -no-wrap-margin -O3 $(STRICTREAL) $(SIMDVEC) $(PAR)
FORTRAN = ifort
#AR = xiar

Expand Down
9 changes: 0 additions & 9 deletions src/driftkick/drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ module pure elemental subroutine drift_one(mu, px, py, pz, vx, vy, vz, dt, iflag
end subroutine drift_one

pure subroutine drift_dan(mu, x0, v0, dt0, iflag)
!$omp declare simd
!! author: David A. Minton
!!
!! Perform Kepler drift, solving Kepler's equation in appropriate variables
Expand Down Expand Up @@ -115,7 +114,6 @@ pure subroutine drift_dan(mu, x0, v0, dt0, iflag)
end subroutine drift_dan

pure subroutine drift_kepmd(dm, es, ec, x, s, c)
!$omp declare simd
!! author: David A. Minton
!!
!! Solve Kepler's equation in difference form for an ellipse for small input dm and eccentricity
Expand Down Expand Up @@ -154,7 +152,6 @@ pure subroutine drift_kepmd(dm, es, ec, x, s, c)
end subroutine drift_kepmd

pure subroutine drift_kepu(dt,r0,mu,alpha,u,fp,c1,c2,c3,iflag)
!$omp declare simd
!! author: David A. Minton
!!
!! Solve Kepler's equation in universal variables
Expand Down Expand Up @@ -182,7 +179,6 @@ pure subroutine drift_kepu(dt,r0,mu,alpha,u,fp,c1,c2,c3,iflag)
end subroutine drift_kepu

pure subroutine drift_kepu_fchk(dt, r0, mu, alpha, u, s, f)
!$omp declare simd
!! author: David A. Minton
!!
!! Computes the value of f, the function whose root we are trying to find in universal variables
Expand All @@ -205,7 +201,6 @@ pure subroutine drift_kepu_fchk(dt, r0, mu, alpha, u, s, f)
end subroutine drift_kepu_fchk

pure subroutine drift_kepu_guess(dt, r0, mu, alpha, u, s)
!$omp declare simd
!! author: David A. Minton
!!
!! Compute initial guess for solving Kepler's equation using universal variables
Expand Down Expand Up @@ -243,7 +238,6 @@ pure subroutine drift_kepu_guess(dt, r0, mu, alpha, u, s)
end subroutine drift_kepu_guess

pure subroutine drift_kepu_lag(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
!$omp declare simd
!! author: David A. Minton
!!
!! Solve Kepler's equation in universal variables using Laguerre's method
Expand Down Expand Up @@ -288,7 +282,6 @@ pure subroutine drift_kepu_lag(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
end subroutine drift_kepu_lag

pure subroutine drift_kepu_new(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
!$omp declare simd
!! author: David A. Minton
!!
!! Solve Kepler's equation in universal variables using Newton's method
Expand Down Expand Up @@ -330,7 +323,6 @@ pure subroutine drift_kepu_new(s, dt, r0, mu, alpha, u, fp, c1, c2, c3, iflag)
end subroutine drift_kepu_new

pure subroutine drift_kepu_p3solve(dt, r0, mu, alpha, u, s, iflag)
!$omp declare simd
!! author: David A. Minton
!!
!! Computes real root of cubic involved in setting initial guess for solving Kepler's equation in universal variables
Expand Down Expand Up @@ -374,7 +366,6 @@ pure subroutine drift_kepu_p3solve(dt, r0, mu, alpha, u, s, iflag)
end subroutine drift_kepu_p3solve

pure subroutine drift_kepu_stumpff(x, c0, c1, c2, c3)
!$omp declare simd
!! author: David A. Minton
!!
!! Compute Stumpff functions needed for Kepler drift in universal variables
Expand Down
1 change: 0 additions & 1 deletion src/driftkick/kick.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module subroutine kick_vh_body(self, dt)

associate(n => self%nbody, vh => self%vh, ah => self%ah, status => self%status)
if (n == 0) return
!!$omp simd
do i = 1, n
if (status(i) == ACTIVE) vh(:, i) = vh(:, i) + ah(:, i) * dt
end do
Expand Down
1 change: 0 additions & 1 deletion src/eucl/eucl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ module subroutine eucl_irij3_plpl(self)
real(DP) :: rji2

associate(k_eucl => self%k_eucl, xh => self%xh, irij3 => self%irij3, nk => self%num_comparisons)
!$omp simd
do k = 1, nk
i = k_eucl(1, k)
j = k_eucl(2, k)
Expand Down
1 change: 0 additions & 1 deletion src/helio/helio_drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module subroutine helio_drift_pl(self, cb, param, dt)
dtp(:) = dt
end if

!!$omp simd
call drift_one(mu(1:npl), xh(1,1:npl), xh(2,1:npl), xh(3,1:npl), &
vb(1,1:npl), vb(2,1:npl), vb(3,1:npl), &
dtp(1:npl), iflag(1:npl))
Expand Down
2 changes: 1 addition & 1 deletion src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ module subroutine io_read_frame_system(self, iu, param, form, t, ierr)
return
end if
end if
ierr = io_read_hdr(iu, t, self%pl%nbody, self%tp%nbody, param%out_form, param%out_type)
ierr = io_read_hdr(iu, t, self%pl%nbody, self%tp%nbody, param%out_form, param%out_type)
if (ierr /= 0) then
write(*, *) "Swiftest error:"
write(*, *) " Binary output file already exists or cannot be accessed"
Expand Down
1 change: 0 additions & 1 deletion src/modules/swiftest_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,6 @@ module subroutine orbel_el2xv_vec(self, cb)
end subroutine orbel_el2xv_vec

module pure subroutine orbel_scget(angle, sx, cx)
!$omp declare simd(orbel_scget)
implicit none
real(DP), intent(in) :: angle
real(DP), intent(out) :: sx, cx
Expand Down
6 changes: 0 additions & 6 deletions src/modules/swiftest_operators.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,36 @@ module swiftest_operators

interface operator(.cross.)
module pure function operator_cross_sp(A, B) result(C)
!$omp declare simd(operator_cross_sp)
implicit none
real(SP), dimension(:), intent(in) :: A, B
real(SP), dimension(3) :: C
end function operator_cross_sp

module pure function operator_cross_dp(A, B) result(C)
!$omp declare simd(operator_cross_dp)
implicit none
real(DP), dimension(:), intent(in) :: A, B
real(DP), dimension(3) :: C
end function operator_cross_dp

module pure function operator_cross_i1b(A, B) result(C)
!$omp declare simd(operator_cross_i1b)
implicit none
integer(I1B), dimension(:), intent(in) :: A, B
integer(I1B), dimension(3) :: C
end function operator_cross_i1b

module pure function operator_cross_i2b(A, B) result(C)
!$omp declare simd(operator_cross_i2b)
implicit none
integer(I2B), dimension(:), intent(in) :: A, B
integer(I2B), dimension(3) :: C
end function operator_cross_i2b

module pure function operator_cross_i4b(A, B) result(C)
!$omp declare simd(operator_cross_i4b)
implicit none
integer(I4B), dimension(:), intent(in) :: A, B
integer(I4B), dimension(3) :: C
end function operator_cross_i4b

module pure function operator_cross_i8b(A, B) result(C)
!$omp declare simd(operator_cross_i8b)
implicit none
integer(I8B), dimension(:), intent(in) :: A, B
integer(I8B), dimension(3) :: C
Expand Down
1 change: 0 additions & 1 deletion src/rmvs/rmvs_encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module function rmvs_encounter_check_tp(self, cb, pl, dt, rts) result(lencounter
r2crit(:) = (rts * rhill(:))**2
plencP(:) = 0
do j = 1, npl
!$omp simd private(xr,vr,r2,v2,vdotr,lflag)
do i = 1, ntp
if ((status(i) /= ACTIVE).or.(plencP(i) /= 0)) cycle
xr(:) = xht(:, i) - xbeg(:, j)
Expand Down
1 change: 0 additions & 1 deletion src/whm/whm_drift.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ module subroutine whm_drift_pl(self, cb, param, dt)
dtp(:) = dt
end if

!!$omp simd
call drift_one(mu(1:npl), xj(1,1:npl), xj(2,1:npl), xj(3,1:npl), &
vj(1,1:npl), vj(2,1:npl), vj(3,1:npl), &
dtp(1:npl), iflag(1:npl))
Expand Down
1 change: 0 additions & 1 deletion src/whm/whm_getacch.f90
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ pure subroutine whm_getacch_ah3_tp(cb, pl, tp, xh)
if (ntp == 0) return
do i = 1, ntp
acc(:) = 0.0_DP
!!$omp simd private(dx,rji2,irij3,fac) reduction(-:acc)
do j = 1, npl
dx(:) = xht(:, i) - xh(:, j)
rji2 = dot_product(dx(:), dx(:))
Expand Down

0 comments on commit 658c916

Please sign in to comment.