SCT  1.0
The SC Timer Lib
Authors
Joerg Behrens
Hendryk Bockelmann

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the DKRZ GmbH nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The basic idea

The SCT library was invented with the aim of having an easy to use timer with as little overhead as possible. The timers (which can also measure hardware performance counters via PAPI interface) are implemented for pure sequential, OpenMP, MPI and hybrid OpenMP-MPI usage with a special emphasis on selectable reduction operations in order to provide a compact presentation of the measurments of parallel applications.

Examples

All timer usage should be initializes by the call

timer_size = sct_init(timer_max, "context_name", 0);

where timer_max denotes the maximum number of timers that will be used, "context_name" is the name of the default context and the last argument specifies the MPI-communicator to be used for this context (set to 0 in case of non-MPI src).

New timer and/or new context can be added by

new_timer = sct_new_timer("timer_name");
new_context = sct_new_context("context_name", comm);

The measurement of user-defined regions is done via

sct_start(timer_id);
sct_stop(timer_id);

Last timed interval can be shown

interval = sct_last_dt(timer_id);

and also the entire time taken by a timer

time = sct_val(timer_id);

The final report on all timers is given by

sct_report(proc_choice, thread_choice, sp_merging);

where

Install

SCT uses autotools for the installation on your system. If you got the src from GIT-repo you need to have at least autoconf-2.69, automake 1.14 and libtool 2.4.2 installed. Produce a new configure script via:

autoreconf -fvi

If you downloaded the tar.gz file, you will already have the configure script, just use:

./configure
make
make check
make install

You can also specify several configure options, try –help for all details.

Controlling the output by environment variables

We support writing the measured timers to

Please use the folowing environment variables to control the output location:

Reduction of timer results over several MPI-tasks and/or OpenMP-threads (showing min/max/avg) or complete output is done via

Recording of eventcounters (if sct is installed with PAPI support)

Extended (showing statistics for each timer) or simple (showing only total sum for each timer) listing

Simple bookkeeping of timer hierarchy