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.
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()
144 include 'COMMON.IOUNITS'
145 include 'COMMON.TIME1'
149 curtim = MPI_Wtime()-walltime
153 C curtim is the current time in seconds.
154 c write (iout,*) "curtim",curtim," timlim",timlim," safety",safety
155 if (curtim .ge. timlim - safety) then
156 write (iout,'(a,f10.2,a,f10.2,a,f10.2,a)')
157 & "***************** Elapsed time (",curtim,
158 & " s) is within the safety limit (",safety,
159 & " s) of the allocated time (",timlim," s). Terminating."
166 **************************************************************************
167 double precision function tcpu()
169 include 'COMMON.TIME1'
170 double precision seconds
172 ****************************
173 C Next definition for EAGLE (ibm-es9000)
176 tcpu=cputime(micseconds,rcode)
177 tcpu=(micseconds/1.0E6) - stime
178 ****************************
181 ****************************
182 C Next definitions for sun
183 REAL*8 ECPU,ETIME,ETCPU
187 ****************************
190 ****************************
191 C Next definitions for ksr
192 C this function uses the ksr timer ALL_SECONDS from the PMON library to
193 C return the elapsed time in seconds
194 tcpu= all_seconds() - stime
195 ****************************
198 ****************************
199 C Next definitions for sgi
201 seconds = etime(timar)
202 Cd print *,'seconds=',seconds,' stime=',stime
206 ****************************
210 ****************************
211 C Next definitions for sgi
213 seconds = etime(timar)
214 Cd print *,'seconds=',seconds,' stime=',stime
218 ****************************
223 ****************************
224 C Next definitions for Cray
231 ****************************
234 ****************************
235 C Next definitions for RS6000
238 tcpu = (i1+0.0D0)/100.0D0
241 ****************************
242 c next definitions for windows NT Digital fortran
244 call cpu_time(time_real)
248 ****************************
249 c next definitions for windows NT Digital fortran
251 call cpu_time(time_real)
257 C---------------------------------------------------------------------------
258 subroutine dajczas(rntime,hrtime,mintime,sectime)
260 include 'COMMON.IOUNITS'
261 real*8 rntime,hrtime,mintime,sectime
263 hrtime=rntime/3600.0D0
265 mintime=dint((rntime-3600.0D0*hrtime)/60.0D0)
266 sectime=dint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
267 if (sectime.eq.60.0D0) then
269 mintime=mintime+1.0D0
274 write (iout,328) ihr,imn,isc
275 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
276 1 ' minutes ', I2 ,' seconds *****')
279 C---------------------------------------------------------------------------
280 subroutine print_detailed_timing
285 double precision time1
287 include 'COMMON.IOUNITS'
288 include 'COMMON.TIME1'
289 include 'COMMON.SETUP'
292 write (iout,'(80(1h=)/a/(80(1h=)))')
293 & "Details of FG communication time"
294 write (*,'(7(a40,1pe15.5/),40(1h-)/a40,1pe15.5/80(1h=))')
295 & "BROADCAST:",time_bcast,"REDUCE:",time_reduce,
296 & "GATHER:",time_gather,
297 & "SCATTER:",time_scatter,"SENDRECV:",time_sendrecv,
298 & "BARRIER ene",time_barrier_e,
299 & "BARRIER grad",time_barrier_g,
301 & time_bcast+time_reduce+time_gather+time_scatter+time_sendrecv
302 write (*,*) fg_rank,myrank,
303 & ': Total wall clock time',time1-walltime,' sec'
304 write (*,*) "Processor",fg_rank,myrank,
305 & ": BROADCAST time",time_bcast," REDUCE time",
306 & time_reduce," GATHER time",time_gather," SCATTER time",
308 & " SCATTER fmatmult",time_scatter_fmatmult,
309 & " SCATTER ginvmult",time_scatter_ginvmult,
310 & " SCATTER fmat",time_scatter_fmat,
311 & " SCATTER ginv",time_scatter_ginv,
312 & " SENDRECV",time_sendrecv,
313 & " BARRIER ene",time_barrier_e,
314 & " BARRIER GRAD",time_barrier_g,
315 & " BCAST7",time_bcast7," BCASTC",time_bcastc,
316 & " BCASTW",time_bcastw," ALLREDUCE",time_allreduce,
318 & time_bcast+time_reduce+time_gather+time_scatter+
319 & time_sendrecv+time_barrier_g+time_barrier_e+time_bcastc
320 write (*,*) "Processor",fg_rank,myrank," enecalc",time_enecalc
321 write (*,*) "Processor",fg_rank,myrank," sumene",time_sumene
322 write (*,*) "Processor",fg_rank,myrank," intfromcart",
324 write (*,*) "Processor",fg_rank,myrank," vecandderiv",
326 write (*,*) "Processor",fg_rank,myrank," setmatrices",
328 write (*,*) "Processor",fg_rank,myrank," ginvmult",
330 write (*,*) "Processor",fg_rank,myrank," fricmatmult",
332 write (*,*) "Processor",fg_rank,myrank," inttocart",
334 write (*,*) "Processor",fg_rank,myrank," sumgradient",
336 write (*,*) "Processor",fg_rank,myrank," intcartderiv",
338 if (fg_rank.eq.0) then
339 write (*,*) "Processor",fg_rank,myrank," lagrangian",
341 write (*,*) "Processor",fg_rank,myrank," cartgrad",
344 write (*,*) "Processor",fg_rank,myrank," SAXS",time_SAXS
346 write (*,*) "enecalc",time_enecalc
347 write (*,*) "sumene",time_sumene
348 write (*,*) "intfromcart",time_intfcart
349 write (*,*) "vecandderiv",time_vec
350 write (*,*) "setmatrices",time_mat
351 write (*,*) "ginvmult",time_ginvmult
352 write (*,*) "fricmatmult",time_fricmatmult
353 write (*,*) "inttocart",time_inttocart
354 write (*,*) "sumgradient",time_sumgradient
355 write (*,*) "intcartderiv",time_intcartderiv
356 write (*,*) "lagrangian",time_lagrangian
357 write (*,*) "cartgrad",time_cartgrad
358 write (*,*) "SAXS",time_SAXS