OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
timer.F File Reference
#include "implicit_f.inc"
#include "scr05_c.inc"
#include "timer_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine initime ()
subroutine startime (event, itask)
subroutine stoptime (event, itask)
subroutine printime (itask, got_timer, startdate, starttime, enddate, endtime)
subroutine elapstime (etime)
subroutine elapstime_omp (etime)

Function/Subroutine Documentation

◆ elapstime()

subroutine elapstime ( double precision etime)

Definition at line 365 of file timer.F.

366C reset timer elapsed time et calcul du temps elapsed courant
367C-----------------------------------------------
368C I m p l i c i t T y p e s
369C-----------------------------------------------
370#include "implicit_f.inc"
371C-----------------------------------------------
372C G l o b a l P a r a m e t e r s
373C----------------------------------------------
374C C o m m o n B l o c k s
375C-----------------------------------------------
376#include "scr05_c.inc"
377#include "timer_c.inc"
378 COMMON /iclock/clock0
379 INTEGER CLOCK0
380 COMMON /rclock/elapsed
381 DOUBLE PRECISION ELAPSED
382C-----------------------------------------------
383C D u m m y A r g u m e n t s
384C-----------------------------------------------
385 DOUBLE PRECISION ETIME
386C-----------------------------------------------
387C L o c a l V a r i a b l e s
388C-----------------------------------------------
389 INTEGER CLOCK1, CLOCKRATE, NBMAX
390 DOUBLE PRECISION SECS
391 REAL(KIND=8) :: omp_ending_time
392#ifdef _OPENMP
393 REAL(kind=8) omp_get_wtime
394 external OMP_GET_WTIME
395#endif
396C-----------------------------------------------
397 CALL system_clock(count=clock1, count_rate=clockrate,
398 + count_max=nbmax )
399
400
401#if _OPENMP
402 omp_ending_time = omp_get_wtime( )
403 secs = omp_ending_time-omp_starting_time
404 elapsed = secs
405#else
406 secs = clock1-clock0 ! diff temps courant - temps initial (qui peut ne pas etre 0 !)
407 IF(secs<zero) secs = secs + nbmax ! cas depassement nb de periode maximum
408 secs = secs/clockrate
409 elapsed = elapsed + secs
410#endif
411
412 clock0 = clock1 ! recuperation du temps courant dans clock0
413 etime = elapsed
414
415 RETURN

◆ elapstime_omp()

subroutine elapstime_omp ( real(kind=8) etime)

Definition at line 423 of file timer.F.

424! compute the current elapsed time
425C-----------------------------------------------
426C I m p l i c i t T y p e s
427C-----------------------------------------------
428#include "implicit_f.inc"
429C-----------------------------------------------
430C G l o b a l P a r a m e t e r s
431C----------------------------------------------
432C C o m m o n B l o c k s
433C-----------------------------------------------
434#include "scr05_c.inc"
435#include "timer_c.inc"
436C-----------------------------------------------
437C D u m m y A r g u m e n t s
438C-----------------------------------------------
439 real(kind=8) :: etime
440C-----------------------------------------------
441C L o c a l V a r i a b l e s
442C-----------------------------------------------
443 INTEGER CLOCK1, CLOCKRATE, NBMAX
444 real(kind=8) :: secs
445 real(kind=8) :: omp_ending_time
446 real(kind=8) :: omp_get_wtime
447#ifdef _OPENMP
448 external OMP_GET_WTIME
449C-----------------------------------------------
450 omp_ending_time = omp_get_wtime( )
451 secs = omp_ending_time-omp_starting_time
452
453 etime = secs
454#else
455 secs = 0
456 etime = secs
457#endif
458
459 RETURN

◆ initime()

subroutine initime

Definition at line 29 of file timer.F.

