1 C $Date: 1994/10/05 16:41:52 $
8 double precision tcpu ! function
10 C Diminish the assigned time limit a little so that there is some time to
13 C Calculate the initial time, if it is not zero (e.g. for the SUN).
17 logical function stopx(nf)
19 C ..................................................................
22 C THIS FUNCTION MAY SERVE AS THE STOPX (ASYNCHRONOUS INTERRUPTION)
23 C FUNCTION FOR THE NL2SOL (NONLINEAR LEAST-SQUARES) PACKAGE AT
24 C THOSE INSTALLATIONS WHICH DO NOT WISH TO IMPLEMENT A
27 C *****ALGORITHM NOTES...
28 C AT INSTALLATIONS WHERE THE NL2SOL SYSTEM IS USED
29 C INTERACTIVELY, THIS DUMMY STOPX SHOULD BE REPLACED BY A
30 C FUNCTION THAT RETURNS .TRUE. IF AND ONLY IF THE INTERRUPT
31 C (BREAK) KEY HAS BEEN PRESSED SINCE THE LAST CALL ON STOPX.
33 C $$$ MODIFIED FOR USE AS THE TIMER ROUTINE.
34 C $$$ WHEN THE TIME LIMIT HAS BEEN
35 C $$$ REACHED STOPX IS SET TO .TRUE AND INITIATES (IN ITSUM)
36 C $$$ AND ORDERLY EXIT OUT OF SUMSL. IF ARRAYS IV AND V ARE
37 C $$$ SAVED, THE SUMSL ROUTINES CAN BE RESTARTED AT THE SAME
38 C $$$ POINT AT WHICH THEY WERE INTERRUPTED.
40 C ..................................................................
45 include 'COMMON.IOUNITS'
46 include 'COMMON.TIME1'
51 cd print *,'Processor',MyID,' NF=',nf
54 C Finish if time is up.
57 else if (mod(nf,100).eq.0) then
58 C Other processors might have finished. Check this every 100th function
60 cd print *,'Processor ',MyID,' is checking STOP: nf=',nf
61 call recv_stop_sig(Kwita)
63 write (iout,'(a,i4,a,i5)') 'Processor',
64 & MyID,' has received STOP signal in STOPX; NF=',nf
65 write (*,'(a,i4,a,i5)') 'Processor',
66 & MyID,' has received STOP signal in STOPX; NF=',nf
77 C=========================================================================
79 logical function ovrtim()
80 double precision tcpu ! function
81 include 'COMMON.TIME1'
82 C Set a 100.0 secs. safety margin, so as to allow for the termination of
84 c double safety /150.0D0/
86 cd print *,'curtim=',curtim,' timlim=',timlim
87 C curtim is the current time in seconds.
88 ovrtim=(curtim .ge. timlim - safety )
91 C=========================================================================
93 double precision function tcpu()
94 include 'COMMON.TIME1'
96 ****************************
97 C Next definition for EAGLE (ibm-es9000)
100 tcpu=cputime(micseconds,rcode)
101 tcpu=(micseconds/1.0E6) - stime
102 ****************************
105 ****************************
106 C Next definitions for sun
110 ****************************
113 ****************************
114 C Next definitions for ksr
115 C this function uses the ksr timer ALL_SECONDS from the PMON library to
116 C return the elapsed time in seconds
117 tcpu= all_seconds() - stime
118 ****************************
121 ****************************
122 C Next definitions for sgi
124 seconds = etime(timar)
128 ****************************
131 ****************************
132 C Next definitions for Cray
139 ****************************
142 ****************************
143 C Next definitions for RS6000
146 tcpu = (i1+0.0D0)/100.0D0
149 ****************************
150 C Next definitions for sgi
152 seconds = etime(timar)
153 Cd print *,'seconds=',seconds,' stime=',stime
157 ****************************
162 subroutine dajczas(rntime,hrtime,mintime,sectime)
163 include 'COMMON.IOUNITS'
164 real*8 rntime,hrtime,mintime,sectime
165 hrtime=rntime/3600.0D0
167 mintime=aint((rntime-3600.0D0*hrtime)/60.0D0)
168 sectime=aint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
169 if (sectime.eq.60.0D0) then
171 mintime=mintime+1.0D0
176 write (iout,328) ihr,imn,isc
177 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
178 1 ' minutes ', I2 ,' seconds *****')