X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_CSA%2Ftogether.F;fp=source%2Funres%2Fsrc_CSA%2Ftogether.F;h=8bc9d7a4b7215c336513a58ef6ba42cabdedb696;hb=0a11a2c4ccee14ed99ae44f2565b270ba8d4bbb6;hp=558dbad53fb0577f8bbf77a6c5917b5a66c7155b;hpb=5eb407964903815242c59de10960f42761139e10;p=unres.git diff --git a/source/unres/src_CSA/together.F b/source/unres/src_CSA/together.F index 558dbad..8bc9d7a 100644 --- a/source/unres/src_CSA/together.F +++ b/source/unres/src_CSA/together.F @@ -1,3 +1,4 @@ +#ifdef MPI Subroutine together c feeds tasks for parallel processing implicit real*8 (a-h,o-z) @@ -210,6 +211,8 @@ c Output to $mol.reminimized if (irestart.eq.1) goto 111 c soldier - perform energy minimization 334 call minim_jlee + + ENDIF ccccccccccccccccccccccccccccccccccc @@ -309,12 +312,17 @@ c call find_max call find_min - - call get_diff + + if (tm_score) then + call get_diff_p + else + call get_diff + endif if(nbank.eq.nconf.and.irestart.eq.0) then adif=avedif endif + write (iout,*) "AVEDIF",avedif cutdif=adif/cut1 ctdif1=adif/cut2 @@ -401,6 +409,27 @@ ct print *,'waiting ',MPI_WTIME() irecv=irecv+1 call recv(0,ifrom,xout,eout,ind,timeout) ct print *,' ',irecv,' received from',ifrom,MPI_WTIME() + + if(tm_score) then + nft=nft+ind(3) + movernx(irecv)=iabs(ind(5)) + call getx(ind,xout,eout,cout,rad,iw_pdb,irecv) + if(vdisulf) then + nss_out(irecv)=nss + do i=1,nss + iss_out(i,irecv)=ihpb(i) + jss_out(i,irecv)=jhpb(i) + enddo + endif + if(iw_pdb.gt.0) + & call write_csa_pdb(xout,eout,nft,irecv,iw_pdb) + endif + + if(tm_score.and.eout(1).lt.ebmax) then + if(iref.eq.0 .or. + & (rmsn(irecv).le.rmscut.and.pncn(irecv).ge.pnccut)) + & call refresh_bank_master_tmscore(ifrom,eout(1),irecv) + endif else ifrom=ifrom+1 endif @@ -410,7 +439,7 @@ ct print *,'sending to',ifrom,MPI_WTIME() ct print *,isent,' sent ',MPI_WTIME() c store results ----------------------------------------------- - if (isent.ge.nodes.or.iter.gt.0) then + if ((isent.ge.nodes.or.iter.gt.0).and..not.tm_score) then nft=nft+ind(3) movernx(irecv)=iabs(ind(5)) call getx(ind,xout,eout,cout,rad,iw_pdb,irecv) @@ -443,7 +472,18 @@ c-------------------------------------------------------------- iter=iter+1 c----------------- call update(ntry-nodes+1) ------------------- nstep=nstep+ntry-nseed-(nodes-1) - call refresh_bank(ntry-nodes+1) + if (tm_score) then +ctm call refresh_bank(ntry) + call print_mv_stat + do i=0,mxmv + do j=1,3 + nstatnx_tot(i,j)=nstatnx_tot(i,j)+nstatnx(i,j) + nstatnx(i,j)=0 + enddo + enddo + else + call refresh_bank(ntry-nodes+1) + endif c!bankt call refresh_bankt(ntry-nodes+1) else c----------------- call update(ntry) --------------------------- @@ -451,7 +491,18 @@ c----------------- call update(ntry) --------------------------- print *,'UPDATING ',ntry,irecv write(iout,*) 'UPDATING ',ntry nstep=nstep+ntry-nseed - call refresh_bank(ntry) + if (tm_score) then +ctm call refresh_bank(ntry) + call print_mv_stat + do i=0,mxmv + do j=1,3 + nstatnx_tot(i,j)=nstatnx_tot(i,j)+nstatnx(i,j) + nstatnx(i,j)=0 + enddo + enddo + else + call refresh_bank(ntry) + endif c!bankt call refresh_bankt(ntry) endif c----------------------------------------------------------------- @@ -611,6 +662,9 @@ c!bankt call write_bankt(jlee,nft) irecv=0 endif ELSE + if (tm_score) then + call get_diff_p + endif c soldier - perform energy minimization call minim_jlee print *,'End of minim, proc',me,'time ',MPI_WTIME()-time_start @@ -665,6 +719,17 @@ cccccccccccccccccccccccccccccc return end +#else + Subroutine together +c feeds tasks for parallel processing + implicit real*8 (a-h,o-z) + include 'DIMENSIONS' + include 'COMMON.IOUNITS' + write (iout,*) "Unsupported option for the serial version" + return + end +#endif +#ifdef MPI c------------------------------------------------- subroutine feedin(nconf,nft) c sends out starting conformations and receives results of energy minimization @@ -1206,6 +1271,7 @@ c halt soldier c print *,'sending halt to ',man write(iout,*) 'sending halt to ',man info(1)=0 + info(2)=0 call mpi_send(info,12,mpi_integer,man,idint,CG_COMM,ierr) endif return @@ -1224,3 +1290,4 @@ c---------------------------------------------------------- #endif return end +#endif