30C initialisation des timers
31C timer signification
32C
33C 1 translator
34C 2 lecture total (including ddsplit)
35c 3 ddsplit
36c 4 freeform
37c 5 IPARI_L_INI
38c 6 INTBUF_INI
39c 7 SPLIT_INTERFACES
40c 8 W_FI
41C-----------------------------------------------
42C I m p l i c i t T y p e s
43C-----------------------------------------------
44#include "implicit_f.inc"
45C-----------------------------------------------
46C G l o b a l P a r a m e t e r s
47C----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "scr05_c.inc"
51#include "timer_c.inc"
52 COMMON /iclock/clock0
53 INTEGER CLOCK0
54 COMMON /rclock/elapsed
55 DOUBLE PRECISION ELAPSED
56
57#ifdef _OPENMP
58 INTEGER OMP_GET_THREAD_NUM, OMP_GET_NUM_THREADS
59 EXTERNAL omp_get_thread_num, omp_get_num_threads
60 REAL(kind=8) omp_get_wtime
61 external OMP_get_wtime
62#endif
63C-----------------------------------------------
64C L o c a l V a r i a b l e s
65C-----------------------------------------------
66 INTEGER I, J
67C-----------------------------------------------
68 DO i =1, nthmax
69 DO j = 1, ntimax
70 cputime(j,i) = zero
71 realtime(j,i) = zero
72 ENDDO
73 ENDDO
74 CALL system_clock(clock0) ! recuperation du temps de debut dans clock0
75 elapsed = zero ! initialisation a zero de l'elapsed time
76
77#ifdef _OPENMP
78 omp_starting_time = omp_get_wtime( )
79#endif
80
81 RETURN

◆ printime()

subroutine printime ( integer itask,
integer got_timer,
character(len=8), intent(in) startdate,
character(len=10), intent(in) starttime,
character(len=8), intent(out) enddate,
character(len=10), intent(out) endtime )

Definition at line 183 of file timer.F.

