4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.35 2003-10-29 20:41:39 mmeineke Exp $, $Date: 2003-10-29 20:41:39 $, $Name: not supported by cvs2svn $, $Revision: 1.35 $ |
7 |
> |
!! @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 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
46 |
|
public :: setRlistDF |
47 |
|
|
48 |
|
#ifdef PROFILE |
49 |
< |
real(kind = dp) :: forceTime |
50 |
< |
real(kind = dp) :: forceTimeInitial, forceTimeFinal |
51 |
< |
real(kind = dp) :: globalForceTime |
52 |
< |
real(kind = dp) :: maxForceTime |
53 |
< |
integer, save :: nloops = 0 |
49 |
> |
public :: getforcetime |
50 |
> |
real, save :: forceTime = 0 |
51 |
> |
real :: forceTimeInitial, forceTimeFinal |
52 |
|
#endif |
53 |
|
|
54 |
|
contains |
229 |
|
integer :: listerror, error |
230 |
|
integer :: localError |
231 |
|
|
232 |
< |
real(kind=dp) :: listSkin = 1.0 |
235 |
< |
|
232 |
> |
real(kind=dp) :: listSkin = 1.0 |
233 |
|
|
234 |
|
!! initialize local variables |
235 |
|
|
442 |
|
#ifdef IS_MPI |
443 |
|
|
444 |
|
if (update_nlist) then |
448 |
– |
|
445 |
|
!! save current configuration, construct neighbor list, |
446 |
|
!! and calculate forces |
447 |
|
call saveNeighborList(nlocal, q) |
507 |
|
#else |
508 |
|
|
509 |
|
if (update_nlist) then |
510 |
< |
|
510 |
> |
|
511 |
|
! save current configuration, contruct neighbor list, |
512 |
|
! and calculate forces |
513 |
|
call saveNeighborList(natoms, q) |
694 |
|
tau = tau_Temp |
695 |
|
virial = virial_Temp |
696 |
|
endif |
701 |
– |
|
702 |
– |
#endif |
703 |
– |
|
704 |
– |
#ifdef PROFILE |
705 |
– |
if (do_pot) then |
706 |
– |
|
707 |
– |
#ifdef IS_MPI |
708 |
– |
|
709 |
– |
|
710 |
– |
call printCommTime() |
697 |
|
|
712 |
– |
call mpi_allreduce(forceTime,globalForceTime,1,MPI_DOUBLE_PRECISION, & |
713 |
– |
mpi_sum,mpi_comm_world,mpi_err) |
714 |
– |
|
715 |
– |
call mpi_allreduce(forceTime,maxForceTime,1,MPI_DOUBLE_PRECISION, & |
716 |
– |
MPI_MAX,mpi_comm_world,mpi_err) |
717 |
– |
|
718 |
– |
call mpi_comm_size( MPI_COMM_WORLD, nprocs,mpi_err) |
719 |
– |
|
720 |
– |
if (getMyNode() == 0) then |
721 |
– |
write(*,*) "Total processor time spent in force calculations is: ", globalForceTime |
722 |
– |
write(*,*) "Total Time spent in force loop per processor is: ", globalforceTime/nprocs |
723 |
– |
write(*,*) "Maximum force time on any processor is: ", maxForceTime |
724 |
– |
end if |
725 |
– |
#else |
726 |
– |
write(*,*) "Time spent in force loop is: ", forceTime |
698 |
|
#endif |
699 |
|
|
700 |
|
|
1091 |
|
doesit = FF_uses_RF |
1092 |
|
end function FF_RequiresPostpairCalc |
1093 |
|
|
1094 |
+ |
#ifdef PROFILE |
1095 |
+ |
function getforcetime() return(totalforcetime) |
1096 |
+ |
real(kind=dp) :: totalforcetime |
1097 |
+ |
totalforcetime = forcetime |
1098 |
+ |
end function getforcetime |
1099 |
+ |
#endif |
1100 |
+ |
|
1101 |
|
!! This cleans componets of force arrays belonging only to fortran |
1102 |
|
|
1103 |
|
end module do_Forces |