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

2.7x #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Binary file removed BenchmarkD200setsHard60/src/.trot_C.f90.swp
Binary file not shown.
Binary file removed BenchmarkD200setsHard60/src/.trot_M.f90.swp
Binary file not shown.
69 changes: 39 additions & 30 deletions BenchmarkD200setsHard60/src/EHB.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
! !use openacc
use chain1
use echain1
use short1
Expand Down Expand Up @@ -37,9 +37,11 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
use ei5_mod
use energyHBa_mod
use energyHBb_mod
! use omp_lib

use omp_lib
use iso_fortran_env

IMPLICIT INTEGER(I-Z)
real(real64) :: ehbTs,ehbTe,ehbT
EHB1=0 !+1/r of Ca-SC
EHB1a=0 !+1/r for non-parallel contact of Ca-Ca
EHB1b=0 !excluded volume of SC-SC
Expand All @@ -63,22 +65,25 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
if(jj.lt.1)jj=1
kk=kkkk+1
if(kk.gt.Lch)kk=Lch
ICNT1=ICNT
SUMCNT1=SUMCNT
c^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

*****************************************************************
********** circle for movement involved window ******************
*****************************************************************
! !$acc data copy (ehb4,ehb5a,ehb5b,ehb3,ehb2,
! !$acc& ehb1c,ehb1b,ehb1a,ehb1,SUMCT1,ICNT1)
!!$OMP target teams distribute parallel do num_teams(100) nowait !!this is the correct one
! !$OMP target teams distribute
!!!!!!!!!! Correct Data Map
!!$OMP& map(to: sec,jbin,seq,x,z,y,hbz,ez,gx,gy,gz, !enter data
!!$OMP target enter data map(to: sec,jbin,seq,x,z,y,hbz,ez,gx,gy,gz)!,
!!$OMP& hbx,hby,arlp,cax,cay,egz,ex,ey,ecz,egx,egy,concut2,ebx,
!!$OMP& eby,ebz,ecx,ecy,ica,caz,apa,alm,nom,arlm,apm,acops,mv,
!!$OMP& app,alp,ala,noa,arla,apar,nop,ehb1)
!!$OMP& app,alp,ala,noa,arla,apar,nop,ehb1)
ehbTs=omp_get_wtime()
!//!$OMP target teams distribute parallel do num_teams(100) !nowait !!this is the correct one
! !$OMP target teams distribute
!!!!!!!!!! Correct Data Map
!//!$OMP& map(to: sec,jbin,seq,x,z,y,hbz,ez,gx,gy,gz, !enter data
!//!$OMP& hbx,hby,arlp,cax,cay,egz,ex,ey,ecz,egx,egy,concut2,ebx,
!//!$OMP& eby,ebz,ecx,ecy,ica,caz,apa,alm,nom,arlm,apm,acops,mv,
!///!$OMP& app,alp,ala,noa,arla,apar,nop,ehb1)
! Thus is correct !$acc parallel loop gang default (present) async(1) ! reduction(+:EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,
! !$acc& EHB5,EHB5a,EHB5b,ICNT1,SUMCT1)
! !$acc& default(present)
Expand All @@ -88,7 +93,8 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
! !$OMP map(to: ehb4,ehb5a,ehb5b,ehb3,ehb2)
! !$OMP target teams
! !$OMP parallel do
! !$OMP target teams distribute parallel do
!!$OMP target teams distribute parallel do
!!$OMP parallel do simd private(k)
DO 1002 k=jj,kk
kseq=seq(k)
if(mv(k).gt.0)then !moveable point
Expand Down Expand Up @@ -133,13 +139,15 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
*****************************************************************
********************** start i-cicle ****************************
*****************************************************************
! !$OMP target private(i,fact,axki,ayki,azki,dist,bxi,byi,bzi,
! !$OMP loop bind private(i,fact,axki,ayki,azki,dist,bxi,byi,bzi,
! !$OMP& axi,ayi,azi,idist)
! !$OMP& reduction(ICNT1,SUMCT1,EHB4,EHB1a)
!!$OMP parallel do reduction(ICNT1,SUMCT1,EHB4,EHB1a)
! !$acc& reduction(+:EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,
! !$acc& EHB5,EHB5a,EHB5b,ICNT1,SUMCT1)
! !$OMP target
! !$omp parallel do ! private(i) !reduction(+: EHB1)
!!$OMP& private(i,fact,axki,ayki,azki,dist,bxi,byi,bzi,
!!$OMP& axi,ayi,azi,idist)
!!$OMP& reduction(ICNT1,SUMCT1,EHB4,EHB1a)
do 1001 i=1,Lch
iend=max(k+1,kk)
if(i.ge.k-1.and.i.le.iend)goto 1001 !to avoid repeat
Expand Down Expand Up @@ -219,8 +227,8 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
NOP(k)=NOP(k)+ISTAT
!// !$acc atomic update
NOP(i)=NOP(i)+ISTAT
ICNT1=ICNT1+istat*idist
SUMCT1=SUMCT1+ISTAT
ICNT=ICNT+istat*idist
SUMCT=SUMCT+ISTAT
if(Gr2.gt.arlp(iseq,kseq))THEN
!// $acc atomic update
EHB2=EHB2+app(i,k) !quarsi3
Expand All @@ -239,8 +247,8 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
NOA(k)=NOA(k)+ISTAT
!// !$acc atomic update
NOA(i)=NOA(i)+ISTAT
ICNT1=ICNT1+istat*idist
SUMCT1=SUMCT1+ISTAT
ICNT=ICNT+istat*idist
SUMCT=SUMCT+ISTAT
if(Gr2.gt.arla(iseq,kseq))THEN
!// !$acc atomic update
EHB2=EHB2+apa(i,k)
Expand All @@ -257,8 +265,8 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
NOM(k)=NOM(k)+ISTAT
!// !$acc atomic update
NOM(i)=NOM(i)+ISTAT
ICNT1=ICNT1+istat*idist !distance of pairs
SUMCT1=SUMCT1+ISTAT !number of contact pairs
ICNT=ICNT+istat*idist !distance of pairs
SUMCT=SUMCT+ISTAT !number of contact pairs
if(Gr2.gt.arlm(iseq,kseq))THEN
!// !$acc atomic update
EHB2=EHB2+apm(i,k)
Expand Down Expand Up @@ -389,15 +397,17 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
! !$acc& EHB5,EHB5a,EHB5b,ICNT1,SUMCT1)
! !$omp end target teams
1001 continue !i -> [1,Lch]
!!$OMP end parallel do
! !$omp end target
! !$omp end target teams distribute parallel do
1002 continue
! !$OMP end target teams
! !$omp end target teams distribute parallel do !!this is correct
! !$OMP target exit data map(from: sec,jbin,seq,x,z,y,hbz,ez,gx,gy,gz,
! !$OMP& hbx,hby,arlp,cax,cay,egz,ex,ey,ecz,egx,egy,concut2,ebx,
! !$OMP& eby,ebz,ecx,ecy,ica,caz,apa,alm,nom,arlm,apm,acops,mv,
! !$OMP& app,alp,ala,noa,arla,apar,nop,ehb1)
!!$OMP end parallel do
!//!$omp end target teams distribute parallel do !!this is correct
ehbTe=omp_get_wtime()
!!$OMP target exit data map(from: sec,jbin,seq,x,z,y,hbz,ez,gx,gy,gz)!,
!!$OMP& hbx,hby,arlp,cax,cay,egz,ex,ey,ecz,egx,egy,concut2,ebx,
!!$OMP& eby,ebz,ecx,ecy,ica,caz,apa,alm,nom,arlm,apm,acops,mv,
!!$OMP& app,alp,ala,noa,arla,apar,nop,ehb1)
!$acc wait(1)
! !$omp end target teams
! this 1!$acc end data
Expand All @@ -407,14 +417,13 @@ FUNCTION EHB(jjjj,kkkk,ISTAT)
! !$acc update host(EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,
! !$acc& EHB5,EHB5a,EHB5b,ICNT1,SUMCT1)
if(istat.lt.0) then !Eold
b=abs(ICNT1/(0.000001+float(SUMCT1))-acorder)
b=abs(ICNT/(0.000001+float(SUMCT))-acorder)
a=abs(ICNTO/(0.000001+float(SUMCTO))-acorder)
d=abs(float(SUMCT1)-contt) !deviation of contact number on new conform
d=abs(float(SUMCT)-contt) !deviation of contact number on new conform
c=abs(float(SUMCTO)-contt) !deviation of contact number on new confor
dord=en2*(b-a)+en3*(d-c) !not included in EHB
endif
ICNT = INCT1
SUMCT = SUMCT1


