38#ifndef vtkParallelTimer_h
39#define vtkParallelTimer_h
41#define vtkParallelTimerDEBUG -1
44#include "vtkRenderingParallelLICModule.h"
49#if vtkParallelTimerDEBUG > 0
53class vtkParallelTimerBuffer;
92 vtkSetMacro(WriterRank,
int);
93 vtkGetMacro(WriterRank,
int);
108 this->SetFileName(fileName.c_str());
131 template <
typename T>
183 vtkSetMacro(WriteOnClose,
int);
184 vtkGetMacro(WriteOnClose,
int);
192 vtkSetMacro(GlobalLevel,
int);
193 vtkGetMacro(GlobalLevel,
int);
207 class VTKRENDERINGPARALLELLIC_EXPORT vtkParallelTimerDestructor
210 vtkParallelTimerDestructor()
214 ~vtkParallelTimerDestructor();
229 std::vector<double> StartTime;
230#if vtkParallelTimerDEBUG < 0
231 std::vector<std::string> EventId;
234 vtkParallelTimerBuffer* Log;
237 static vtkParallelTimerDestructor GlobalInstanceDestructor;
239 std::ostringstream HeaderBuffer;
249 if (this->WorldRank == this->WriterRank)
251 this->HeaderBuffer << s;
252#if vtkParallelTimerDEBUG > 0
265 if (log->WorldRank == log->WriterRank)
267 log->HeaderBuffer << s;
268#if vtkParallelTimerDEBUG > 0
283#if vtkParallelTimerDEBUG > 0
a simple class to control print indentation
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
abstract base class for most VTK objects
Type used to direct an output stream into the log's body.
LogBodyType & operator<<(const T &s)
Provides distributed log functionality.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Update()
When an object is finished writing data to the log object it must call Update to send the data to the...
vtkGetFilePathMacro(FileName)
Set the filename that is used during write when the object is used as a singleton.
int Write()
Write the log contents to a file.
void EndEventSynch(int rank, const char *event)
The log works as an event stack.
static vtkParallelTimer * GetGlobalInstance()
The log class implements the singleton pattern so that it may be shared across class boundaries.
void SetFileName(VTK_FILEPATH const std::string &fileName)
void Clear()
Clear the log.
void EndEvent(int rank, const char *event)
The log works as an event stack.
static void DeleteGlobalInstance()
Explicitly delete the singleton.
void EndEventSynch(const char *event)
The log works as an event stack.
void StartEvent(int rank, const char *event)
The log works as an event stack.
void EndEvent(const char *event)
The log works as an event stack.
vtkParallelTimer::LogBodyType GetBody()
stream output to log body(all ranks).
static vtkParallelTimer * New()
virtual ~vtkParallelTimer()
friend class LogHeaderType
vtkParallelTimer::LogHeaderType GetHeader()
stream output to the log's header(root rank only).
void StartEvent(const char *event)
The log works as an event stack.
vtkSetFilePathMacro(FileName)
Set the filename that is used during write when the object is used as a singleton.
vtkParallelTimer & operator<<(const T &s)
Insert text into the log header on the writer rank.