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).
19 cd print *,' in SET_TIMERS stime=',stime
22 C------------------------------------------------------------------------------
23 logical function stopx(nf)
24 C This function returns .true. if one of the following reasons to exit SUMSL
25 C occurs. The "reason" code is stored in WHATSUP passed thru a COMMON block:
27 C... WHATSUP = 0 - go on, no reason to stop. Stopx will return .false.
28 C... 1 - Time up in current node;
29 C... 2 - STOP signal was received from another node because the
30 C... node's task was accomplished (parallel only);
31 C... -1 - STOP signal was received from another node because of error;
32 C... -2 - STOP signal was received from another node, because
33 C... the node's time was up.
34 implicit real*8 (a-h,o-z)
42 include 'COMMON.IOUNITS'
43 include 'COMMON.TIME1'
46 cd print *,'Processor',MyID,' NF=',nf
49 C Finish if time is up.
53 else if (mod(nf,100).eq.0) then
54 C Other processors might have finished. Check this every 100th function
56 C Master checks if any other processor has sent accepted conformation(s) to it.
57 if (MyID.ne.MasterID) call receive_mcm_info
58 if (MyID.eq.MasterID) call receive_conf
59 cd print *,'Processor ',MyID,' is checking STOP: nf=',nf
60 call recv_stop_sig(Kwita)
62 write (iout,'(a,i4,a,i5)') 'Processor',
63 & MyID,' has received STOP signal in STOPX; NF=',nf
64 write (*,'(a,i4,a,i5)') 'Processor',
65 & MyID,' has received STOP signal in STOPX; NF=',nf
68 elseif (Kwita.eq.-2) then
70 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
72 & 'Processor',MyID,' received TIMEUP-STOP signal in SUMSL.'
75 else if (Kwita.eq.-3) then
77 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
79 & 'Processor',MyID,' received ERROR-STOP signal in SUMSL.'
96 c Check for FOUND_NAN flag
98 write(iout,*)" *** stopx : Found a NaN"
105 C--------------------------------------------------------------------------
106 logical function ovrtim()
108 include 'COMMON.IOUNITS'
109 include 'COMMON.TIME1'
113 curtim = MPI_Wtime()-walltime
117 C curtim is the current time in seconds.
118 c write (iout,*) "curtim",curtim," timlim",timlim," safety",safety
119 if (curtim .ge. timlim - safety) then
120 write (iout,'(a,f10.2,a,f10.2,a,f10.2,a)')
121 & "***************** Elapsed time (",curtim,
122 & " s) is within the safety limit (",safety,
123 & " s) of the allocated time (",timlim," s). Terminating."
130 **************************************************************************
131 double precision function tcpu()
132 include 'COMMON.TIME1'
134 ****************************
135 C Next definition for EAGLE (ibm-es9000)
138 tcpu=cputime(micseconds,rcode)
139 tcpu=(micseconds/1.0E6) - stime
140 ****************************
143 ****************************
144 C Next definitions for sun
145 REAL*8 ECPU,ETIME,ETCPU
149 ****************************
152 ****************************
153 C Next definitions for ksr
154 C this function uses the ksr timer ALL_SECONDS from the PMON library to
155 C return the elapsed time in seconds
156 tcpu= all_seconds() - stime
157 ****************************
160 ****************************
161 C Next definitions for sgi
163 seconds = etime(timar)
164 Cd print *,'seconds=',seconds,' stime=',stime
168 ****************************
172 ****************************
173 C Next definitions for sgi
175 seconds = etime(timar)
176 Cd print *,'seconds=',seconds,' stime=',stime
180 ****************************
185 ****************************
186 C Next definitions for Cray
193 ****************************
196 ****************************
197 C Next definitions for RS6000
200 tcpu = (i1+0.0D0)/100.0D0
203 ****************************
204 c next definitions for windows NT Digital fortran
206 call cpu_time(time_real)
210 ****************************
211 c next definitions for windows NT Digital fortran
213 call cpu_time(time_real)
219 C---------------------------------------------------------------------------
220 subroutine dajczas(rntime,hrtime,mintime,sectime)
221 include 'COMMON.IOUNITS'
222 real*8 rntime,hrtime,mintime,sectime
223 hrtime=rntime/3600.0D0
225 mintime=aint((rntime-3600.0D0*hrtime)/60.0D0)
226 sectime=aint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
227 if (sectime.eq.60.0D0) then
229 mintime=mintime+1.0D0
234 write (iout,328) ihr,imn,isc
235 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
236 1 ' minutes ', I2 ,' seconds *****')