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
54 cd print *,' in SET_TIMERS stime=',stime
57 C------------------------------------------------------------------------------
58 logical function stopx(nf)
59 C This function returns .true. if one of the following reasons to exit SUMSL
60 C occurs. The "reason" code is stored in WHATSUP passed thru a COMMON block:
62 C... WHATSUP = 0 - go on, no reason to stop. Stopx will return .false.
63 C... 1 - Time up in current node;
64 C... 2 - STOP signal was received from another node because the
65 C... node's task was accomplished (parallel only);
66 C... -1 - STOP signal was received from another node because of error;
67 C... -2 - STOP signal was received from another node, because
68 C... the node's time was up.
69 implicit real*8 (a-h,o-z)
77 include 'COMMON.IOUNITS'
78 include 'COMMON.TIME1'
81 cd print *,'Processor',MyID,' NF=',nf
84 C Finish if time is up.
88 else if (mod(nf,100).eq.0) then
89 C Other processors might have finished. Check this every 100th function
91 C Master checks if any other processor has sent accepted conformation(s) to it.
92 if (MyID.ne.MasterID) call receive_mcm_info
93 if (MyID.eq.MasterID) call receive_conf
94 cd print *,'Processor ',MyID,' is checking STOP: nf=',nf
95 call recv_stop_sig(Kwita)
97 write (iout,'(a,i4,a,i5)') 'Processor',
98 & MyID,' has received STOP signal in STOPX; NF=',nf
99 write (*,'(a,i4,a,i5)') 'Processor',
100 & MyID,' has received STOP signal in STOPX; NF=',nf
103 elseif (Kwita.eq.-2) then
105 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
107 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
110 else if (Kwita.eq.-3) then
112 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
114 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
131 c Check for FOUND_NAN flag
133 write(iout,*)" *** stopx : Found a NaN"
140 C--------------------------------------------------------------------------
141 logical function ovrtim()
143 include 'COMMON.IOUNITS'
144 include 'COMMON.TIME1'
148 curtim = MPI_Wtime()-walltime
152 C curtim is the current time in seconds.
153 c write (iout,*) "curtim",curtim," timlim",timlim," safety",safety
154 if (curtim .ge. timlim - safety) then
155 write (iout,'(a,f10.2,a,f10.2,a,f10.2,a)')
156 & "***************** Elapsed time (",curtim,
157 & " s) is within the safety limit (",safety,
158 & " s) of the allocated time (",timlim," s). Terminating."
165 **************************************************************************
166 double precision function tcpu()
167 include 'COMMON.TIME1'
169 ****************************
170 C Next definition for EAGLE (ibm-es9000)
173 tcpu=cputime(micseconds,rcode)
174 tcpu=(micseconds/1.0E6) - stime
175 ****************************
178 ****************************
179 C Next definitions for sun
180 REAL*8 ECPU,ETIME,ETCPU
184 ****************************
187 ****************************
188 C Next definitions for ksr
189 C this function uses the ksr timer ALL_SECONDS from the PMON library to
190 C return the elapsed time in seconds
191 tcpu= all_seconds() - stime
192 ****************************
195 ****************************
196 C Next definitions for sgi
198 seconds = etime(timar)
199 Cd print *,'seconds=',seconds,' stime=',stime
203 ****************************
207 ****************************
208 C Next definitions for sgi
210 seconds = etime(timar)
211 Cd print *,'seconds=',seconds,' stime=',stime
215 ****************************
220 ****************************
221 C Next definitions for Cray
228 ****************************
231 ****************************
232 C Next definitions for RS6000
235 tcpu = (i1+0.0D0)/100.0D0
238 ****************************
239 c next definitions for windows NT Digital fortran
241 call cpu_time(time_real)
245 ****************************
246 c next definitions for windows NT Digital fortran
248 call cpu_time(time_real)
254 C---------------------------------------------------------------------------
255 subroutine dajczas(rntime,hrtime,mintime,sectime)
256 include 'COMMON.IOUNITS'
257 real*8 rntime,hrtime,mintime,sectime
258 hrtime=rntime/3600.0D0
260 mintime=aint((rntime-3600.0D0*hrtime)/60.0D0)
261 sectime=aint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
262 if (sectime.eq.60.0D0) then
264 mintime=mintime+1.0D0
269 write (iout,328) ihr,imn,isc
270 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
271 1 ' minutes ', I2 ,' seconds *****')
274 C---------------------------------------------------------------------------
275 subroutine print_detailed_timing
276 implicit real*8 (a-h,o-z)
281 include 'COMMON.IOUNITS'
282 include 'COMMON.TIME1'
283 include 'COMMON.SETUP'
286 write (iout,'(80(1h=)/a/(80(1h=)))')
287 & "Details of FG communication time"
288 write (*,'(7(a40,1pe15.5/),40(1h-)/a40,1pe15.5/80(1h=))')
289 & "BROADCAST:",time_bcast,"REDUCE:",time_reduce,
290 & "GATHER:",time_gather,
291 & "SCATTER:",time_scatter,"SENDRECV:",time_sendrecv,
292 & "BARRIER ene",time_barrier_e,
293 & "BARRIER grad",time_barrier_g,
295 & time_bcast+time_reduce+time_gather+time_scatter+time_sendrecv
296 write (*,*) fg_rank,myrank,
297 & ': Total wall clock time',time1-walltime,' sec'
298 write (*,*) "Processor",fg_rank,myrank,
299 & ": BROADCAST time",time_bcast," REDUCE time",
300 & time_reduce," GATHER time",time_gather," SCATTER time",
302 & " SCATTER fmatmult",time_scatter_fmatmult,
303 & " SCATTER ginvmult",time_scatter_ginvmult,
304 & " SCATTER fmat",time_scatter_fmat,
305 & " SCATTER ginv",time_scatter_ginv,
306 & " SENDRECV",time_sendrecv,
307 & " BARRIER ene",time_barrier_e,
308 & " BARRIER GRAD",time_barrier_g,
309 & " BCAST7",time_bcast7," BCASTC",time_bcastc,
310 & " BCASTW",time_bcastw," ALLREDUCE",time_allreduce,
312 & time_bcast+time_reduce+time_gather+time_scatter+
313 & time_sendrecv+time_barrier+time_bcastc
314 write (*,*) "Processor",fg_rank,myrank," enecalc",time_enecalc
315 write (*,*) "Processor",fg_rank,myrank," sumene",time_sumene
316 write (*,*) "Processor",fg_rank,myrank," intfromcart",
318 write (*,*) "Processor",fg_rank,myrank," vecandderiv",
320 write (*,*) "Processor",fg_rank,myrank," setmatrices",
322 write (*,*) "Processor",fg_rank,myrank," ginvmult",
324 write (*,*) "Processor",fg_rank,myrank," fricmatmult",
326 write (*,*) "Processor",fg_rank,myrank," inttocart",
328 write (*,*) "Processor",fg_rank,myrank," sumgradient",
330 write (*,*) "Processor",fg_rank,myrank," intcartderiv",
332 if (fg_rank.eq.0) then
333 write (*,*) "Processor",fg_rank,myrank," lagrangian",
335 write (*,*) "Processor",fg_rank,myrank," cartgrad",
338 write (*,*) "Processor",fg_rank,myrank," SAXS",time_SAXS
340 write (*,*) "enecalc",time_enecalc
341 write (*,*) "sumene",time_sumene
342 write (*,*) "intfromcart",time_intfcart
343 write (*,*) "vecandderiv",time_vec
344 write (*,*) "setmatrices",time_mat
345 write (*,*) "ginvmult",time_ginvmult
346 write (*,*) "fricmatmult",time_fricmatmult
347 write (*,*) "inttocart",time_inttocart
348 write (*,*) "sumgradient",time_sumgradient
349 write (*,*) "intcartderiv",time_intcartderiv
350 write (*,*) "lagrangian",time_lagrangian
351 write (*,*) "cartgrad",time_cartgrad
352 write (*,*) "SAXS",time_SAXS