--- trunk/OOPSE/libmdtools/do_Forces.F90 2003/08/26 20:37:30 726 +++ trunk/OOPSE/libmdtools/do_Forces.F90 2003/12/18 20:46:45 883 @@ -4,7 +4,7 @@ !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: do_Forces.F90,v 1.30 2003-08-26 20:37:30 tim Exp $, $Date: 2003-08-26 20:37:30 $, $Name: not supported by cvs2svn $, $Revision: 1.30 $ +!! @version $Id: do_Forces.F90,v 1.38 2003-12-18 20:46:45 chuckv Exp $, $Date: 2003-12-18 20:46:45 $, $Name: not supported by cvs2svn $, $Revision: 1.38 $ module do_Forces use force_globals @@ -46,11 +46,9 @@ module do_Forces public :: setRlistDF #ifdef PROFILE - real(kind = dp) :: forceTime - real(kind = dp) :: forceTimeInitial, forceTimeFinal - real(kind = dp) :: globalForceTime - real(kind = dp) :: maxForceTime - integer, save :: nloops = 0 + public :: getforcetime + real, save :: forceTime = 0 + real :: forceTimeInitial, forceTimeFinal #endif contains @@ -154,8 +152,9 @@ contains if (FF_uses_EAM) then - call init_EAM_FF(my_status) + call init_EAM_FF(my_status) if (my_status /= 0) then + write(*,*) "init_EAM_FF returned a bad status" thisStat = -1 return end if @@ -230,8 +229,7 @@ contains integer :: listerror, error integer :: localError - real(kind=dp) :: listSkin = 1.0 - + real(kind=dp) :: listSkin = 1.0 !! initialize local variables @@ -444,7 +442,6 @@ contains #ifdef IS_MPI if (update_nlist) then - !! save current configuration, construct neighbor list, !! and calculate forces call saveNeighborList(nlocal, q) @@ -510,7 +507,7 @@ contains #else if (update_nlist) then - + ! save current configuration, contruct neighbor list, ! and calculate forces call saveNeighborList(natoms, q) @@ -700,38 +697,11 @@ contains #endif -#ifdef PROFILE - if (do_pot) then - -#ifdef IS_MPI - - - call printCommTime() - - call mpi_allreduce(forceTime,globalForceTime,1,MPI_DOUBLE_PRECISION, & - mpi_sum,mpi_comm_world,mpi_err) - - call mpi_allreduce(forceTime,maxForceTime,1,MPI_DOUBLE_PRECISION, & - MPI_MAX,mpi_comm_world,mpi_err) - - call mpi_comm_size( MPI_COMM_WORLD, nprocs,mpi_err) - - if (getMyNode() == 0) then - write(*,*) "Total processor time spent in force calculations is: ", globalForceTime - write(*,*) "Total Time spent in force loop per processor is: ", globalforceTime/nprocs - write(*,*) "Maximum force time on any processor is: ", maxForceTime - end if -#else - write(*,*) "Time spent in force loop is: ", forceTime -#endif - endif #endif - - end subroutine do_force_loop subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot) @@ -1121,6 +1091,13 @@ contains doesit = FF_uses_RF end function FF_RequiresPostpairCalc +#ifdef PROFILE + function getforcetime() return(totalforcetime) + real(kind=dp) :: totalforcetime + totalforcetime = forcetime + end function getforcetime +#endif + !! This cleans componets of force arrays belonging only to fortran end module do_Forces