26 #ifndef vtkParallelTimer_h
27 #define vtkParallelTimer_h
29 #define vtkParallelTimerDEBUG -1
32 #include "vtkRenderingParallelLICModule.h"
37 #if vtkParallelTimerDEBUG > 0
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkParallelTimerBuffer;
81 vtkSetMacro(WriterRank,
int);
82 vtkGetMacro(WriterRank,
int);
97 this->SetFileName(fileName.c_str());
120 template <
typename T>
172 vtkSetMacro(WriteOnClose,
int);
173 vtkGetMacro(WriteOnClose,
int);
181 vtkSetMacro(GlobalLevel,
int);
182 vtkGetMacro(GlobalLevel,
int);
196 class VTKRENDERINGPARALLELLIC_EXPORT vtkParallelTimerDestructor
199 vtkParallelTimerDestructor()
203 ~vtkParallelTimerDestructor();
217 std::vector<double> StartTime;
218 #if vtkParallelTimerDEBUG < 0
219 std::vector<std::string> EventId;
222 vtkParallelTimerBuffer* Log;
225 static vtkParallelTimerDestructor GlobalInstanceDestructor;
227 std::ostringstream HeaderBuffer;
234 template <
typename T>
237 if (this->WorldRank == this->WriterRank)
239 this->HeaderBuffer << s;
240 #if vtkParallelTimerDEBUG > 0
248 template <
typename T>
253 if (log->WorldRank == log->WriterRank)
255 log->HeaderBuffer << s;
256 #if vtkParallelTimerDEBUG > 0
265 template <
typename T>
271 #if vtkParallelTimerDEBUG > 0
278 VTK_ABI_NAMESPACE_END
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.
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.
static vtkParallelTimer * GetGlobalInstance()
The log class implements the singleton pattern so that it may be shared across class boundaries.
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).
~vtkParallelTimer() override
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.
static vtkParallelTimer * New()
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.