1 C $Date: 1994/10/05 16:41:52 $
6 C=========================================================================
10 double precision tcpu ! function
11 include 'COMMON.TIME1'
12 C Diminish the assigned time limit a little so that there is some time to
15 C Calculate the initial time, if it is not zero (e.g. for the SUN).
18 end ! end of set_timers
21 C=========================================================================
23 logical function stopx(nf)
25 C ..................................................................
28 C THIS FUNCTION MAY SERVE AS THE STOPX (ASYNCHRONOUS INTERRUPTION)
29 C FUNCTION FOR THE NL2SOL (NONLINEAR LEAST-SQUARES) PACKAGE AT
30 C THOSE INSTALLATIONS WHICH DO NOT WISH TO IMPLEMENT A
33 C *****ALGORITHM NOTES...
34 C AT INSTALLATIONS WHERE THE NL2SOL SYSTEM IS USED
35 C INTERACTIVELY, THIS DUMMY STOPX SHOULD BE REPLACED BY A
36 C FUNCTION THAT RETURNS .TRUE. IF AND ONLY IF THE INTERRUPT
37 C (BREAK) KEY HAS BEEN PRESSED SINCE THE LAST CALL ON STOPX.
39 C $$$ MODIFIED FOR USE AS THE TIMER ROUTINE.
40 C $$$ WHEN THE TIME LIMIT HAS BEEN
41 C $$$ REACHED STOPX IS SET TO .TRUE AND INITIATES (IN ITSUM)
42 C $$$ AND ORDERLY EXIT OUT OF SUMSL. IF ARRAYS IV AND V ARE
43 C $$$ SAVED, THE SUMSL ROUTINES CAN BE RESTARTED AT THE SAME
44 C $$$ POINT AT WHICH THEY WERE INTERRUPTED.
46 C ..................................................................
50 logical ovrtim ! function
51 include 'COMMON.IOUNITS'
52 include 'COMMON.TIME1'
57 cd print *,'Processor',MyID,' NF=',nf
60 C Finish if time is up.
63 else if (mod(nf,100).eq.0) then
64 C Other processors might have finished. Check this every 100th function
66 cd print *,'Processor ',MyID,' is checking STOP: nf=',nf
67 call recv_stop_sig(Kwita)
69 write (iout,'(a,i4,a,i5)') 'Processor',
70 & MyID,' has received STOP signal in STOPX; NF=',nf
71 write (*,'(a,i4,a,i5)') 'Processor',
72 & MyID,' has received STOP signal in STOPX; NF=',nf
84 C=========================================================================
86 logical function ovrtim()
87 double precision tcpu ! function
88 include 'COMMON.TIME1'
89 C Set a 100.0 secs. safety margin, so as to allow for the termination of
91 c double safety /150.0D0/
93 cd print *,'curtim=',curtim,' timlim=',timlim
94 C curtim is the current time in seconds.
95 ovrtim=(curtim .ge. timlim - safety )
99 C=========================================================================
101 double precision function tcpu()
102 include 'COMMON.TIME1'
104 ****************************
105 C Next definition for EAGLE (ibm-es9000)
108 tcpu=cputime(micseconds,rcode)
109 tcpu=(micseconds/1.0E6) - stime
110 ****************************
113 ****************************
114 C Next definitions for sun
118 ****************************
121 ****************************
122 C Next definitions for ksr
123 C this function uses the ksr timer ALL_SECONDS from the PMON library to
124 C return the elapsed time in seconds
125 tcpu= all_seconds() - stime
126 ****************************
129 ****************************
130 C Next definitions for sgi
132 seconds = etime(timar)
136 ****************************
139 ****************************
140 C Next definitions for Cray
147 ****************************
150 ****************************
151 C Next definitions for RS6000
154 tcpu = (i1+0.0D0)/100.0D0
156 #if defined(LINUX) && !defined(AIX)
157 ****************************
158 C Next definitions for Linux
161 seconds = etime(timar)
162 tcpu=DBLE(seconds - stime)
163 ****************************
170 C=========================================================================
172 subroutine dajczas(rntime,hrtime,mintime,sectime)
173 include 'COMMON.IOUNITS'
174 real*8 rntime,hrtime,mintime,sectime
175 hrtime=rntime/3600.0D0
177 mintime=aint((rntime-3600.0D0*hrtime)/60.0D0)
178 sectime=aint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
179 if (sectime.eq.60.0D0) then
181 mintime=mintime+1.0D0
186 write (iout,328) ihr,imn,isc
187 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
188 1 ' minutes ', I2 ,' seconds *****')