184C routine d'affichage des timers
185C-----------------------------------------------
186C I m p l i c i t T y p e s
187C-----------------------------------------------
188#include "implicit_f.inc"
189C-----------------------------------------------
190C G l o b a l P a r a m e t e r s
191C-----------------------------------------------
192C C o m m o n B l o c k s
193C-----------------------------------------------
194#include "scr05_c.inc"
195#include "timer_c.inc"
196#include "units_c.inc"
197 COMMON /iclock/clock0
198 INTEGER CLOCK0
199 COMMON /rclock/elapsed
200 DOUBLE PRECISION ELAPSED
201 CHARACTER(len=8), INTENT(IN) :: STARTDATE
202 CHARACTER(len=10), INTENT(IN) :: STARTTIME
203 CHARACTER(len=8), INTENT(OUT) :: ENDDATE
204 CHARACTER(len=10), INTENT(OUT) :: ENDTIME
205
206C-----------------------------------------------
207C D u m m y A r g u m e n t s
208C-----------------------------------------------
209 INTEGER ITASK,GOT_TIMER
210C-----------------------------------------------
211C L o c a l V a r i a b l e s
212C-----------------------------------------------
213 DOUBLE PRECISION SECS
214 CHARACTER(len=8) :: DATE
215 CHARACTER(len=10) :: TIME
216 INTEGER :: IH,IM,IS
217C-----------------------------------------------
218
219 CALL elapstime(secs)
220 ih=secs/3600
221 im=(secs-ih*3600)/60
222 is=secs-ih*3600-im*60
223
224 CALL date_and_time(date,time)
225 enddate = date
226 endtime = time
227
228 WRITE(iout,*) ' '
229 WRITE(istdo,*) ' '
230 WRITE(iout,6100)
231 WRITE(istdo,6100)
232 IF(got_timer>0) THEN
233 WRITE(iout,*)' '
234 WRITE(iout,*)'CPU USER TIME'
235 WRITE(iout,*)'-------------'
236
237 WRITE(iout,1000)
238 WRITE(iout,1100)
239 . cputime(1,itask),cputime(4,itask),cputime(2,itask)-
240 . cputime(3,itask),cputime(3,itask),
241 . cputime(5,itask),cputime(6,itask),cputime(7,itask),
242 . cputime(8,itask)
243
244 WRITE(istdo,*)' '
245 WRITE(istdo,*)'CPU USER TIME'
246 WRITE(istdo,*)'-------------'
247
248 WRITE(istdo,1000)
249 WRITE(istdo,1100)
250 . cputime(1,itask),cputime(4,itask),cputime(2,itask)-
251 . cputime(3,itask),cputime(3,itask),
252 . cputime(5,itask),cputime(6,itask),cputime(7,itask),
253 . cputime(8,itask)
254
255C---------------------------
256C Elapsed time & Estimated Speedup
257C---------------------------
258
259c---output file
260 WRITE(iout,*)' '
261 WRITE(iout,*)' '
262 WRITE(iout,*)'ELAPSED TIME'
263 WRITE(iout,*)'------------'
264
265 WRITE(iout,1000)
266 WRITE(iout,1100)
267 . realtime(1,1),realtime(4,1),realtime(2,1)-
268 . realtime(3,1),realtime(3,1),
269 . realtime(5,1),realtime(6,1),realtime(7,1),
270 . realtime(8,1)
271
272c---Standard output
273
274 WRITE(istdo,*)' '
275 WRITE(istdo,*)' '
276 WRITE(istdo,*)'ELAPSED TIME'
277 WRITE(istdo,*)'------------'
278
279 WRITE(istdo,1000)
280 WRITE(istdo,1100)
281 . realtime(1,1),realtime(4,1),realtime(2,1)-
282 . realtime(3,1),realtime(3,1),
283 . realtime(5,1),realtime(6,1),realtime(7,1),
284 . realtime(8,1)
285
286 WRITE(istdo,'(A)') ' '
287 WRITE(istdo,'(A,E9.4)') ' CONVERTER : ', realtime(15,1)
288 WRITE(istdo,'(A,E9.4)') ' RD INPUT BUILD : ', realtime(16,1)
289 WRITE(istdo,'(A)') ' '
290 WRITE(istdo,'(A,E9.4)') ' RD GROUPS & SURFACES : ', realtime(19,1)
291 WRITE(istdo,'(A)') ' '
292 WRITE(istdo,'(A,E9.4)') ' SETS : ', realtime(17,1)
293 WRITE(istdo,'(A)') ' '
294 WRITE(istdo,'(A,E9.4)') 'IDDLEVEL=0 - INTERFACE READ : ', realtime(10,1)
295 WRITE(istdo,'(A,E9.4)') 'IDDLEVEL=1 - INTERFACE READ : ', realtime(11,1)
296 WRITE(istdo,'(A)') ' '
297 WRITE(istdo,'(A,E9.4)') 'IDDLEVEL=0 - INTERFACE INIT : ', realtime(12,1)
298 WRITE(istdo,'(A,E9.4)') 'IDDLEVEL=1 - INTERFACE INIT : ', realtime(13,1)
299 WRITE(istdo,'(A)') ' '
300 WRITE(istdo,'(A,E9.4)') 'IDDLEVEL=1 - I7REMNODE : ', realtime(18,1)
301 WRITE(istdo,'(A)') ' '
302 WRITE(istdo,'(A,E9.4)') ' ELBUF INIT : ', realtime(14,1)
303
304 ENDIF
305
306 WRITE(iout,*) ' '
307 WRITE(iout,*)
308 . ' ** COMPUTE TIME INFORMATION **'
309 WRITE(iout,*)' '
310
311 WRITE(iout,6200)startdate(1:4),startdate(5:6),startdate(7:8),
312 . starttime(1:2),starttime(3:4),starttime(5:6)
313 WRITE(iout,6300)date(1:4),date(5:6),date(7:8),
314 . time(1:2),time(3:4),time(5:6)
315 WRITE(iout,*)' '
316
317 WRITE(istdo,*) ' '
318 WRITE(istdo,*)
319 . ' ** COMPUTE TIME INFORMATION **'
320 WRITE(istdo,*)' '
321
322 WRITE(istdo,6200)startdate(1:4),startdate(5:6),startdate(7:8),
323 . starttime(1:2),starttime(3:4),starttime(5:6)
324 WRITE(istdo,6300)date(1:4),date(5:6),date(7:8),
325 . time(1:2),time(3:4),time(5:6)
326 WRITE(istdo,*)' '
327
328 WRITE(istdo,6000)secs
329 WRITE(istdo,6050) ih,im,is
330 WRITE(istdo,*)' '
331
332 WRITE(iout,6000)secs
333 WRITE(iout,6050)ih,im,is
334 WRITE(iout,*)' '
335
336 WRITE(iout,6100)
337 WRITE(istdo,6100)
338
339
340
341c---Format
342 1000 FORMAT(' TRANSLATOR ','FREEFORM ','LECTURE ',
343 .'DDSPLIT ','IPARI_L_INI ','INTBUF_INI ','SPL_INTS ',
344 .'W_FI ')
345 1100 FORMAT(e9.4,3x,e9.4,3x,e9.4,3x,e9.4,3x,e9.4,3x,e9.4
346 .,3x,e9.4,3x,e9.4)
347
348 6000 FORMAT(' ELAPSED TIME...........=',f14.2,' s')
349 6050 FORMAT(' ',i2.2,':',i2.2,':',i2.2)
350 6100 FORMAT('------------------------------------------------------------------------')
351 6200 FORMAT(' EXECUTION STARTED : ',
352 . a4,'/',a2,'/',a2,' ',a2,':',a2,':',a2)
353 6300 FORMAT(' EXECUTION COMPLETED : ',
354 . a4,'/',a2,'/',a2,' ',a2,':',a2,':',a2)
355
356
357 RETURN
subroutine elapstime(etime)
Definition timer.F:366

