KASKADE 7 development version
Loading...
Searching...
No Matches
Kaskade::TaskTiming Class Reference

A class that gathers data on task timing and provides gnuplot visualization. More...

#include <timing.hh>

Public Member Functions

 TaskTiming (int nTasks, int m=1)
 Constructor.
void start (int task)
 defines the start of given task.
void stop (int task)
 defines the start of given task.

Friends

std::ostream & operator<< (std::ostream &out, TaskTiming const &tt)

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &out, TaskTiming const &tt)
 output of task timing to gnuplot file

Detailed Description

A class that gathers data on task timing and provides gnuplot visualization.

This is particularly useful as a performance investigation tool in multithreaded computations, where one can investigate which task is performed during which time interval.

Template Parameters
nthe maximal number of segments for each task

Example usage:

TaskTiming tt(2);
start(0); doSomeWork(); stop(0);
start(1); doSomeOtherWork(); stop(1);
std::ofstream timings("timings.gnu"); timings << tt;
void start(int task)
defines the start of given task.
TaskTiming(int nTasks, int m=1)
Constructor.
void stop(int task)
defines the start of given task.

For visualization in form of horizontal task durations in second scale, use gnuplot as

plot "timings.gnu" with linepoints

Definition at line 299 of file timing.hh.

Constructor & Destructor Documentation

◆ TaskTiming()

Kaskade::TaskTiming::TaskTiming ( int nTasks,
int m = 1 )

Constructor.

Parameters
nTasksnumber of tasks to measure. Has to be nonnegative.
mmaximal number of segments per task to measure. Has to be nonnegative.

Referenced by operator<<.

Member Function Documentation

◆ start()

void Kaskade::TaskTiming::start ( int task)

defines the start of given task.

Parameters
taskthe task number in [0,nTasks[ If called multiple times for a task, only the last call counts.

Referenced by Kaskade::parallelFor(), and Kaskade::PatchDomainDecompositionPreconditioner< Space, m, StorageTag, SparseMatrixIndex >::PatchDomainDecompositionPreconditioner().

◆ stop()

void Kaskade::TaskTiming::stop ( int task)

defines the start of given task.

Parameters
taskthe task number in [0,nTasks[ If called multiple times for a task, only the last call counts.

Referenced by Kaskade::parallelFor(), and Kaskade::PatchDomainDecompositionPreconditioner< Space, m, StorageTag, SparseMatrixIndex >::PatchDomainDecompositionPreconditioner().

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & out,
TaskTiming const & tt )
friend

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & out,
TaskTiming const & tt )
related

output of task timing to gnuplot file


The documentation for this class was generated from the following file: