4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.28 2003-08-08 21:22:37 chuckv Exp $, $Date: 2003-08-08 21:22:37 $, $Name: not supported by cvs2svn $, $Revision: 1.28 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.36 2003-10-30 18:59:20 gezelter Exp $, $Date: 2003-10-30 18:59:20 $, $Name: not supported by cvs2svn $, $Revision: 1.36 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
45 |
|
public :: do_force_loop |
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 |
54 |
+ |
#endif |
55 |
+ |
|
56 |
|
contains |
57 |
|
|
58 |
|
subroutine setRlistDF( this_rlist ) |
154 |
|
|
155 |
|
|
156 |
|
if (FF_uses_EAM) then |
157 |
< |
call init_EAM_FF(my_status) |
157 |
> |
call init_EAM_FF(my_status) |
158 |
|
if (my_status /= 0) then |
159 |
+ |
write(*,*) "init_EAM_FF returned a bad status" |
160 |
|
thisStat = -1 |
161 |
|
return |
162 |
|
end if |
215 |
|
real( kind = DP ) :: pot_local |
216 |
|
integer :: nrow |
217 |
|
integer :: ncol |
218 |
+ |
integer :: nprocs |
219 |
|
#endif |
220 |
|
integer :: nlocal |
221 |
|
integer :: natoms |
231 |
|
integer :: listerror, error |
232 |
|
integer :: localError |
233 |
|
|
234 |
< |
real(kind=dp) :: listSkin = 1.0 |
225 |
< |
|
234 |
> |
real(kind=dp) :: listSkin = 1.0 |
235 |
|
|
236 |
|
!! initialize local variables |
237 |
|
|
273 |
|
endif |
274 |
|
|
275 |
|
#endif |
276 |
+ |
|
277 |
+ |
!! Begin force loop timing: |
278 |
+ |
#ifdef PROFILE |
279 |
+ |
call cpu_time(forceTimeInitial) |
280 |
+ |
nloops = nloops + 1 |
281 |
+ |
#endif |
282 |
|
|
283 |
|
if (FF_RequiresPrepairCalc() .and. SimRequiresPrepairCalc()) then |
284 |
|
!! See if we need to update neighbor lists |
578 |
|
#endif |
579 |
|
|
580 |
|
! phew, done with main loop. |
581 |
< |
|
581 |
> |
|
582 |
> |
!! Do timing |
583 |
> |
#ifdef PROFILE |
584 |
> |
call cpu_time(forceTimeFinal) |
585 |
> |
forceTime = forceTime + forceTimeFinal - forceTimeInitial |
586 |
> |
#endif |
587 |
> |
|
588 |
> |
|
589 |
|
#ifdef IS_MPI |
590 |
|
!!distribute forces |
591 |
|
|
699 |
|
endif |
700 |
|
|
701 |
|
#endif |
702 |
< |
|
702 |
> |
|
703 |
> |
#ifdef PROFILE |
704 |
> |
if (do_pot) then |
705 |
> |
|
706 |
> |
#ifdef IS_MPI |
707 |
> |
|
708 |
> |
|
709 |
> |
call printCommTime() |
710 |
> |
|
711 |
> |
call mpi_allreduce(forceTime,globalForceTime,1,MPI_DOUBLE_PRECISION, & |
712 |
> |
mpi_sum,mpi_comm_world,mpi_err) |
713 |
> |
|
714 |
> |
call mpi_allreduce(forceTime,maxForceTime,1,MPI_DOUBLE_PRECISION, & |
715 |
> |
MPI_MAX,mpi_comm_world,mpi_err) |
716 |
> |
|
717 |
> |
call mpi_comm_size( MPI_COMM_WORLD, nprocs,mpi_err) |
718 |
> |
|
719 |
> |
if (getMyNode() == 0) then |
720 |
> |
write(*,*) "Total processor time spent in force calculations is: ", globalForceTime |
721 |
> |
write(*,*) "Total Time spent in force loop per processor is: ", globalforceTime/nprocs |
722 |
> |
write(*,*) "Maximum force time on any processor is: ", maxForceTime |
723 |
> |
end if |
724 |
> |
#else |
725 |
> |
write(*,*) "Time spent in force loop is: ", forceTime |
726 |
> |
#endif |
727 |
> |
|
728 |
> |
|
729 |
> |
endif |
730 |
> |
|
731 |
> |
#endif |
732 |
> |
|
733 |
|
end subroutine do_force_loop |
734 |
|
|
735 |
|
subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot) |
782 |
|
call getElementProperty(atypes, me_j, "is_DP", is_DP_j) |
783 |
|
|
784 |
|
if ( is_DP_i .and. is_DP_j ) then |
733 |
– |
|
785 |
|
call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, & |
786 |
|
do_pot, do_stress) |
787 |
|
if (FF_uses_RF .and. SimUsesRF()) then |
806 |
|
|
807 |
|
if (FF_uses_GB .and. SimUsesGB()) then |
808 |
|
|
809 |
+ |
|
810 |
|
call getElementProperty(atypes, me_i, "is_GB", is_GB_i) |
811 |
|
call getElementProperty(atypes, me_j, "is_GB", is_GB_j) |
812 |
|
|