EHB
$ =eh1*EHB1 !+1/r of Ca-SC
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/EHB_ompTeams.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
!use openacc
use chain1
use echain1
use short1
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/EHBgpuBckUpFeb5.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
!use openacc
use chain1
use echain1
use short1
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/EHBgpuGold.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
!use openacc
use chain1
use echain1
use short1
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/EHBgpuJan30.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
!use openacc
use chain1
use echain1
use short1
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/EHBserial.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FUNCTION EHB(jjjj,kkkk,ISTAT)
use params
use chainm
use openacc
!use openacc
use chain1
use echain1
use short1
Expand Down
53 changes: 27 additions & 26 deletions BenchmarkD200setsHard60/src/ESHORT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down Expand Up @@ -877,33 +877,34 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
ESHORT13=0
endif
*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ESHORT = es2*ESHORT2 +er1*ESHORT3 +er3*ESHORT4 +er4*ESHORT4a +es3*ESHORT5 +es3a*ESHORT5a +es3b*ESHORT5b +es3c*ESHORT5c+es4*ESHORT6+es5*ESHORT7+es6*ESHORT8+er5*ESHORT9+er6*ESHORT10+er7*ESHORT11+astick*ESHORT12+ermsd*ESHORT13+er21*ESHORT21+er22*ESHORT22+er23*ESHORT23

