X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2Fsrc_MD-M%2Funres.F;h=0e924f7171a12cec203fe6e1de9adab17446d445;hb=3fd69a41cf75b35e1e548083592cbf11b98d33f7;hp=ff1d5720d67651a48eed6bcd15f6478361b369c9;hpb=478a9d9a1c99eb3f4bc4ca676ff3162bdd01d633;p=unres.git diff --git a/source/unres/src_MD-M/unres.F b/source/unres/src_MD-M/unres.F index ff1d572..0e924f7 100644 --- a/source/unres/src_MD-M/unres.F +++ b/source/unres/src_MD-M/unres.F @@ -52,7 +52,7 @@ c call memmon_print_usage() call init_task if (me.eq.king) - & write(iout,*)'### LAST MODIFIED 4/25/08 7:29PM by adam' + & write(iout,*)'### LAST MODIFIED 11/22/15 10:36PM by czarek' if (me.eq.king) call cinfo C Read force field parameters and job setup data call readrtns @@ -103,7 +103,12 @@ C Fine-grain slaves just do energy and gradient components. else if (modecalc.eq.12) then call exec_MD else if (modecalc.eq.14) then +#ifdef MPI call exec_MREMD +#else + write (iout,*) "Need a parallel version to run MREMD." + stop +#endif else write (iout,'(a)') 'This calculation type is not supported', & ModeCalc @@ -139,6 +144,7 @@ c-------------------------------------------------------------------------- return end c--------------------------------------------------------------------------- +#ifdef MPI subroutine exec_MREMD include 'DIMENSIONS' #ifdef MPI @@ -163,6 +169,7 @@ c--------------------------------------------------------------------------- endif return end +#endif c--------------------------------------------------------------------------- subroutine exec_eeval_or_minim implicit real*8 (a-h,o-z) @@ -188,9 +195,21 @@ c--------------------------------------------------------------------------- common /srutu/ icall double precision energy(0:n_ene) double precision energy_long(0:n_ene),energy_short(0:n_ene) - if (indpdb.eq.0) call chainbuild + double precision varia(maxvar) + if (indpdb.eq.0) call chainbuild + print *,'dc',c(1,1) + if (indpdb.ne.0) then + dc(1,0)=c(1,1) + dc(2,0)=c(2,1) + dc(3,0)=c(3,1) + endif +#ifdef MPI time00=MPI_Wtime() +#else + time00=tcpu() +#endif call chainbuild_cart + print *,'dc',dc(1,0),dc(2,0),dc(3,0) if (split_ene) then print *,"Processor",myrank," after chainbuild" icall=1 @@ -208,14 +227,20 @@ c--------------------------------------------------------------------------- call enerprint(energy(0)) endif call etotal(energy(0)) +#ifdef MPI time_ene=MPI_Wtime()-time00 +#else + time_ene=tcpu()-time00 +#endif write (iout,*) "Time for energy evaluation",time_ene print *,"after etotal" etota = energy(0) etot =etota call enerprint(energy(0)) call hairpin(.true.,nharp,iharp) + print *,'after hairpin' call secondary2(.true.) + print *,'after secondary' if (minim) then crc overlap test if (overlapsc) then @@ -231,7 +256,11 @@ crc overlap test if (dccart) then print *, 'Calling MINIM_DC' +#ifdef MPI time1=MPI_WTIME() +#else + time1=tcpu() +#endif call minim_dc(etot,iretcode,nfun) else if (indpdb.ne.0) then @@ -240,15 +269,25 @@ crc overlap test endif call geom_to_var(nvar,varia) print *,'Calling MINIMIZE.' +#ifdef MPI time1=MPI_WTIME() +#else + time1=tcpu() +#endif call minimize(etot,varia,iretcode,nfun) endif print *,'SUMSL return code is',iretcode,' eval ',nfun +#ifdef MPI evals=nfun/(MPI_WTIME()-time1) +#else + evals=nfun/(tcpu()-time1) +#endif print *,'# eval/s',evals print *,'refstr=',refstr - call hairpin(.true.,nharp,iharp) + call hairpin(.false.,nharp,iharp) + print *,'after hairpin' call secondary2(.true.) + print *,'after secondary' call etotal(energy(0)) etot = energy(0) call enerprint(energy(0)) @@ -599,18 +638,18 @@ c Broadcast the order to compute internal coordinates to the slaves. write (istat,'(a5,20a12)')"# ", & (wname(print_order(i)),i=1,nprint_ene) write (istat,'("# ",20(1pe12.4))') - (weights(print_order(i)),i=1,nprint_ene) + & (weights(print_order(i)),i=1,nprint_ene) if (refstr) then write (istat,'(a5,20a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene), - & ,"ETOT total","RMSD","nat.contact","nnt.contact" + & "ETOT total","RMSD","nat.contact","nnt.contact" else write (istat,'(a5,14a12)')"# ", & (ename(print_order(i)),i=1,nprint_ene),"ETOT total" endif do while (.not. eof) if (read_cart) then - read (intin,'(e15.10,e15.5)',end=1100,err=1100) time,ene + read (intin,'(e15.10,e15.5)',end=11,err=11) time,ene call read_x(intin,*11) #ifdef MPI c Broadcast the order to compute internal coordinates to the slaves. @@ -619,7 +658,7 @@ c Broadcast the order to compute internal coordinates to the slaves. #endif call int_from_cart1(.false.) else - read (intin,'(i5)',end=1100,err=1100) iconf + read (intin,'(i5)',end=11,err=11) iconf call read_angles(intin,*11) call geom_to_var(nvar,varia) call chainbuild @@ -691,10 +730,12 @@ c enddo c do j=1,3 c dc(j,0)=ran_number(-0.2d0,0.2d0) c enddo + if (constr_homology.eq.0) then usampl=.true. totT=1.d0 eq_time=0.0d0 call read_fragments + endif call chainbuild_cart call cartprint call intout