Go to the documentation of this file.
38 #ifndef vtkParallelTimer_h
39 #define vtkParallelTimer_h
41 #define vtkParallelTimerDEBUG -1
44 #include "vtkRenderingParallelLICModule.h"
49 #if vtkParallelTimerDEBUG > 0
53 class vtkParallelTimerBuffer;
90 vtkSetMacro(WriterRank,
int);
91 vtkGetMacro(WriterRank,
int);
100 vtkSetStringMacro(FileName);
101 vtkGetStringMacro(FileName);
105 { this->SetFileName(fileName.c_str()); }
181 vtkSetMacro(WriteOnClose,
int);
182 vtkGetMacro(WriteOnClose,
int);
190 vtkSetMacro(GlobalLevel,
int);
191 vtkGetMacro(GlobalLevel,
int);
205 class VTKRENDERINGPARALLELLIC_EXPORT vtkParallelTimerDestructor
208 vtkParallelTimerDestructor() : Log(0) {}
209 ~vtkParallelTimerDestructor();
224 std::vector<double> StartTime;
225 #if vtkParallelTimerDEBUG < 0
226 std::vector<std::string> EventId;
229 vtkParallelTimerBuffer *Log;
232 static vtkParallelTimerDestructor GlobalInstanceDestructor;
234 std::ostringstream HeaderBuffer;
244 if (this->WorldRank == this->WriterRank)
246 this->HeaderBuffer << s;
247 #if vtkParallelTimerDEBUG > 0
260 if (log->WorldRank == log->WriterRank)
262 log->HeaderBuffer << s;
263 #if vtkParallelTimerDEBUG > 0
278 #if vtkParallelTimerDEBUG > 0
void StartEvent(const char *event)
The log works as an event stack.
void StartEvent(int rank, const char *event)
int Write()
Write the log contents to a file.
Provides distributed log functionality.
static vtkParallelTimer * GetGlobalInstance()
The log class implements the singleton pattern so that it may be shared across class boundaries.
virtual ~vtkParallelTimer()
abstract base class for most VTK objects
LogBodyType & operator<<(const T &s)
vtkParallelTimer::LogBodyType GetBody()
stream output to log body(all ranks).
void Update()
When an object is finished writing data to the log object it must call Update to send the data to the...
vtkParallelTimer::LogHeaderType GetHeader()
stream output to the log's header(root rank only).
vtkParallelTimer & operator<<(const T &s)
Insert text into the log header on the writer rank.
void Clear()
Clear the log.
friend class LogHeaderType
static void DeleteGlobalInstance()
Explicitly delete the singleton.
void EndEvent(const char *event)
a simple class to control print indentation
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkParallelTimer * New()
void EndEvent(int rank, const char *event)
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
void EndEventSynch(const char *event)
Type used to direct an output stream into the log's body.
void EndEventSynch(int rank, const char *event)
void SetFileName(const std::string &fileName)