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.32 2003-10-28 16:03:35 gezelter Exp $, $Date: 2003-10-28 16:03:35 $, $Name: not supported by cvs2svn $, $Revision: 1.32 $ |
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 ) |
129 |
|
if (FF_uses_LJ) then |
130 |
|
|
131 |
|
select case (LJMIXPOLICY) |
132 |
< |
case (LB_MIXING_RULE) |
133 |
< |
call init_lj_FF(LB_MIXING_RULE, my_status) |
134 |
< |
case (EXPLICIT_MIXING_RULE) |
135 |
< |
call init_lj_FF(EXPLICIT_MIXING_RULE, my_status) |
132 |
> |
case (1) |
133 |
> |
call init_lj_FF(1, my_status) |
134 |
> |
case (2) |
135 |
> |
call init_lj_FF(2, my_status) |
136 |
|
case default |
137 |
|
write(default_error,*) 'unknown LJ Mixing Policy!' |
138 |
|
thisStat = -1 |
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 |
273 |
|
call gather(A,A_Col,plan_col_rotation) |
274 |
|
endif |
275 |
|
|
276 |
+ |
#endif |
277 |
+ |
|
278 |
+ |
!! Begin force loop timing: |
279 |
+ |
#ifdef PROFILE |
280 |
+ |
call cpu_time(forceTimeInitial) |
281 |
+ |
nloops = nloops + 1 |
282 |
|
#endif |
283 |
|
|
284 |
|
if (FF_RequiresPrepairCalc() .and. SimRequiresPrepairCalc()) then |
579 |
|
#endif |
580 |
|
|
581 |
|
! phew, done with main loop. |
582 |
< |
|
582 |
> |
|
583 |
> |
!! Do timing |
584 |
> |
#ifdef PROFILE |
585 |
> |
call cpu_time(forceTimeFinal) |
586 |
> |
forceTime = forceTime + forceTimeFinal - forceTimeInitial |
587 |
> |
#endif |
588 |
> |
|
589 |
> |
|
590 |
|
#ifdef IS_MPI |
591 |
|
!!distribute forces |
592 |
|
|
700 |
|
endif |
701 |
|
|
702 |
|
#endif |
703 |
< |
|
703 |
> |
|
704 |
> |
#ifdef PROFILE |
705 |
> |
if (do_pot) then |
706 |
> |
|
707 |
> |
#ifdef IS_MPI |
708 |
> |
|
709 |
> |
|
710 |
> |
call printCommTime() |
711 |
> |
|
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 |
727 |
> |
#endif |
728 |
> |
|
729 |
> |
|
730 |
> |
endif |
731 |
> |
|
732 |
> |
#endif |
733 |
> |
|
734 |
> |
|
735 |
> |
|
736 |
|
end subroutine do_force_loop |
737 |
|
|
738 |
|
subroutine do_pair(i, j, rijsq, d, do_pot, do_stress, u_l, A, f, t, pot) |
785 |
|
call getElementProperty(atypes, me_j, "is_DP", is_DP_j) |
786 |
|
|
787 |
|
if ( is_DP_i .and. is_DP_j ) then |
733 |
– |
|
788 |
|
call do_dipole_pair(i, j, d, r, rijsq, pot, u_l, f, t, & |
789 |
|
do_pot, do_stress) |
790 |
|
if (FF_uses_RF .and. SimUsesRF()) then |
809 |
|
|
810 |
|
if (FF_uses_GB .and. SimUsesGB()) then |
811 |
|
|
812 |
+ |
|
813 |
|
call getElementProperty(atypes, me_i, "is_GB", is_GB_i) |
814 |
|
call getElementProperty(atypes, me_j, "is_GB", is_GB_j) |
815 |
|
|