1 C $Date: 1994/10/05 16:41:52 $
9 C Diminish the assigned time limit a little so that there is some time to
12 C Calculate the initial time, if it is not zero (e.g. for the SUN).
16 logical function stopx(nf)
18 C ..................................................................
21 C THIS FUNCTION MAY SERVE AS THE STOPX (ASYNCHRONOUS INTERRUPTION)
22 C FUNCTION FOR THE NL2SOL (NONLINEAR LEAST-SQUARES) PACKAGE AT
23 C THOSE INSTALLATIONS WHICH DO NOT WISH TO IMPLEMENT A
26 C *****ALGORITHM NOTES...
27 C AT INSTALLATIONS WHERE THE NL2SOL SYSTEM IS USED
28 C INTERACTIVELY, THIS DUMMY STOPX SHOULD BE REPLACED BY A
29 C FUNCTION THAT RETURNS .TRUE. IF AND ONLY IF THE INTERRUPT
30 C (BREAK) KEY HAS BEEN PRESSED SINCE THE LAST CALL ON STOPX.
32 C $$$ MODIFIED FOR USE AS THE TIMER ROUTINE.
33 C $$$ WHEN THE TIME LIMIT HAS BEEN
34 C $$$ REACHED STOPX IS SET TO .TRUE AND INITIATES (IN ITSUM)
35 C $$$ AND ORDERLY EXIT OUT OF SUMSL. IF ARRAYS IV AND V ARE
36 C $$$ SAVED, THE SUMSL ROUTINES CAN BE RESTARTED AT THE SAME
37 C $$$ POINT AT WHICH THEY WERE INTERRUPTED.
39 C ..................................................................
44 include 'COMMON.IOUNITS'
45 include 'COMMON.TIME1'
50 cd print *,'Processor',MyID,' NF=',nf
53 C Finish if time is up.
56 else if (mod(nf,100).eq.0) then
57 C Other processors might have finished. Check this every 100th function
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
76 logical function ovrtim()
77 include 'COMMON.TIME1'
78 C Set a 100.0 secs. safety margin, so as to allow for the termination of
80 c double safety /150.0D0/
82 cd print *,'curtim=',curtim,' timlim=',timlim
83 C curtim is the current time in seconds.
84 ovrtim=(curtim .ge. timlim - safety )
87 **************************************************************************
88 double precision function tcpu()
89 include 'COMMON.TIME1'
91 ****************************
92 C Next definition for EAGLE (ibm-es9000)
95 tcpu=cputime(micseconds,rcode)
96 tcpu=(micseconds/1.0E6) - stime
97 ****************************
100 ****************************
101 C Next definitions for sun
105 ****************************
108 ****************************
109 C Next definitions for ksr
110 C this function uses the ksr timer ALL_SECONDS from the PMON library to
111 C return the elapsed time in seconds
112 tcpu= all_seconds() - stime
113 ****************************
116 ****************************
117 C Next definitions for sgi
119 seconds = etime(timar)
123 ****************************
126 ****************************
127 C Next definitions for Cray
134 ****************************
137 ****************************
138 C Next definitions for RS6000
141 tcpu = (i1+0.0D0)/100.0D0
147 subroutine dajczas(rntime,hrtime,mintime,sectime)
148 include 'COMMON.IOUNITS'
149 real*8 rntime,hrtime,mintime,sectime
150 hrtime=rntime/3600.0D0
152 mintime=aint((rntime-3600.0D0*hrtime)/60.0D0)
153 sectime=aint((rntime-3600.0D0*hrtime-60.0D0*mintime)+0.5D0)
154 if (sectime.eq.60.0D0) then
156 mintime=mintime+1.0D0
161 write (iout,328) ihr,imn,isc
162 328 FORMAT(//'***** Computation time: ',I4 ,' hours ',I2 ,
163 1 ' minutes ', I2 ,' seconds *****')