1 C $Date: 1994/10/05 16:41:52 $
10 include 'COMMON.TIME1'
14 C Diminish the assigned time limit a little so that there is some time to
17 C Calculate the initial time, if it is not zero (e.g. for the SUN).
27 time_scatter_fmat=0.0d0
28 time_scatter_ginv=0.0d0
29 time_scatter_fmatmult=0.0d0
30 time_scatter_ginvmult=0.0d0
36 time_sumgradient=0.0d0
37 time_intcartderiv=0.0d0
40 time_fricmatmult=0.0d0
50 time_fricmatmult=0.0d0
58 time_eelec_short=0.0d0
66 cd print *,' in SET_TIMERS stime=',stime
69 C------------------------------------------------------------------------------
70 logical function stopx(nf)
71 C This function returns .true. if one of the following reasons to exit SUMSL
72 C occurs. The "reason" code is stored in WHATSUP passed thru a COMMON block:
74 C... WHATSUP = 0 - go on, no reason to stop. Stopx will return .false.
75 C... 1 - Time up in current node;
76 C... 2 - STOP signal was received from another node because the
77 C... node's task was accomplished (parallel only);
78 C... -1 - STOP signal was received from another node because of error;
79 C... -2 - STOP signal was received from another node, because
80 C... the node's time was up.
89 include 'COMMON.IOUNITS'
90 include 'COMMON.TIME1'
93 cd print *,'Processor',MyID,' NF=',nf
96 C Finish if time is up.
100 else if (mod(nf,100).eq.0) then
101 C Other processors might have finished. Check this every 100th function
103 C Master checks if any other processor has sent accepted conformation(s) to it.
104 if (MyID.ne.MasterID) call receive_mcm_info
105 if (MyID.eq.MasterID) call receive_conf
106 cd print *,'Processor ',MyID,' is checking STOP: nf=',nf
107 call recv_stop_sig(Kwita)
108 if (Kwita.eq.-1) then
109 write (iout,'(a,i4,a,i5)') 'Processor',
110 & MyID,' has received STOP signal in STOPX; NF=',nf
111 write (*,'(a,i4,a,i5)') 'Processor',
112 & MyID,' has received STOP signal in STOPX; NF=',nf
115 elseif (Kwita.eq.-2) then
117 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
119 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
122 else if (Kwita.eq.-3) then
124 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
126 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
143 c Check for FOUND_NAN flag
145 write(iout,*)" *** stopx : Found a NaN"
152 C--------------------------------------------------------------------------
153 logical function ovrtim()
156 include 'COMMON.IOUNITS'
157 include 'COMMON.TIME1'
161 curtim = MPI_Wtime()-walltime
165 C curtim is the current time in seconds.
166 c write (iout,*) "curtim",curtim," timlim",timlim," safety",safety
167 if (curtim .ge. timlim - safety) then
168 write (iout,'(a,f10.2,a,f10.2,a,f10.2,a)')
169 & "***************** Elapsed time (",curtim,
170 & " s) is within the safety limit (",safety,
171 & " s) of the allocated time (",timlim," s). Terminating."
178 **************************************************************************
179 double precision function tcpu()
181 include 'COMMON.TIME1'
182 double precision seconds
184 ****************************
185 C Next definition for EAGLE (ibm-es9000)
188 tcpu=cputime(micseconds,rcode)
189 tcpu=(micseconds/1.0E6) - stime
190 ****************************
193 ****************************
194 C Next definitions for sun
195 REAL*8 ECPU,ETIME,ETCPU
199 ****************************
202 ****************************
203 C Next definitions for ksr
204 C this function uses the ksr timer ALL_SECONDS from the PMON library to
205 C return the elapsed time in seconds
206 tcpu= all_seconds() - stime
207 ****************************
210 ****************************
211 C Next definitions for sgi
213 seconds = etime(timar)
214 Cd print *,'seconds=',seconds,' stime=',stime
218 ****************************
222 ****************************
223 C Next definitions for sgi
225 seconds = etime(timar)
226 Cd print *,'seconds=',seconds,' stime=',stime
230 ****************************
235 ****************************
236 C Next definitions for Cray
243 ****************************
246 ****************************
247 C Next definitions for RS6000
250 tcpu = (i1+0.0D0)/100.0D0
253 ****************************
254 c next definitions for windows NT Digital fortran
256 call cpu_time(time_real)
260 ****************************
261 c next definitions for windows NT Digital fortran
263 call cpu_time(time_real)
269 C---------------------------------------------------------------------------
270 subroutine dajczas(rntime,hrtime,mintime,sectime)
272 include 'COMMON.IOUNITS'
273 real*8 rntime,hrtime,mintime,sectime
275 hrtime=rntime/3600.0D0
277 mintime=dint((rntime-3600.0D0*hrtime)/60.0D0)
278 sectime=dint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
279 if (sectime.eq.60.0D0) then
281 mintime=mintime+1.0D0
286 write (iout,328) ihr,imn,isc
287 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
288 1 ' minutes ', I2 ,' seconds *****')
291 C---------------------------------------------------------------------------
292 subroutine print_detailed_timing
297 double precision time1
299 include 'COMMON.IOUNITS'
300 include 'COMMON.TIME1'
301 include 'COMMON.SETUP'
305 write (iout,'(80(1h=)/a/(80(1h=)))')
306 & "Details of FG communication time"
307 write (*,'(7(a40,1pe15.5/),40(1h-)/a40,1pe15.5/80(1h=))')
308 & "BROADCAST:",time_bcast,"REDUCE:",time_reduce,
309 & "GATHER:",time_gather,
310 & "SCATTER:",time_scatter,"SENDRECV:",time_sendrecv,
311 & "BARRIER ene",time_barrier_e,
312 & "BARRIER grad",time_barrier_g,
314 & time_bcast+time_reduce+time_gather+time_scatter+time_sendrecv
315 write (*,*) fg_rank,myrank,
316 & ': Total wall clock time',time1-walltime,' sec'
317 write (*,*) "Processor",fg_rank,myrank,
318 & ": BROADCAST time",time_bcast," REDUCE time",
319 & time_reduce," GATHER time",time_gather," SCATTER time",
321 & " SCATTER fmatmult",time_scatter_fmatmult,
322 & " SCATTER ginvmult",time_scatter_ginvmult,
323 & " SCATTER fmat",time_scatter_fmat,
324 & " SCATTER ginv",time_scatter_ginv,
325 & " SENDRECV",time_sendrecv,
326 & " BARRIER ene",time_barrier_e,
327 & " BARRIER GRAD",time_barrier_g,
328 & " BCAST7",time_bcast7," BCASTC",time_bcastc,
329 & " BCASTW",time_bcastw," ALLREDUCE",time_allreduce,
331 & time_bcast+time_reduce+time_gather+time_scatter+
332 & time_sendrecv+time_barrier_g+time_barrier_e+time_bcastc
333 write (*,*) "Processor",fg_rank,myrank," enecalc",time_enecalc
336 write (*,*) "Processor",fg_rank,myrank," evdw_long",
338 write (*,*) "Processor",fg_rank,myrank," evdw_short",
340 write (*,*) "Processor",fg_rank,myrank," eelec_long",
342 write (*,*) "Processor",fg_rank,myrank," eelec_short",
344 write (*,*) "Processor",fg_rank,myrank," escp_long",
346 write (*,*) "Processor",fg_rank,myrank," escp_short",
349 write (*,*) "Processor",fg_rank,myrank," evdw",time_evdw
350 write (*,*) "Processor",fg_rank,myrank," eelec",time_eelec
351 write (*,*) "Processor",fg_rank,myrank," escp",time_escp
352 write (*,*) "Processor",fg_rank,myrank," escpsetup",
354 write (*,*) "Processor",fg_rank,myrank," escpcalc",
358 write (*,*) "Processor",fg_rank,myrank," sumene",time_sumene
359 write (*,*) "Processor",fg_rank,myrank," intfromcart",
361 write (*,*) "Processor",fg_rank,myrank," vecandderiv",
363 write (*,*) "Processor",fg_rank,myrank," setmatrices",
365 write (*,*) "Processor",fg_rank,myrank," ginvmult",
367 write (*,*) "Processor",fg_rank,myrank," fricmatmult",
369 write (*,*) "Processor",fg_rank,myrank," inttocart",
371 write (*,*) "Processor",fg_rank,myrank," sumgradient",
373 write (*,*) "Processor",fg_rank,myrank," intcartderiv",
375 if (fg_rank.eq.0) then
376 write (*,*) "Processor",fg_rank,myrank," lagrangian",
378 write (*,*) "Processor",fg_rank,myrank," cartgrad",
381 write (*,*) "Processor",fg_rank,myrank," SAXS",time_SAXS
383 write (*,*) "enecalc",time_enecalc
384 write (*,*) "sumene",time_sumene
385 write (*,*) "intfromcart",time_intfcart
386 write (*,*) "vecandderiv",time_vec
387 write (*,*) "setmatrices",time_mat
388 write (*,*) "ginvmult",time_ginvmult
389 write (*,*) "fricmatmult",time_fricmatmult
390 write (*,*) "inttocart",time_inttocart
391 write (*,*) "sumgradient",time_sumgradient
392 write (*,*) "intcartderiv",time_intcartderiv
393 write (*,*) "lagrangian",time_lagrangian
394 write (*,*) "cartgrad",time_cartgrad
395 write (*,*) "SAXS",time_SAXS