diff --git a/BenchmarkD200setsHard60/src/.trot_C.f90.swp b/BenchmarkD200setsHard60/src/.trot_C.f90.swp deleted file mode 100644 index 37dfcb0..0000000 Binary files a/BenchmarkD200setsHard60/src/.trot_C.f90.swp and /dev/null differ diff --git a/BenchmarkD200setsHard60/src/.trot_M.f90.swp b/BenchmarkD200setsHard60/src/.trot_M.f90.swp deleted file mode 100644 index 1b6ef0d..0000000 Binary files a/BenchmarkD200setsHard60/src/.trot_M.f90.swp and /dev/null differ diff --git a/BenchmarkD200setsHard60/src/EHB.f90 b/BenchmarkD200setsHard60/src/EHB.f90 index abbd5fe..105ea46 100644 --- a/BenchmarkD200setsHard60/src/EHB.f90 +++ b/BenchmarkD200setsHard60/src/EHB.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc +! !use openacc use chain1 use echain1 use short1 @@ -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 @@ -63,8 +65,6 @@ 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^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ***************************************************************** @@ -72,13 +72,18 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) ***************************************************************** ! !$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) @@ -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 @@ -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 @@ -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 @@ -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) @@ -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) @@ -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 @@ -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 diff --git a/BenchmarkD200setsHard60/src/EHB_ompTeams.f90 b/BenchmarkD200setsHard60/src/EHB_ompTeams.f90 index 927c151..161eed8 100644 --- a/BenchmarkD200setsHard60/src/EHB_ompTeams.f90 +++ b/BenchmarkD200setsHard60/src/EHB_ompTeams.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 diff --git a/BenchmarkD200setsHard60/src/EHBgpuBckUpFeb5.f90 b/BenchmarkD200setsHard60/src/EHBgpuBckUpFeb5.f90 index c2d49cd..0b68d8b 100644 --- a/BenchmarkD200setsHard60/src/EHBgpuBckUpFeb5.f90 +++ b/BenchmarkD200setsHard60/src/EHBgpuBckUpFeb5.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 diff --git a/BenchmarkD200setsHard60/src/EHBgpuGold.f90 b/BenchmarkD200setsHard60/src/EHBgpuGold.f90 index 9ca0975..850433a 100644 --- a/BenchmarkD200setsHard60/src/EHBgpuGold.f90 +++ b/BenchmarkD200setsHard60/src/EHBgpuGold.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 diff --git a/BenchmarkD200setsHard60/src/EHBgpuJan30.f90 b/BenchmarkD200setsHard60/src/EHBgpuJan30.f90 index c2d49cd..0b68d8b 100644 --- a/BenchmarkD200setsHard60/src/EHBgpuJan30.f90 +++ b/BenchmarkD200setsHard60/src/EHBgpuJan30.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 diff --git a/BenchmarkD200setsHard60/src/EHBserial.f90 b/BenchmarkD200setsHard60/src/EHBserial.f90 index 2090d40..33a34f6 100644 --- a/BenchmarkD200setsHard60/src/EHBserial.f90 +++ b/BenchmarkD200setsHard60/src/EHBserial.f90 @@ -1,7 +1,7 @@ FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 diff --git a/BenchmarkD200setsHard60/src/ESHORT.f90 b/BenchmarkD200setsHard60/src/ESHORT.f90 index 91b341e..3ddb623 100644 --- a/BenchmarkD200setsHard60/src/ESHORT.f90 +++ b/BenchmarkD200setsHard60/src/ESHORT.f90 @@ -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 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORT1.f90 b/BenchmarkD200setsHard60/src/ESHORT1.f90 index 99021df..3dd250e 100644 --- a/BenchmarkD200setsHard60/src/ESHORT1.f90 +++ b/BenchmarkD200setsHard60/src/ESHORT1.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTJan20.f90 b/BenchmarkD200setsHard60/src/ESHORTJan20.f90 index 36c7770..0439762 100644 --- a/BenchmarkD200setsHard60/src/ESHORTJan20.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTJan20.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTNewGpuBckFeb5.f90 b/BenchmarkD200setsHard60/src/ESHORTNewGpuBckFeb5.f90 index f4f8657..31c60d6 100644 --- a/BenchmarkD200setsHard60/src/ESHORTNewGpuBckFeb5.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTNewGpuBckFeb5.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTgold3s.f90 b/BenchmarkD200setsHard60/src/ESHORTgold3s.f90 index e034003..b64c341 100644 --- a/BenchmarkD200setsHard60/src/ESHORTgold3s.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTgold3s.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTgpu1loopFeb5.f90 b/BenchmarkD200setsHard60/src/ESHORTgpu1loopFeb5.f90 index dc488d2..9eeb1f3 100644 --- a/BenchmarkD200setsHard60/src/ESHORTgpu1loopFeb5.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTgpu1loopFeb5.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTmat.f90 b/BenchmarkD200setsHard60/src/ESHORTmat.f90 index 3f32b9a..6d62a03 100644 --- a/BenchmarkD200setsHard60/src/ESHORTmat.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTmat.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/ESHORTserial.f90 b/BenchmarkD200setsHard60/src/ESHORTserial.f90 index 91b341e..6b8431c 100644 --- a/BenchmarkD200setsHard60/src/ESHORTserial.f90 +++ b/BenchmarkD200setsHard60/src/ESHORTserial.f90 @@ -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 diff --git a/BenchmarkD200setsHard60/src/GpuItasser.f90 b/BenchmarkD200setsHard60/src/GpuItasser.f90 index db03740..eb47ea6 100644 --- a/BenchmarkD200setsHard60/src/GpuItasser.f90 +++ b/BenchmarkD200setsHard60/src/GpuItasser.f90 @@ -671,7 +671,7 @@ program TASSER ! common/fr/frga(ndim),frgb(ndim) ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! COMMON/short2/ codevsum, didevsum, csr(ndim,2) ! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c ! common/sg/gx(nvec,nvec,0:19),gy(nvec,nvec,0:19),gz(nvec,nvec,0:19) @@ -1254,7 +1254,7 @@ subroutine set_common character*80 line common/movename/mname(100) common/frozen/L_cut,d_xyz0,d_xyz00(ndim),angle0,angle00(ndim) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) common/zscore/izscore @@ -2165,7 +2165,7 @@ subroutine read_distantrestrain ! parameter(ndim=1500) ! parameter(nvec=416) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/lengths/Lch,Lch1,Lch2 common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev ! common/distres/er4,es3c @@ -2691,7 +2691,7 @@ subroutine reset_temperature ! common/lengths/Lch,Lch1,Lch2 common/resnumber/Ncom,Ndis,accur common/commonuse2/atemp1,atemp2,N_rep,phot - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) real r_dis,r_con,r_dev,T10,T20,T1a,T2a @@ -3839,7 +3839,7 @@ subroutine template_initial ! common/seqe/seq(ndim),sec(ndim) common/looks/exc,exc1,exc2 - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) @@ -5721,7 +5721,7 @@ subroutine write_parameter ! common/lengths/Lch,Lch1,Lch2 ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/order/acorder,en2,sumct,sumcto,icnt,icnto,dord,en3 ! common/distres/er4,es3c common/resnumber/Ncom,Ndis,accur @@ -6230,7 +6230,7 @@ FUNCTION LOOK(jj,kk) FUNCTION EHB(jjjj,kkkk,ISTAT) use params use chainm - use openacc + !use openacc use chain1 use echain1 use short1 @@ -6677,7 +6677,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 @@ -7547,7 +7547,7 @@ FUNCTION ESHORT(iiii,jjjj,ISTAT) END subroutine move2 use params - use openacc + !!use openacc use chainm use chain1 use echain1 @@ -7737,7 +7737,7 @@ subroutine move2 end subroutine move3s use params - use openacc + !use openacc use chainm use chain1 use echain1 @@ -7947,7 +7947,7 @@ subroutine move3s end subroutine move3d use params - use openacc + !use openacc use chainm use chain1 use echain1 @@ -8169,7 +8169,7 @@ subroutine move3d end subroutine move4s use params - use openacc + !use openacc use chainm use chain1 use echain1 @@ -9805,7 +9805,7 @@ subroutine tran_N end subroutine trot_N use params - use openacc + !use openacc use chainm use chain1 use echain1 @@ -10191,7 +10191,7 @@ subroutine trot_N subroutine defo_N use params use chainm - use openacc + !use openacc use chain1 use echain1 use lengths @@ -11986,7 +11986,7 @@ subroutine trot_M subroutine defo_M use params use chainm - use openacc + !use openacc use chain1 use echain1 use lengths @@ -12843,7 +12843,7 @@ subroutine tran_C end subroutine trot_C use params - use openacc + !use openacc use chainm use chain1 use echain1 @@ -13222,7 +13222,7 @@ subroutine trot_C subroutine defo_C use params use chainm - use openacc + !use openacc use chain1 use echain1 use lengths @@ -14888,7 +14888,7 @@ subroutine move9 end subroutine swap(i1,i2) use params - use openacc + !use openacc use lengths use trackn implicit integer (i-z) @@ -14966,7 +14966,7 @@ integer function metro_swap(i,j) end subroutine swap_RS(i1,i2) use params - use openacc + !use openacc use chainm use lengths implicit integer (i-z) @@ -15158,7 +15158,7 @@ function energy_tot() ! COMMON/ENERGY/EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) ! common/pair1/eh2,eh1b,eh1c ! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) common/otherenergy/E_cord,E_cnum diff --git a/BenchmarkD200setsHard60/src/aay.f90 b/BenchmarkD200setsHard60/src/aay.f90 index 4993e3c..f697cb8 100644 --- a/BenchmarkD200setsHard60/src/aay.f90 +++ b/BenchmarkD200setsHard60/src/aay.f90 @@ -1,17 +1,17 @@ - module aay_mod + module aay_mod - contains + contains - function aay(i) - use params + function aay(i) + use params + use chainm + use chain1 + use echain1 !$acc routine seq + implicit none + integer, value :: i + real :: aay !$OMP declare target - use chainm - use chain1 - use echain1 - implicit none - integer, value :: i - real :: aay if(mv(i).gt.0)then aay=y(i) diff --git a/BenchmarkD200setsHard60/src/casGpu.f90 b/BenchmarkD200setsHard60/src/casGpu.f90 index 52851b6..afa0347 100644 --- a/BenchmarkD200setsHard60/src/casGpu.f90 +++ b/BenchmarkD200setsHard60/src/casGpu.f90 @@ -422,7 +422,7 @@ program TASSER ! common/fr/frga(ndim),frgb(ndim) ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! COMMON/short2/ codevsum, didevsum, csr(ndim,2) ! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c ! common/sg/gx(nvec,nvec,0:19),gy(nvec,nvec,0:19),gz(nvec,nvec,0:19) @@ -1005,7 +1005,7 @@ subroutine set_common character*80 line common/movename/mname(100) common/frozen/L_cut,d_xyz0,d_xyz00(ndim),angle0,angle00(ndim) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) common/zscore/izscore @@ -1916,7 +1916,7 @@ subroutine read_distantrestrain ! parameter(ndim=1500) ! parameter(nvec=416) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/lengths/Lch,Lch1,Lch2 common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev ! common/distres/er4,es3c @@ -2442,7 +2442,7 @@ subroutine reset_temperature ! common/lengths/Lch,Lch1,Lch2 common/resnumber/Ncom,Ndis,accur common/commonuse2/atemp1,atemp2,N_rep,phot - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) real r_dis,r_con,r_dev,T10,T20,T1a,T2a diff --git a/BenchmarkD200setsHard60/src/connect.f90 b/BenchmarkD200setsHard60/src/connect.f90 index ea5dece..82f321d 100644 --- a/BenchmarkD200setsHard60/src/connect.f90 +++ b/BenchmarkD200setsHard60/src/connect.f90 @@ -1,5 +1,5 @@ subroutine connect(i1,i2,pass) - use params + use params use lengths implicit integer(i-z) ! parameter(ndim=1500) @@ -11,7 +11,11 @@ subroutine connect(i1,i2,pass) bdis0=3.5 amcheck_dis=3.1 !3.1*0.87=2.7 pass=1 +!!$OMP target update to( i1 ) +! !$OMP target update to(i1, i2, pass) +! !$OMP target update to(i2, i1, pass) !, pass) if(i1.eq.1)then !!!!!N-terminal or whole structure, random walk +! !$OMP target update to(i2, pass) do i=i2,1,-1 n_check=0 10 call get_bond(axx,ayy,azz,3.8) diff --git a/BenchmarkD200setsHard60/src/defo_C.f90 b/BenchmarkD200setsHard60/src/defo_C.f90 index 3ae93ac..9deac6e 100644 --- a/BenchmarkD200setsHard60/src/defo_C.f90 +++ b/BenchmarkD200setsHard60/src/defo_C.f90 @@ -2,7 +2,7 @@ subroutine defo_C use params use backup2 use chainm - use openacc +! !use openacc use chain1 use echain1 use lengths diff --git a/BenchmarkD200setsHard60/src/defo_M.f90 b/BenchmarkD200setsHard60/src/defo_M.f90 index c9e0347..6198339 100644 --- a/BenchmarkD200setsHard60/src/defo_M.f90 +++ b/BenchmarkD200setsHard60/src/defo_M.f90 @@ -261,6 +261,7 @@ subroutine defo_M ny(n1)=y(n)-vy(nn(n1)) nz(n1)=z(n)-vz(nn(n1)) !$acc kernels +!$OMP target teams distribute parallel do simd do i=m2,n_rot ex_n(i)=ax0+ax+(ex(i)-ax)*a11+(ey(i)-ay)*a12+(ez(i)-az)*a13 !CA ey_n(i)=ay0+ay+(ex(i)-ax)*a21+(ey(i)-ay)*a22+(ez(i)-az)*a23 @@ -278,6 +279,7 @@ subroutine defo_M ety_n(i)=ay0+ay+(etx(i)-ax)*a21+(ety(i)-ay)*a22+(etz(i)-az)*a23 etz_n(i)=az0+az+(etx(i)-ax)*a31+(ety(i)-ay)*a32+(etz(i)-az)*a33 enddo +!$OMP end target teams distribute parallel do simd do i=n_rot+1,n2 ex_n(i)=ax0+ax+(ex(i)-ax)*b11+(ey(i)-ay)*b12+(ez(i)-az)*b13 !CA ey_n(i)=ay0+ay+(ex(i)-ax)*b21+(ey(i)-ay)*b22+(ez(i)-az)*b23 diff --git a/BenchmarkD200setsHard60/src/defo_M_NewGpuFeb5.f90 b/BenchmarkD200setsHard60/src/defo_M_NewGpuFeb5.f90 index ab45626..fe41d20 100644 --- a/BenchmarkD200setsHard60/src/defo_M_NewGpuFeb5.f90 +++ b/BenchmarkD200setsHard60/src/defo_M_NewGpuFeb5.f90 @@ -2,7 +2,7 @@ subroutine defo_M use params use backup2 use chainm - use openacc + !use openacc use chain1 use echain1 use lengths diff --git a/BenchmarkD200setsHard60/src/ei5.f90 b/BenchmarkD200setsHard60/src/ei5.f90 index c28ab6c..a1ca76d 100644 --- a/BenchmarkD200setsHard60/src/ei5.f90 +++ b/BenchmarkD200setsHard60/src/ei5.f90 @@ -3,9 +3,7 @@ module ei5_mod contains function ei5(i,idist) - use params -!$acc routine seq -!$OMP declare target + use params use lengths use short1 use chainm @@ -18,7 +16,8 @@ function ei5(i,idist) real :: axp, ayp, azp real :: ei5 integer :: xxx - +!$acc routine seq +!$OMP declare target ei5=0 if(idist.gt.5)then im2=i-2 diff --git a/BenchmarkD200setsHard60/src/energyHBa.f90 b/BenchmarkD200setsHard60/src/energyHBa.f90 index 1116a7e..fb6b491 100644 --- a/BenchmarkD200setsHard60/src/energyHBa.f90 +++ b/BenchmarkD200setsHard60/src/energyHBa.f90 @@ -3,14 +3,14 @@ module energyHBa_mod contains function energyHBa(i,k,a,axki,ayki,azki,dxi,dyi,dzi,dxk,dyk,dzk) use params -!// !$acc routine seq -!$OMP declare target use ENERGY use hba use hbb implicit integer(i-z) integer, value :: i,k real, value :: a,axki,ayki,azki,dxi,dyi,dzi,dxk,dyk,dzk +!// !$acc routine seq +!$OMP declare target ! !$OMP declare target !c because helix is right-hand, bi=v(i-1)(x)v(i) is always diff --git a/BenchmarkD200setsHard60/src/energy_tot.f90 b/BenchmarkD200setsHard60/src/energy_tot.f90 index 1767bb5..7863be4 100644 --- a/BenchmarkD200setsHard60/src/energy_tot.f90 +++ b/BenchmarkD200setsHard60/src/energy_tot.f90 @@ -33,7 +33,7 @@ function energy_tot() ! COMMON/ENERGY/EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) ! common/pair1/eh2,eh1b,eh1c ! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) common/otherenergy/E_cord,E_cnum diff --git a/BenchmarkD200setsHard60/src/mods.f90 b/BenchmarkD200setsHard60/src/mods.f90 index 19fe2cb..0758da9 100644 --- a/BenchmarkD200setsHard60/src/mods.f90 +++ b/BenchmarkD200setsHard60/src/mods.f90 @@ -14,16 +14,16 @@ !! common/shape/amx,amy,amz,afs(ndim),afsn(ndim) ! !common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1 !!common/backup1/NOPP(ndim),NOMM(ndim),NOAA(ndim),NHBNN(ndim) c 1 2 3 4 5 6 7 ! c 3456789012345678901234567890123456789012345678901234567890123456789012345678 - module params - parameter ndim = 1500 - parameter nrep = 100 - parameter nvec = 416 - end module params + module params + integer, parameter :: ndim = 1500 + integer, parameter :: nrep = 100 + integer, parameter :: nvec = 416 + end module params module trackn use params - integer n_tem(100) + integer n_tem(100) ! !$OMP declare target(n_tem) !$OMP declare target(n_tem) end module trackn @@ -32,14 +32,14 @@ end module trackn module chainm use params - real mv(ndim) + real :: mv(ndim) ! !$OMP declare target(mv) !$OMP declare target(mv) ! !$OMP end declare target end module chainm module eigen - real AA(3,3), EE(3), HH(3,3) + real :: AA(3,3), EE(3), HH(3,3) ! !$OMP declare target(AA,EE,HH) !$OMP declare target(AA,EE,HH) end module @@ -47,7 +47,7 @@ module eigen module ehbc use params - real envir(0:15,0:15,0:15,0:19,4),en1 + real :: envir(0:15,0:15,0:15,0:19,4),en1 !$OMP declare target(envir,en1) end module ehbc @@ -60,16 +60,16 @@ end module backup1 module shape use params - real amx,amy,amz,afs(ndim),afsn(ndim) + real :: amx,amy,amz,afs(ndim),afsn(ndim) !$OMP declare target(amx,amy,amz,afs,afsn) end module shape module stick use params - integer nstick,astick,nrmsd,ermsd + integer nstick,nrmsd integer iq(ndim,nrep) - real ax00(ndim,nrep),ay00(ndim,nrep),az00(ndim,nrep) - real bx00(ndim),by00(ndim),bz00(ndim),armsd_min0 + real :: ax00(ndim,nrep),ay00(ndim,nrep),az00(ndim,nrep) + real :: bx00(ndim),ermsd,by00(ndim),bz00(ndim),armsd_min0,astick integer itemp0,icycle,icycle0 !$OMP declare target (ax00,iq,ay00,az00,bx00,by00,bz00) end module @@ -77,21 +77,21 @@ module stick module short use params integer IBIN(-300:300) - real asr(ndim,-12:12),csr(ndim,2) - real codevsum, didevsum + real :: asr(ndim,-12:12),csr(ndim,2) + real :: codevsum, didevsum !$OMP declare target(IBIN,asr,csr) end module short module ENERGY use params - real EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) + real :: EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) !$OMP declare target(EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ) end module ENERGY module svm1 use params integer Mcon(15,ndim),Kcon(15,ndim,100) - real awei(15,ndim,ndim) + real :: awei(15,ndim,ndim) !$OMP declare target(Mcon,Kcon,awei) end module svm1 @@ -107,47 +107,48 @@ module svm2 use params integer acc_cut, nk_svm(3) integer ik_svm(3,15) - real dist_svm2(15) + real :: dist_svm2(15) !$OMP declare target(acc_cut,nk_svm,ik_svm,dist_svm2) end module svm2 module RES use params - integer ER3,er5,er6,er7,Mcom(ndim) - real Kcom(ndim,100) + real :: ER3,er5,er6,er7 + integer :: Mcom(ndim) + real :: Kcom(ndim,100) !$OMP declare target(ER3,er5,er6,er7,Mcom,Kcom) end module RES module hba - integer eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh + real :: eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh !$OMP declare target(eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh) end module hba module lengths - integer Lch, Lch1, Lch2 + integer :: Lch, Lch1, Lch2 !$OMP declare target(Lch,Lch1,Lch2) end module lengths module short1 integer JBIN(0:500) - real acops(1500,16) - real bsr(1500,16) + real :: acops(1500,16) + real :: bsr(1500,16) !$OMP declare target (JBIN,bsr,acops) end module short1 module echain1 - real ex(1500),ey(1500),ez(1500) + real :: ex(1500),ey(1500),ez(1500) ! !$OMP declare target(ex,ey,ez) !$OMP declare target(ex,ey,ez) end module echain1 module shortcom - integer eh3,es4,es5,es6,es7,es7a,es7b,es7c + real :: eh3,es4,es5,es6,es7,es7a,es7b,es7c !$OMP declare target(eh3,es4,es5,es6,es7,es7a,es7b,es7c) end module shortcom module hbb - integer eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh + real :: eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh !$OMP declare target (eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh) end module hbb @@ -164,27 +165,27 @@ module seqe end module seqe module hb - real hbx(416,416), hby(416,416),hbz(416,416) + real :: hbx(416,416), hby(416,416),hbz(416,416) !$OMP declare target(hbx,hby,hbz) end module hb module bisec - real cax(416,416), cay(416,416), caz(416,416) + real :: cax(416,416), cay(416,416), caz(416,416) !$OMP declare target(cax,cay,caz) end module bisec module sizea - real ala(0:19,0:19),alm(0:19,0:19),alp(0:19,0:19) + real :: ala(0:19,0:19),alm(0:19,0:19),alp(0:19,0:19) !$OMP declare target(ala,alm,alp) end module sizea module pair - real apa(1500,1500),app(1500,1500),apm(1500,1500) + real :: apa(1500,1500),app(1500,1500),apm(1500,1500) !$OMP declare target(apa,app,apm) end module pair module size - real arla(0:19,0:19), arlm(0:19,0:19),arlp(0:19,0:19) + real :: arla(0:19,0:19), arlm(0:19,0:19),arlp(0:19,0:19) !$OMP declare target(arla,arlm,arlp) end module size @@ -217,12 +218,12 @@ module tempArrays !$OMP& ex_n,egx_n,ecx_n,ebx_n,etx_n,oy,oz,oo, !$OMP& ny,nz,nn,ey_o,ez_o,egy_o,egz_o, !$OMP& ecy_o,ecz_o,eby_o,ebz_o,ety_o,etz_o, -!$OMP& ety_o,etz_o,ey_n,ez_n,egy_n,egz_n, +!$OMP& ey_n,ez_n,egy_n,egz_n, !$OMP& ecy_n,ecz_n,eby_n,ebz_n,ety_n,etz_n) end module tempArrays module par - real apar(1500,1500) + real :: apar(1500,1500) !$OMP declare target(apar) end module par @@ -237,13 +238,13 @@ module CAcontact use params integer McomCA(ndim),KcomCA(ndim,100) integer McomCA8(ndim),KcomCA8(ndim,100) - real aweigCA(ndim,ndim),aweigCA8(ndim,ndim) + real :: aweigCA(ndim,ndim),aweigCA8(ndim,ndim) !$OMP declare target(McomCA,KcomCA,McomCA8,KcomCA8,aweigCA,aweigCA8) end module CAcontact module sg - real hx(416,416,0:19),hy(416,416,0:19),hz(416,416,0:19) - real gx(416,416,0:19),gy(416,416,0:19),gz(416,416,0:19) + real :: hx(416,416,0:19),hy(416,416,0:19),hz(416,416,0:19) + real :: gx(416,416,0:19),gy(416,416,0:19),gz(416,416,0:19) !$OMP declare target(gx,gy,gz,hx,hy,hz) end module sg @@ -253,60 +254,61 @@ module icgg end module icgg module envir1 - real nop(1500),nom(1500),noa(1500),nhbn(1500) + real :: nop(1500),nom(1500),noa(1500),nhbn(1500) !$OMP declare target(nop,nom,noa,nhbn) end module envir1 module distres - integer er4,es3c + real :: er4,es3c !$OMP declare target(er4,es3c) end module distres module order - integer acorder,en2,sumct,sumcto,icnt,icnto,dord,en3 + integer sumct,sumcto,icnt,icnto + real :: en2,en3,dord,acorder !$OMP declare target(acorder,en2,sumct,sumcto,icnt,icnto,dord,en3) end module order module echain2 - real egx(1500),egy(1500),egz(1500) + real :: egx(1500),egy(1500),egz(1500) !$OMP declare target (egx,egy,egz) end module echain2 module echain4 - real ecx(1500),ecy(1500),ecz(1500) + real :: ecx(1500),ecy(1500),ecz(1500) !$OMP declare target (ecx,ecy,ecz) end module echain4 module echain5 - real ebx(1500),eby(1500),ebz(1500) + real :: ebx(1500),eby(1500),ebz(1500) !$OMP declare target (ebx,eby,ebz) end module echain5 module fr use params - real frga(ndim),frgb(ndim) + real :: frga(ndim),frgb(ndim) !$OMP declare target (frga,frgb) end module fr module freg use params - real aweig(ndim,ndim) + real :: aweig(ndim,ndim) !$OMP declare target (aweig) end module freg module echain6 - real etx(1500),ety(1500),etz(1500) + real :: etx(1500),ety(1500),etz(1500) !$OMP declare target (etx,ety,etz) end module echain6 module concutt - real concut(0:19,0:19),concut2(0:19,0:19) + real :: concut(0:19,0:19),concut2(0:19,0:19) integer concut_sc !$OMP declare target(concut,concut2,concut_sc) end module concutt module pair1 - integer eh2,eh1b,eh1c + real :: eh2,eh1b,eh1c !$OMP declare target(eh2,eh1b,eh1c) end module pair1 @@ -325,10 +327,21 @@ end module RCN module one use lengths - integer acrit,es2,es1 - real eoinp(0:19,0:100),eonekd(0:19),contt + integer acrit + real :: eoinp(0:19,0:100),es1,es2,contt,eonekd(0:19) + real :: eonehw(0:19) + + DATA eonekd /-0.4, 1.8, -0.8, 2.5, 4.2, -0.7, 4.5, -1.6, 1.9 + $ , -3.5, -3.5, 3.8, -3.9, -3.5, -3.5, -4.5, -3.2, 2.8 + $ , -1.3, -0.9/ +c ^ ^ ^ !contradict with 'centro.comm' +c read hydrophilic potential for Sg, positive for hydrophilic +c residue---> + DATA eonehw /0.0, -0.5, 0.3, -1.0, -1.5, -0.4, -1.8, 0.0, -1.3 + $ , 3.0, 0.2, -1.8, 3.0, 3.0, 0.2, 3.0, -0.5, -2.5 + $ , -2.3, -3.4 / ! real, PRIVATE :: eonekd(0:19) -!$OMP declare target(acrit,contt,eoinp,es2,es1,eonekd) +!$OMP declare target(acrit,contt,eoinp,es2,es1,eonekd,eonehw) cccccccccccccccccccccc read centrosymmetric potential cccccccccccccccccccc c eonekd(A) controls centrosymmetric potential of C_g. @@ -341,21 +354,24 @@ subroutine read_centro character*3 NAME ! common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1 ! common/lengths/Lch,Lch1,Lch2 - common/hopp/eonehw(0:19) +! common/hopp/eonehw(0:19) c read hydrophobic potential for Sg, positive for hydrophobic c residue---> - data eonekd /-0.4, 1.8, -0.8, 2.5, 4.2, -0.7, 4.5, - & -1.6, 1.9, -3.5, -3.5, 3.8, - & -3.9, -3.5, -3.5, -4.5, - & -3.2, 2.8, -1.3, -0.9/ +! data eonekd /-0.4, 1.8, -0.8, 2.5, 4.2, -0.7, 4.5, +! & -1.6, 1.9, -3.5, -3.5, 3.8, +! & -3.9, -3.5, -3.5, -4.5, +! & -3.2, 2.8, -1.3, -0.9/ + +! DATA eonekd /-0.4, 1.8, -0.8, 2.5, 4.2, -0.7, 4.5, -1.6, 1.9 +! $ ,-3.5, -3.5, 3.8, -3.9, -3.5, -3.5, -4.5, -3.2, 2.8 +! $ ,-1.3, -0.9/ c ^ ^ ^ !contradict with 'centro.comm' c read hydrophilic potential for Sg, positive for hydrophilic c residue---> - data eonehw /0.0, -0.5, 0.3, -1.0, -1.5, -0.4, -1.8, - & 0.0, -1.3, 3.0, 0.2, -1.8, - & 3.0, 3.0, 0.2, 3.0, - & -0.5, -2.5, -2.3, -3.4/ +! DATA eonehw /0.0, -0.5, 0.3, -1.0, -1.5, -0.4, -1.8, 0.0, -1.3 +! $ ,3.0, 0.2, -1.8, 3.0, 3.0, 0.2, 3.0, -0.5, -2.5 +! $ ,-2.3, -3.4 / c expected gyration radius: acrit=2.2*exp(0.38*alog(float(Lch)))/0.87 !gyrat-radius~2.2*l^0.38 diff --git a/BenchmarkD200setsHard60/src/move2.f90 b/BenchmarkD200setsHard60/src/move2.f90 index 685df22..3a68b6b 100644 --- a/BenchmarkD200setsHard60/src/move2.f90 +++ b/BenchmarkD200setsHard60/src/move2.f90 @@ -1,7 +1,7 @@ subroutine move2 use params use backup2 - use openacc +! !!use openacc use chainm use chain1 use echain1 @@ -97,15 +97,15 @@ subroutine move2 ! !$OMP target enter data map(tofrom:nomm(:),nop(:),nopp(:),noaa(:),nom(:),noa(:)) ! !$OMP target enter data map(to: nomm, nop, nopp, noaa, nom, noa) -!$OMP target teams distribute parallel do simd num_teams(1) nowait -!$OMP& map(to: nomm, nop, nopp, noaa, nom, noa) +!//!$OMP target teams distribute parallel do simd num_teams(1) !nowait +!/!$OMP& map(to: nomm, nop, nopp, noaa, nom, noa) ! !$acc loop gang(1024) do pp=1,Lch nop(pp)=nopp(pp) !prepare to calculate energy nom(pp)=nomm(pp) noa(pp)=noaa(pp) enddo -!$OMP end target teams distribute parallel do simd +!/!$OMP end target teams distribute parallel do simd !// !$acc end kernels !Just added this Enew=EHB(m,m2,1)+ESHORT(m,m2,1) !icnt,nop are repeated. ! !$acc loop vector(256) @@ -130,8 +130,9 @@ subroutine move2 c calculate eprofn while dord was calculated when call EHB(m,m2,1)---> eprofn=0.0 !// !$acc kernels loop gang async(2) !gang I just took out -!$OMP target teams distribute parallel do simd num_teams(1) nowait -!$OMP& map(to: nomm, nop, seq, noaa, nom, envir, noa) +! !$OMP target teams distribute parallel do simd num_teams(80) !nowait +!/!$OMP& map(to: nomm, nop, seq, noaa, nom, envir, noa) +! !$OMP parallel do simd private(pp) shared(seq,noa,nop,nom) do pp=1,Lch is=seq(pp) ia=noa(pp) @@ -145,7 +146,8 @@ subroutine move2 !// !$acc atomic update eprofn=eprofn+envir(ia,im,ip,is,3) enddo -!$OMP end target teams distribute parallel do simd +! !$OMP end parallel do simd +! !$OMP end target teams distribute parallel do simd !// !$acc end kernels !// !$acc wait(2) !// !$acc end data @@ -163,11 +165,14 @@ subroutine move2 icnto=icnt !backup1 sumcto=sumct !backup2 ! !$acc kernels ! loop gang(12) vector(1024) +! !$OMP target teams parallel do simd +! !$OMP parallel do simd private(pp) shared(nop,nom,noa) do pp=1,Lch nopp(pp)=nop(pp) !backup3 nomm(pp)=nom(pp) !backup4 noaa(pp)=noa(pp) !backup5 enddo +! !$OMP end parallel do simd eprofo=eprofn !backup6 codevsum=codev !backup7 didevsum=didev !backup8 diff --git a/BenchmarkD200setsHard60/src/move2_gpu_1Kernel.f90 b/BenchmarkD200setsHard60/src/move2_gpu_1Kernel.f90 index e054f9e..a833bc7 100644 --- a/BenchmarkD200setsHard60/src/move2_gpu_1Kernel.f90 +++ b/BenchmarkD200setsHard60/src/move2_gpu_1Kernel.f90 @@ -1,6 +1,6 @@ subroutine move2 use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move2gpuFeb1.f90 b/BenchmarkD200setsHard60/src/move2gpuFeb1.f90 index 36da07f..09a46ec 100644 --- a/BenchmarkD200setsHard60/src/move2gpuFeb1.f90 +++ b/BenchmarkD200setsHard60/src/move2gpuFeb1.f90 @@ -1,7 +1,7 @@ subroutine move2 use params use backup2 - use openacc + !!use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move3d.f90 b/BenchmarkD200setsHard60/src/move3d.f90 index 1bcf63c..f3fde33 100644 --- a/BenchmarkD200setsHard60/src/move3d.f90 +++ b/BenchmarkD200setsHard60/src/move3d.f90 @@ -1,7 +1,7 @@ subroutine move3d use params use backup2 - use openacc +! !use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move3s.f90 b/BenchmarkD200setsHard60/src/move3s.f90 index 8b1dba9..3216ee4 100644 --- a/BenchmarkD200setsHard60/src/move3s.f90 +++ b/BenchmarkD200setsHard60/src/move3s.f90 @@ -1,6 +1,6 @@ subroutine move3s use params - use openacc +! !use openacc use chainm use backup2 use chain1 diff --git a/BenchmarkD200setsHard60/src/move4d.f90 b/BenchmarkD200setsHard60/src/move4d.f90 index 35e6721..78fa270 100644 --- a/BenchmarkD200setsHard60/src/move4d.f90 +++ b/BenchmarkD200setsHard60/src/move4d.f90 @@ -1,7 +1,7 @@ subroutine move4d use params use backup2 - use openacc + !use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move4s.f90 b/BenchmarkD200setsHard60/src/move4s.f90 index 829487f..e926d6c 100644 --- a/BenchmarkD200setsHard60/src/move4s.f90 +++ b/BenchmarkD200setsHard60/src/move4s.f90 @@ -1,7 +1,7 @@ subroutine move4s use params use backup2 - use openacc + !use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move5d.f90 b/BenchmarkD200setsHard60/src/move5d.f90 index b459d83..566cfb1 100644 --- a/BenchmarkD200setsHard60/src/move5d.f90 +++ b/BenchmarkD200setsHard60/src/move5d.f90 @@ -1,6 +1,6 @@ subroutine move5d use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move5s.f90 b/BenchmarkD200setsHard60/src/move5s.f90 index 1280a1b..7f96d91 100644 --- a/BenchmarkD200setsHard60/src/move5s.f90 +++ b/BenchmarkD200setsHard60/src/move5s.f90 @@ -1,7 +1,7 @@ subroutine move5s use params use chainm - use openacc + !use openacc use backup2 use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move6.f90 b/BenchmarkD200setsHard60/src/move6.f90 index ba5b701..6643ef5 100644 --- a/BenchmarkD200setsHard60/src/move6.f90 +++ b/BenchmarkD200setsHard60/src/move6.f90 @@ -1,7 +1,7 @@ subroutine move6 use params use backup2 - use openacc + !use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/move7a.f90 b/BenchmarkD200setsHard60/src/move7a.f90 index 0401237..8738eb0 100644 --- a/BenchmarkD200setsHard60/src/move7a.f90 +++ b/BenchmarkD200setsHard60/src/move7a.f90 @@ -1,6 +1,6 @@ subroutine move7a use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move7b.f90 b/BenchmarkD200setsHard60/src/move7b.f90 index 39893b4..e626298 100644 --- a/BenchmarkD200setsHard60/src/move7b.f90 +++ b/BenchmarkD200setsHard60/src/move7b.f90 @@ -1,6 +1,6 @@ subroutine move7b use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move8.f90 b/BenchmarkD200setsHard60/src/move8.f90 index e5dbf93..177c100 100644 --- a/BenchmarkD200setsHard60/src/move8.f90 +++ b/BenchmarkD200setsHard60/src/move8.f90 @@ -1,6 +1,6 @@ subroutine move8 use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move9.f90 b/BenchmarkD200setsHard60/src/move9.f90 index 46edb4d..c855f9a 100644 --- a/BenchmarkD200setsHard60/src/move9.f90 +++ b/BenchmarkD200setsHard60/src/move9.f90 @@ -1,6 +1,6 @@ subroutine move9 use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/move_c_end.f90 b/BenchmarkD200setsHard60/src/move_c_end.f90 index e7db3f6..4c18f52 100644 --- a/BenchmarkD200setsHard60/src/move_c_end.f90 +++ b/BenchmarkD200setsHard60/src/move_c_end.f90 @@ -1,6 +1,6 @@ subroutine move_c_end use params - use openacc + !use openacc use backup2 use chainm use chain1 @@ -12,6 +12,7 @@ subroutine move_c_end use shape use backup1 use ehbc + use order implicit integer(i-z) common/logica/goodc logical look, goodc(nvec,nvec) @@ -104,7 +105,7 @@ subroutine move_c_end enddo c Metropolis ------------------> - dE=Enew-Eold+dord+en1*(eprofn-eprofo) + dE=Enew-Eold +dord +en1*(eprofn-eprofo) c E=energ c Et=E+de diff --git a/BenchmarkD200setsHard60/src/move_n_end.f90 b/BenchmarkD200setsHard60/src/move_n_end.f90 index d01cb92..3c5002f 100644 --- a/BenchmarkD200setsHard60/src/move_n_end.f90 +++ b/BenchmarkD200setsHard60/src/move_n_end.f90 @@ -1,6 +1,6 @@ subroutine move_n_end use params - use openacc + !use openacc use backup2 use chainm use chain1 diff --git a/BenchmarkD200setsHard60/src/read_distantrestrain.f90 b/BenchmarkD200setsHard60/src/read_distantrestrain.f90 index a9fe284..6697eb4 100644 --- a/BenchmarkD200setsHard60/src/read_distantrestrain.f90 +++ b/BenchmarkD200setsHard60/src/read_distantrestrain.f90 @@ -7,7 +7,7 @@ subroutine read_distantrestrain ! parameter(ndim=1500) ! parameter(nvec=416) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/lengths/Lch,Lch1,Lch2 common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev ! common/distres/er4,es3c diff --git a/BenchmarkD200setsHard60/src/reset_temperature.f90 b/BenchmarkD200setsHard60/src/reset_temperature.f90 index 6719cf6..d1ad121 100644 --- a/BenchmarkD200setsHard60/src/reset_temperature.f90 +++ b/BenchmarkD200setsHard60/src/reset_temperature.f90 @@ -10,7 +10,7 @@ subroutine reset_temperature ! common/lengths/Lch,Lch1,Lch2 common/resnumber/Ncom,Ndis,accur common/commonuse2/atemp1,atemp2,N_rep,phot - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) real r_dis,r_con,r_dev,T10,T20,T1a,T2a diff --git a/BenchmarkD200setsHard60/src/rot_M.f90 b/BenchmarkD200setsHard60/src/rot_M.f90 index d3bba3b..ca8b9b1 100644 --- a/BenchmarkD200setsHard60/src/rot_M.f90 +++ b/BenchmarkD200setsHard60/src/rot_M.f90 @@ -2,7 +2,7 @@ subroutine rot_M use params use backup2 use chainm - use openacc + !use openacc use chain1 use echain1 use lengths @@ -235,6 +235,7 @@ subroutine rot_M ny(n1)=y(n)-vy(nn(n1)) nz(n1)=z(n)-vz(nn(n1)) !$acc kernels +!$OMP target teams distribute parallel do simd do i=m2,n2 ex_n(i)=ax+(ex(i)-ax)*a11+(ey(i)-ay)*a12+(ez(i)-az)*a13 !CA ey_n(i)=ay+(ex(i)-ax)*a21+(ey(i)-ay)*a22+(ez(i)-az)*a23 @@ -252,6 +253,7 @@ subroutine rot_M ety_n(i)=ay+(etx(i)-ax)*a21+(ety(i)-ay)*a22+(etz(i)-az)*a23 etz_n(i)=az+(etx(i)-ax)*a31+(ety(i)-ay)*a32+(etz(i)-az)*a33 enddo +!$OMP end target teams distribute parallel do simd !$acc end kernels d2=(nx(m1)-ex_n(m3))**2+(ny(m1)-ey_n(m3))**2+(nz(m1)-ez_n(m3))**2 if((d2.lt.23.or.d2.gt.78).and.mbig.eq.0)goto 202 diff --git a/BenchmarkD200setsHard60/src/set_common.f90 b/BenchmarkD200setsHard60/src/set_common.f90 index 650c6c0..51546e6 100644 --- a/BenchmarkD200setsHard60/src/set_common.f90 +++ b/BenchmarkD200setsHard60/src/set_common.f90 @@ -27,7 +27,7 @@ subroutine set_common character*80 line common/movename/mname(100) common/frozen/L_cut,d_xyz0,d_xyz00(ndim),angle0,angle00(ndim) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) common/zscore/izscore diff --git a/BenchmarkD200setsHard60/src/swap.f90 b/BenchmarkD200setsHard60/src/swap.f90 index 824553d..20ef4e0 100644 --- a/BenchmarkD200setsHard60/src/swap.f90 +++ b/BenchmarkD200setsHard60/src/swap.f90 @@ -1,6 +1,6 @@ subroutine swap(i1,i2) use params - use openacc + !use openacc use lengths use trackn implicit integer (i-z) diff --git a/BenchmarkD200setsHard60/src/swap_RS.f90 b/BenchmarkD200setsHard60/src/swap_RS.f90 index 91db54a..c3c6b6e 100644 --- a/BenchmarkD200setsHard60/src/swap_RS.f90 +++ b/BenchmarkD200setsHard60/src/swap_RS.f90 @@ -1,6 +1,6 @@ subroutine swap_RS(i1,i2) use params - use openacc + !use openacc use chainm use lengths implicit integer (i-z) diff --git a/BenchmarkD200setsHard60/src/tasser.f90 b/BenchmarkD200setsHard60/src/tasser.f90 index c8b6af1..50a860a 100644 --- a/BenchmarkD200setsHard60/src/tasser.f90 +++ b/BenchmarkD200setsHard60/src/tasser.f90 @@ -1,88 +1,88 @@ - program TASSER - use params - use openacc - use backup2 - use hb - use sizea - use size - use bisec - use chainm - use chain1 - use echain1 - use short1 - use lengths - use ENERGY - use hba - use hbb - use hb - use pair - use icgg - use sg - use distres - use ehbenergy - use concutt - use pair1 - use shortcom - use echain2 - use echain4 - use order - use echain5 - use seqe - use one - use RCN - use short - use RES - use svm1 - use svm2 - use fr - use stick - use short - use shape - use backup1 - use ehbc - use trackn - implicit integer(i-z) - common/logica/goodc - logical look, goodc(nvec,nvec) - common/three/angle(nvec,nvec) -! common/lengths/Lch,Lch1,Lch2 -! common/seqe/seq(ndim),sec(ndim) - common/vectors/vx(nvec),vy(nvec),vz(nvec),vector(-5:5,-5:5,-5:5) -! common/bisec/cax(nvec,nvec),cay(nvec,nvec),caz(nvec,nvec) -! common/hb/hbx(nvec,nvec),hby(nvec,nvec),hbz(nvec,nvec) - common/cutoff/cut1a,cut2a,cut3a,cut4a,cut1b,cut2b,cut3b,cut4b - common/hopp/eonehw(0:19) - common/looks/exc,exc1,exc2 -! common/hba/eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh -! common/hbb/eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh -! common/concutt/concut(0:19,0:19),concut2(0:19,0:19),concut_sc + program TASSER + use params + !use openacc + use backup2 + use hb + use sizea + use size + use bisec + use chainm + use chain1 + use echain1 + use short1 + use lengths + use ENERGY + use hba + use hbb + use hb + use pair + use icgg + use sg + use distres + use ehbenergy + use concutt + use pair1 + use shortcom + use echain2 + use echain4 + use order + use echain5 + use seqe + use one + use RCN + use short + use RES + use svm1 + use svm2 + use fr + use stick + use short + use shape + use backup1 + use ehbc + use trackn + implicit integer(i-z) + common/logica/goodc + logical look, goodc(nvec,nvec) + common/three/angle(nvec,nvec) + ! common/lengths/Lch,Lch1,Lch2 + ! common/seqe/seq(ndim),sec(ndim) + common/vectors/vx(nvec),vy(nvec),vz(nvec),vector(-5:5,-5:5,-5:5) + ! common/bisec/cax(nvec,nvec),cay(nvec,nvec),caz(nvec,nvec) + ! common/hb/hbx(nvec,nvec),hby(nvec,nvec),hbz(nvec,nvec) + common/cutoff/cut1a,cut2a,cut3a,cut4a,cut1b,cut2b,cut3b,cut4b + ! common/hopp/eonehw(0:19) + common/looks/exc,exc1,exc2 + ! common/hba/eh5a,Cr2a,acut_bb,acut_cc,acut_vv,acut_hh + ! common/hbb/eh5b,Cr2b,bcut_bb,bcut_cc,bcut_vv,bcut_hh + ! common/concutt/concut(0:19,0:19),concut2(0:19,0:19),concut_sc - common/arandom/ aarand,abrand,acrand,adrand -! COMMON/ENERGY/EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) -! COMMON/pair/ apa(ndim,ndim),app(ndim,ndim),apm(ndim,ndim) -! COMMON/size/ arla(0:19,0:19),arlm(0:19,0:19),arlp(0:19,0:19) -! COMMON/short/ IBIN(-300:300),asr(ndim,-12:12) !safe when vr^2<30 -! COMMON/short1/ JBIN(0:500),bsr(ndim,16),acops(ndim,16) -! COMMON/sizea/ ala(0:19,0:19),alm(0:19,0:19),alp(0:19,0:19) -! common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1 -! common/shape/amx,amy,amz,afs(ndim),afsn(ndim) ! common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1 ! common/backup1/NOPP(ndim),NOMM(ndim),NOAA(ndim),NHBNN(ndim) -! common/fr/frga(ndim),frgb(ndim) -! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) -! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) -! COMMON/short2/ codevsum, didevsum, csr(ndim,2) -! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c -! common/sg/gx(nvec,nvec,0:19),gy(nvec,nvec,0:19),gz(nvec,nvec,0:19) - common/maxi/maxin,vect1,vect2 -! common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1 - common/forpreparemove4/ asrr(0:19,0:19,-12:12) - common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev -! common/distres/er4,es3c - common/rmsdrange/nca1,nca2 - common/CA/dx(ndim),dy(ndim),dz(ndim) - common/msichores/msicho -! common/ehbenergy/EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,EHB5,EHB6 -! common/ehbenergy1/EHB5a,EHB5b + common/arandom/ aarand,abrand,acrand,adrand + ! COMMON/ENERGY/EH5,ES3,ES3a,ES3b,EH1,EH1a,EH4,EHBIJ(ndim,ndim) + ! COMMON/pair/ apa(ndim,ndim),app(ndim,ndim),apm(ndim,ndim) + ! COMMON/size/ arla(0:19,0:19),arlm(0:19,0:19),arlp(0:19,0:19) + ! COMMON/short/ IBIN(-300:300),asr(ndim,-12:12) !safe when vr^2<30 + ! COMMON/short1/ JBIN(0:500),bsr(ndim,16),acops(ndim,16) + ! COMMON/sizea/ ala(0:19,0:19),alm(0:19,0:19),alp(0:19,0:19) + ! common/one/acrit,contt,eonekd(0:19),eoinp(0:19,0:100),es2,es1 + ! common/shape/amx,amy,amz,afs(ndim),afsn(ndim) ! common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1 ! common/backup1/NOPP(ndim),NOMM(ndim),NOAA(ndim),NHBNN(ndim) + ! common/fr/frga(ndim),frgb(ndim) + ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) + ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + ! COMMON/short2/ codevsum, didevsum, csr(ndim,2) + ! common/shortcom/eh3,es4,es5,es6,es7,es7a,es7b,es7c + ! common/sg/gx(nvec,nvec,0:19),gy(nvec,nvec,0:19),gz(nvec,nvec,0:19) + common/maxi/maxin,vect1,vect2 + ! common/ehbc/envir(0:15,0:15,0:15,0:19,4),en1 + common/forpreparemove4/ asrr(0:19,0:19,-12:12) + common/lim/colim,dilim,coold,conew,diold,dinew,didev,codev + ! common/distres/er4,es3c + common/rmsdrange/nca1,nca2 + common/CA/dx(ndim),dy(ndim),dz(ndim) + common/msichores/msicho + ! common/ehbenergy/EHB1,EHB1a,EHB1b,EHB1c,EHB2,EHB3,EHB4,EHB5,EHB6 + ! common/ehbenergy1/EHB5a,EHB5b common/eshortenergy1/ESHORT1,ESHORT2,ESHORT3,ESHORT4,ESHORT11 common/eshortenergy2/ESHORT4a,ESHORT5,ESHORT5a,ESHORT5b,ESHORT5c common/eshortenergy3/ESHORT6,ESHORT7,ESHORT8,ESHORT9,ESHORT10 @@ -194,7 +194,7 @@ program TASSER character(len=40) :: dateBuf data w /ndim*1.0/ ccc - real :: timeA,TimeB + real :: timeA,TimeB,start_datE,end_datR ccccccccccccccccccccccccc common input files cccccccccccccccccccccccccccccc open(unit=1,file='contact.comm', status='old') !cutoff of contact predi. open(unit=2,file='profile3.comm',status='old') !envir @@ -273,10 +273,12 @@ program TASSER read(19,*) m_latt !how many vectors *** -! write(20,*)'starting time: ',fdate() !pgf77 has problem on fdate() - write(20,*)'starting time: ',date(dateBuf) -! write(*,*)'starting time: ',fdate() - write(20,*)'starting time: ',date(dateBuf) + call CPU_TIME(start_datE ) +! write(20,*)'starting time: ',fdate() !pgf77 has problem on fdate() + write(20,*)'starting time: ', start_datE !date(dateBuf) +! write(*,*)'starting time: ',fdate()! +! start_datE = cpu_time( ) + write(20,*)'starting time:' ,start_ datE *** call set_common !set common parameters @@ -372,6 +374,7 @@ program TASSER cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ccc The main cycle start from here ! ccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +! !$OMP parallel do 1111 icycle=1,ncycle do 2222 itemp=1,N_rep !iterate for all the replicas atemp=aT_rep(itemp) !current temperature @@ -380,6 +383,7 @@ program TASSER call set_current !get current (x,y,z,ica) call initial_move !update center, axis, energy ccc +!!$OMP parallel do do 3333 iphot=1,phot !N_swap, iterate at fixed temperature do 4444 i_lch=1,Lch fff=aranzy(nozy) @@ -413,6 +417,7 @@ program TASSER if(atime.gt.hour_max)goto 901 4444 continue 3333 continue +!!$OMP end parallel do ccc ccccccccccrecord energy and (x,y,z) cccccccccccccccccccc E_rep(itemp)=energy_tot() !whole energy @@ -501,6 +506,7 @@ program TASSER endif mcycle=mcycle+1 1111 continue +! !$OMP end parallel if(i_run.lt.n_run)goto 15 901 continue c--------------------------Main cycle ended here!!--------------- @@ -606,7 +612,8 @@ program TASSER write(20,*)'hour_real=',atime write(20,*) ! write(20,*)'ending time: ',fdate() - write(20,*)'ending time: ',date(dateBuf) + call CPU_TIME(end_datR ) + write(20,*)'ending time: ',end_datR !date(dateBuf) write(*,*) write(*,*)'ncycle_max=',ncycle*n_run @@ -616,7 +623,8 @@ program TASSER write(*,*)'hour_real=',atime write(*,*) ! write(*,*)'ending time: ',fdate() - write(20,*)'ending time: ',date(dateBuf) + call CPU_TIME(end_datR ) + write(20,*)'ending time: ',end_datR !fdate() !date(dateBuf) STOP END diff --git a/BenchmarkD200setsHard60/src/template_initial.f90 b/BenchmarkD200setsHard60/src/template_initial.f90 index 443c39c..f4a5dc1 100644 --- a/BenchmarkD200setsHard60/src/template_initial.f90 +++ b/BenchmarkD200setsHard60/src/template_initial.f90 @@ -32,7 +32,7 @@ subroutine template_initial ! common/seqe/seq(ndim),sec(ndim) common/looks/exc,exc1,exc2 - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/distres/er4,es3c ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) diff --git a/BenchmarkD200setsHard60/src/template_simulation.f90 b/BenchmarkD200setsHard60/src/template_simulation.f90 index 8fdcd52..20a236c 100644 --- a/BenchmarkD200setsHard60/src/template_simulation.f90 +++ b/BenchmarkD200setsHard60/src/template_simulation.f90 @@ -12,6 +12,9 @@ subroutine template_simulation use eigen use short use backup1 + use omp_lib + use iso_fortran_env + implicit integer(i-z) ! use chain1 ! parameter(ndim=1500) @@ -87,6 +90,7 @@ subroutine template_simulation common/aTTs/aTTs1,aTTs2,aTTs_rep(nrep),aTTs common/ranzy/nozy common/hours/hour_max + real (real64):: mvTs, mvTe, mvT,ehbTs,ehbTe,ehbT ! !$acc data copyout (energ_sum2(:),energ_sum(:),bnt(:) ! !$acc& ,n_rmsd(:),bnna(:),bna(:),bnst(:) ! !$acc& ,armsd_sum(:),bnsa(:),bnnt(:),n_sum(:)) @@ -196,7 +200,9 @@ subroutine template_simulation elseif(nfr_f(ifr).eq.Lch)then call trot_C !translate+rotate C-terminal else + mvTs=omp_get_wtime() call trot_M !translate+rotate Middle-fragment + mvTe=omp_get_wtime() endif elseif(switch.eq.4)then !translation if(nfr_i(ifr).eq.1)then @@ -248,7 +254,9 @@ subroutine template_simulation ccccccccccrecord energy and (x,y,z) cccccccccccccccccccccccc E_rep(itemp)=energy_tot() !whole energy if(E_rep(itemp).lt.E_min) E_min=E_rep(itemp) -! !$acc kernels loop private(i) +! !$acc kernels loop private(i)\ +! !$OMP target teams distribute parallel do +! !$OMP parallel do simd private(i) shared(ica,x,y,z,ex,ey,ez) do i=1,Lch icarep(i,itemp)=ica(i) if(mv(i).gt.0)then @@ -273,17 +281,23 @@ subroutine template_simulation etzrep(i,itemp)=etz(i) endif enddo +! !$OMP end parallel do +!!$OMP end target teams distribute parallel do ! !$acc end kernels c^^^^^^^^^^^^record done ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2222 continue ccccccccccccccccc, cccccccccccccccccccccccccc ! !$acc kernels loop gang private(i) +!!$OMP target teams distribute parallel do +!$OMP parallel do simd do i=1,N_rep energ_sum(i)=energ_sum(i)+E_rep(i) energ_sum2(i)=energ_sum2(i)+E_rep(i)*E_rep(i) N_sum(i)=N_sum(i)+1 enddo +!$OMP end parallel do simd +!!$OMP end target teams distribute parallel do ! !$acc end kernels ! ccccccccccccccccccccc snapshots of E(1), E(N_rep) ccccccccccccc @@ -383,6 +397,8 @@ subroutine template_simulation write(*,*)'hour_max=',hour_max write(*,*)'hour_real=',atime write(*,*) + write(*,* )'Start-Time',mvTs,mvTe,ehbTs,ehbTe + print '( a15, es10.3e2 )', 'Speedups : ',ehbTe !!FIX write(*,*)'ending time: ',fdate() stop diff --git a/BenchmarkD200setsHard60/src/tran_C.f90 b/BenchmarkD200setsHard60/src/tran_C.f90 index b22937d..3ec90f8 100644 --- a/BenchmarkD200setsHard60/src/tran_C.f90 +++ b/BenchmarkD200setsHard60/src/tran_C.f90 @@ -1,6 +1,6 @@ subroutine tran_C use params - use openacc + !use openacc use backup2 use chainm use chain1 @@ -134,9 +134,9 @@ subroutine tran_C oy(m1)=y(m1) oz(m1)=z(m1) !$acc kernels -!$OMP target teams distribute parallel do simd nowait -!$OMP& map(to:ex,ey,ez,egx,egy,egz,ecx,ecy,ecz,ebx,eby,ebz,etx,ety,etz) -!$OMP& map(from: ex_o,ey_o,ez_o,egx_o,egy_o,egz_o,ecx_o,ecy_o, +!$OMP target teams distribute parallel do simd !nowait +!$OMP& map(to:ex,ey,ez,egx,egy,egz,ecx,ecy,ecz,ebx,eby,ebz,etx,ety,etz) +!$OMP& map(from:ex_o,ey_o,ez_o,egx_o,egy_o,egz_o,ecx_o,ecy_o, !$OMP& ecz_o,ebx_o,eby_o,ebz_o,etx_o,ety_o,etz_o) do i=m2,Lch ex_o(i)=ex(i) !CA diff --git a/BenchmarkD200setsHard60/src/trot_C.f90 b/BenchmarkD200setsHard60/src/trot_C.f90 index 2331d50..c633d33 100644 --- a/BenchmarkD200setsHard60/src/trot_C.f90 +++ b/BenchmarkD200setsHard60/src/trot_C.f90 @@ -1,7 +1,7 @@ subroutine trot_C use params use backup2 - use openacc + !use openacc use chainm use chain1 use echain1 @@ -159,10 +159,10 @@ subroutine trot_C oy(m1)=y(m1) oz(m1)=z(m1) !// !$acc kernels -!$OMP target teams distribute parallel do num_teams(80) nowait -!$OMP& map(tofrom: ey,ex,ex_o,ez_o,ez,ey_o,egx,ecz_o,egy,egx_o,egz, -!$OMP& eby,ebx_o,ebz,eby_o,etx,egz_o,ety,etx_o,etz,ety_o,egx,egy,egx_o,egy_o,ecx,ebz_o,ecy,ecx_o, -!$OMP& ecz,ecy_o,egy_o,ecx,ebz_o,ecx_o,ecz,etz_o,ebx) +!$OMP target teams distribute parallel do num_teams(80) !!nowait +!$OMP& map(tofrom: ey,ex,ex_o,ez_o,ez,ey_o,ecz_o,egx_o,egz, +!$OMP& eby,ebx_o,ebz,eby_o,etx,egz_o,ety,etx_o,etz,ety_o,egx,egy,egy_o,ecx,ebz_o,ecy,ecx_o, +!$OMP& ecz,ecy_o,ecx,ebz_o,ecx_o,ecz,etz_o,ebx) do i=m2,Lch ex_o(i)=ex(i) !CA ey_o(i)=ey(i) diff --git a/BenchmarkD200setsHard60/src/trot_M.f90 b/BenchmarkD200setsHard60/src/trot_M.f90 index bbd8a09..cff06f4 100644 --- a/BenchmarkD200setsHard60/src/trot_M.f90 +++ b/BenchmarkD200setsHard60/src/trot_M.f90 @@ -210,7 +210,15 @@ subroutine trot_M oy(n1)=y(n1) oz(n1)=z(n1) !$acc kernels async(2) -!$OMP target teams distribute parallel do num_teams(1) nowait +!//!$OMP target teams distribute parallel do num_teams(1) !nowait +!!$OMP target enter data map(to: ey,ex,ez,egz, +!!$OMP& eby,ebz,etx,ety,etz,egx,egy,ecx,ecy, +!!$OMP& ecz,ecx,ecz,ebx) +!!$OMP target teams distribute parallel do num_teams(80) !!nowait +!!$OMP& map(tofrom: ey,ex,ex_o,ez_o,ez,ey_o,ecz_o,egx_o,egz, +!!$OMP& eby,ebx_o,ebz,eby_o,etx,egz_o,ety,etx_o,etz,ety_o,egx,egy,egy_o,ecx,ebz_o,ecy,ecx_o, +!!$OMP& ecz,ecy_o,ecx,ebz_o,ecx_o,ecz,etz_o,ebx) +!!$OMP parallel do simd private(i) do i=m2,n2 ex_o(i)=ex(i) !CA ey_o(i)=ey(i) @@ -228,7 +236,8 @@ subroutine trot_M ety_o(i)=ety(i) etz_o(i)=etz(i) enddo -!$OMP end target teams distribute parallel do +!!$OMP end parallel do simd +! !$OMP end target teams distribute parallel do !$acc end kernels c prepare the new path------------> @@ -243,7 +252,11 @@ subroutine trot_M ny(n1)=y(n)-vy(nn(n1)) nz(n1)=z(n)-vz(nn(n1)) !$acc kernels async(2) -!$OMP target teams distribute parallel do num_teams(80) nowait +! !$OMP target enter data map (to:ez,ey,ex,egx,egy,egz,etx,ety,eyz) +! !$OMP target enter data map(alloc:ey_n) !,ez_n) +!$OMP target teams distribute parallel do simd num_teams(80) !nowait +! !$OMP& map(to:ez,ey,ex,egx,egy,egz,etx,ety,eyz) +! !$OMP& map(from:ex_n,ey_n,ez_n) do i=m2,n2 ex_n(i)=ax0+ax+(ex(i)-ax)*a11+(ey(i)-ay)*a12+(ez(i)-az)*a13 !CA ey_n(i)=ay0+ay+(ex(i)-ax)*a21+(ey(i)-ay)*a22+(ez(i)-az)*a23 @@ -261,7 +274,13 @@ subroutine trot_M ety_n(i)=ay0+ay+(etx(i)-ax)*a21+(ety(i)-ay)*a22+(etz(i)-az)*a23 etz_n(i)=az0+az+(etx(i)-ax)*a31+(ety(i)-ay)*a32+(etz(i)-az)*a33 enddo -!$OMP end target teams distribute parallel do +!$OMP end target teams distribute parallel do simd +!!$OMP target exit data map(from: ey,ex,ez,egz, +!!$OMP& eby,ebz,etx,ety,etz,egx,egy,ecx,ecy, +!!$OMP& ecz,ecx,ecz,ebx) +!!$OMP target exit data map (delete:ey_n) !,ez_n) +! !$OMP target exit data map (from:ez,ey,ex,egx,egy,egz,etx,ety,eyz) +! !$OMP target exit data map (delete:ex_n) !,ey_n,ez_n) !$acc end kernels d2=(nx(m1)-ex_n(m3))**2+(ny(m1)-ey_n(m3))**2+(nz(m1)-ez_n(m3))**2 if((d2.lt.23.or.d2.gt.78).and.mbig.eq.0)goto 202 @@ -373,14 +392,17 @@ subroutine trot_M icnto=icnt sumcto=sumct !$acc kernels async(2) +!$OMP parallel do simd !private(pp) do pp=1,Lch nopp(pp)=nop(pp) nomm(pp)=nom(pp) noaa(pp)=noa(pp) enddo +!$OMP end parallel do simd eprofo=eprofn c change the conformation to the new position---------> + do kkk=m,n afs(kkk)=afsn(kkk) !change ifs to the new one enddo diff --git a/BenchmarkD200setsHard60/src/trot_N.f90 b/BenchmarkD200setsHard60/src/trot_N.f90 index 181fdf4..dd94ff2 100644 --- a/BenchmarkD200setsHard60/src/trot_N.f90 +++ b/BenchmarkD200setsHard60/src/trot_N.f90 @@ -1,7 +1,7 @@ subroutine trot_N use params use backup2 - use openacc + !use openacc use chainm use chain1 use echain1 diff --git a/BenchmarkD200setsHard60/src/write_parameter.f90 b/BenchmarkD200setsHard60/src/write_parameter.f90 index 7cfbf57..93a0201 100644 --- a/BenchmarkD200setsHard60/src/write_parameter.f90 +++ b/BenchmarkD200setsHard60/src/write_parameter.f90 @@ -15,7 +15,7 @@ subroutine write_parameter ! common/lengths/Lch,Lch1,Lch2 ! COMMON/RES/ER3,er5,er6,er7,Mcom(ndim),Kcom(ndim,100) ! COMMON/RCN/Mdis(ndim),kdis(ndim,100),dist(ndim,100),dev(ndim,100) - COMMON/RCN1/ER1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) + COMMON/RCN1/er1,arca1(ndim,ndim,50),n_resa1(ndim,ndim) ! common/order/acorder,en2,sumct,sumcto,icnt,icnto,dord,en3 ! common/distres/er4,es3c common/resnumber/Ncom,Ndis,accur