◆ startime()

subroutine startime ( integer event,
integer itask )

Definition at line 92 of file timer.F.

93C routine d'incrementation du timer event
94C-----------------------------------------------
95C I m p l i c i t T y p e s
96C-----------------------------------------------
97#include "implicit_f.inc"
98C-----------------------------------------------
99C G l o b a l P a r a m e t e r s
100C-----------------------------------------------
101C C o m m o n B l o c k s
102C-----------------------------------------------
103#include "scr05_c.inc"
104#include "timer_c.inc"
105C-----------------------------------------------
106C D u m m y A r g u m e n t s
107C-----------------------------------------------
108 INTEGER EVENT,ITASK
109C-----------------------------------------------
110C L o c a l V a r i a b l e s
111C-----------------------------------------------
112#ifdef _OPENMP
113 REAL(kind=8) omp_get_wtime
114 external OMP_GET_WTIME
115#endif
116C
117 CALL my_etime(timer(1,event,itask))
118#ifdef _OPENMP
119 omp_initime(event,itask) = omp_get_wtime( )
120#else
121 CALL system_clock(clockini(event,itask))
122#endif
123 RETURN
subroutine my_etime(timer)
Definition machine.F:114

◆ stoptime()

subroutine stoptime ( integer event,
integer itask )

Definition at line 134 of file timer.F.

135C routine incrementation du timer event
136C-----------------------------------------------
137C I m p l i c i t T y p e s
138C-----------------------------------------------
139#include "implicit_f.inc"
140C-----------------------------------------------
141C C o m m o n B l o c k s
142C-----------------------------------------------
143#include "scr05_c.inc"
144#include "timer_c.inc"
145C-----------------------------------------------
146C L o c a l V a r i a b l e s
147C-----------------------------------------------
148 INTEGER EVENT,ITASK
149
150 DOUBLE PRECISION SECS
151 INTEGER CLOCK1, CLOCKRATE, NBMAX
152 REAL(KIND=8) :: omp_ending_time
153#ifdef _OPENMP
154 REAL(kind=8) omp_get_wtime
155 external OMP_GET_WTIME
156#endif
157C-----------------------------------------------
158 CALL my_etime(timer(3,event,itask))
159 cputime(event,itask) = cputime(event,itask) +
160 . timer(3,event,itask)-timer(1,event,itask)
161
162#ifdef _OPENMP
163 omp_ending_time = omp_get_wtime( )
164 secs = omp_ending_time - omp_initime(event,itask)
165#else
166 CALL system_clock(count=clock1, count_rate=clockrate,
167 + count_max=nbmax )
168 secs = clock1-clockini(event,itask) ! diff temps courant - temps initial
169 IF(secs<zero) secs = secs + nbmax ! cas depassement nb de periode maximum
170 secs = secs/clockrate
171#endif
172 realtime(event,itask)=realtime(event,itask)+secs
173
174 RETURN