ESHORT=
$ +es2*ESHORT2
$ +er1*ESHORT3
$ +er3*ESHORT4
$ +er4*ESHORT4a
$ +es3*ESHORT5
$ +es3a*ESHORT5a
$ +es3b*ESHORT5b
$ +es3c*ESHORT5c
$ +es4*ESHORT6
$ +es5*ESHORT7
$ +es6*ESHORT8
$ +er5*ESHORT9
$ +er6*ESHORT10
$ +er7*ESHORT11
$ +astick*ESHORT12
$ +ermsd*ESHORT13
$ +er21*ESHORT21
$ +er22*ESHORT22
$ +er23*ESHORT23

! ESHORT=
! $ +es2*ESHORT2
! $ +er1*ESHORT3
! $ +er3*ESHORT4
! $ +er4*ESHORT4a
! $ +es3*ESHORT5
! $ +es3a*ESHORT5a
! $ +es3b*ESHORT5b
! $ +es3c*ESHORT5c
! $ +es4*ESHORT6
! $ +es5*ESHORT7
! $ +es6*ESHORT8
! $ +er5*ESHORT9
! $ +er6*ESHORT10
! $ +er7*ESHORT11
! $ +astick*ESHORT12
! $ +ermsd*ESHORT13
! $ +er21*ESHORT21
! $ +er22*ESHORT22
! $ +er23*ESHORT23
!
c $ +er17*ESHORT17


c write(*,*)iiii,jjjj,ESHORT,ESHORT21,er21
c write(*,*)eshort,eshort12,astick,itemp
!
!
!c write(*,*)iiii,jjjj,ESHORT,ESHORT21,er21
!c write(*,*)eshort,eshort12,astick,itemp

c ^^^^^^^^^^ E_short finished ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
! ! !$acc end data
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORT1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTJan20.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTNewGpuBckFeb5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTgold3s.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTgpu1loopFeb5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTmat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
2 changes: 1 addition & 1 deletion BenchmarkD200setsHard60/src/ESHORTserial.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT)
! common/shape/amx,amy,amz,afs(ndim),afsn(ndim)
c COMMON/short2/ codevsum, didevsum, csr(ndim,2)
common/three/angle(nvec,nvec)
c COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
c COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim)
common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev
common/msichores/msicho
common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11
Expand Down
Loading