From: Cezary Czaplewski Date: Thu, 22 Mar 2018 08:06:02 +0000 (+0100) Subject: parallel DFA_D DFA_T DFA_N X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?p=unres.git;a=commitdiff_plain;h=8ce83721deb9f9dd5a0046d56bc35b026b9e8bc8 parallel DFA_D DFA_T DFA_N DFA_B (beta formation) not parallel works only with FGPROCS=1 it is not used in the newest DFA --- diff --git a/source/unres/src_MD/CMakeLists.txt b/source/unres/src_MD/CMakeLists.txt index 533c3a5..3a34912 100644 --- a/source/unres/src_MD/CMakeLists.txt +++ b/source/unres/src_MD/CMakeLists.txt @@ -203,7 +203,8 @@ set(UNRES_MD_PP_SRC test.F thread.F timing.F - unres.F + unres.F + dfa.F proc_proc.c ) diff --git a/source/unres/src_MD/COMMON.DFA b/source/unres/src_MD/COMMON.DFA index c6add4f..67a1a0d 100644 --- a/source/unres/src_MD/COMMON.DFA +++ b/source/unres/src_MD/COMMON.DFA @@ -67,6 +67,16 @@ C NMAP - mapping between dfanum and ndis, nphi, nthe, nnei & KDISNUM(IDFAMAX), & NCA, ICAIDX(MAXRES) COMMON /IDFA2/ ishiftca,ilastca +c parallel + integer idfadis_start,idfadis_end, + & idfaphi_start,idfaphi_end, + & idfathe_start,idfathe_end, + & idfanei_start,idfanei_end + COMMON /dfa_mpi/ idfadis_start,idfadis_end, + & idfaphi_start,idfaphi_end, + & idfathe_start,idfathe_end, + & idfanei_start,idfanei_end + CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C diff --git a/source/unres/src_MD/dfa.F b/source/unres/src_MD/dfa.F index 66e1ccb..412943a 100644 --- a/source/unres/src_MD/dfa.F +++ b/source/unres/src_MD/dfa.F @@ -75,6 +75,8 @@ C include 'COMMON.CHAIN' include 'COMMON.DFA' include 'COMMON.FFIELD' + include 'COMMON.CONTROL' + include 'COMMON.SETUP' C NOTE THAT FILENAMES are FIXED, CURRENTLY!! @@ -240,6 +242,36 @@ C write(*,*) 'READ NEI:',i,j,fnei(i,j) close(iodfa) C END OF NEIGHBORING CA +C init parallel +C BETA is not parallel ! +#ifdef MPI + if (wdfa_beta.ne.0.0 .and. nfgtasks.gt.1) then + write (iout,*) "ERRROR dfa_beta works only for FGPROCS=1" + print *,"ERRROR dfa_beta works only for FGPROCS=1" + stop + endif + call int_bounds(idfadis,idfadis_start,idfadis_end) + call int_bounds(idfaphi,idfaphi_start,idfaphi_end) + call int_bounds(idfathe,idfathe_start,idfathe_end) + call int_bounds(idfanei,idfanei_start,idfanei_end) + if (me.eq.king .or. .not. out1file) + & write (iout,*) "DFA MPI ", + & "idfadis ",idfadis,idfadis_start,idfadis_end, + & "idfaphi ",idfaphi,idfaphi_start,idfaphi_end, + & "idfathe ",idfathe,idfathe_start,idfathe_end, + & "idfanei ",idfanei,idfanei_start,idfanei_end +#else + idfadis_start=1 + idfadis_end=idfadis + idfaphi_start=1 + idfaphi_end=idfaphi + idfathe_start=1 + idfathe_end=idfathe + idfanei_start=1 + idfanei_end=idfanei +#endif + + C READ BETA RESTRAINT if (wdfa_beta.eq.0.0) return open(iodfa, file='beta_dfa.dat',status='old',err=39) @@ -265,6 +297,7 @@ c write(*,*) 'BETA:',i,j,wtmp,wshet(i,j) close(iodfa) C END OF BETA RESTRAINT + return END @@ -285,7 +318,7 @@ C END OF BETA RESTRAINT edfadis=0 gdfad=0.0d0 - do i=1, idfadis + do i=idfadis_start,idfadis_end iatm1=idislis(1,i)+ishiftca iatm2=idislis(2,i)+ishiftca @@ -368,7 +401,7 @@ C DFA torsion angle gdfat(:,:) = 0.0d0 C START OF PHI ANGLE - do i=1, idfaphi + do i=idfaphi_start,idfaphi_end aphi = 0.0d0 do iii=1,5 @@ -567,7 +600,7 @@ c end of single assignment statement C END OF PHI RESTRAINT C START OF THETA ANGLE - do i=1, idfathe + do i=idfathe_start,idfathe_end athe = 0.0d0 do iii=1,5 @@ -801,7 +834,7 @@ C DFA neighboring CA restraint c print*, 's1:', s1(:) c print*, 's2:', s2(:) - do i=1, idfanei + do i=idfanei_start,idfanei_end kshnum=kshell(i) n1atom=ineilis(i)+ishiftca