NAME

OTIM_stop - stops single or multi-threaded OpenMP time counters and prints elapsed
             and CPU times to STDOUT [default] or into a specified file.

SYNOPSIS

call OTIM_stop([label], [file])

PARAMETERS

<IN> label : Optional input string. If present, its value should be equal to
             the input argument specified at the OTIM_start call.

<IN> file  : Optional input string. If present, timings will be printed into the
             specified file. Otherwise, they will be printed in STDOUT.

NOTES

OTIM_stop subroutine must be called by the master thread to measure and to print the elapsed and CPU times.

EXAMPLE

In the example below, OTIM_start/stop routines are invoked to time-instrument the "do_multi_threaded_work" routine call:

     USE TIM
     ...
     call OTIM_start(LABEL="OpenMP parallel work")
       !$OMP PARALLEL
       OTIM_omp_start()
       CALL do_multi_threaded_work(...)
       OTIM_omp_stop()
       !$OMP END PARALLEL
     call OTIM_stop(LABEL="OpenMP parallel work")
     ...

OUTPUT EXAMPLE

The table below is printed by OTIM_stop routine which resumes the timings collected from a multi-threaded section of the code:

     Copyright (C) 2004, Jalel CHERGUI, IDRIS-CNRS FRANCE.
     TIM (release 3.1) summary report of *** OpenMP parallel work ***

     Process CPU Time (s) | Process Elapsed Time (s) | CPU/Elapsed
     =====================|==========================|============
               2.070      |            .690          |       3.000
                          |--------------------------|
                          | Thread Elapsed Time (s)  |
                          |--------------------------|
                          |    0:         .691       |
                          |    1:         .691       |
                          |    2:         .691       |
     =====================|==========================|============

     TIM started on 18/11/2004 at 13:59:13 MET +01:00 from GMT
     TIM stopped on 18/11/2004 at 13:59:14 MET +01:00 from GMT

A single threaded (sequential) program as the one below:

     USE TIM
     ...
     call OTIM_start(LABEL="none parallel work")
       CALL do_single_threaded_work(...)
     call OTIM_stop(LABEL="none parallel work")
     ...

would have produced the table below in which only the process elapsed and CPU times will be displayed:

     Copyright (C) 2004, Jalel CHERGUI, IDRIS-CNRS FRANCE.
     TIM (release 3.0) summary report of *** None parallel work ***

     Process CPU Time (s) | Process Elapsed Time (s) | CPU/Elapsed
     =====================|==========================|============
               1.820      |           1.810          |       1.006
     =====================|==========================|============

     TIM started on 18/11/2004 at 13:59:10 MET +01:00 from GMT
     TIM stopped on 18/11/2004 at 13:59:12 MET +01:00 from GMT

SEE ALSO

OTIM_start, OTIM_omp_start, OTIM_omp_stop

Back to the routines' list...


Last modified: Tue Dec 7 11:38:49 CET 2004