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);
91 vtkSetFilePathMacro(FileName);
92 vtkGetFilePathMacro(FileName);
97 this->SetFileName(fileName.c_str());
109 void StartEvent(
const char* event);
110 void StartEvent(
int rank,
const char* event);
111 void EndEvent(
const char* event);
112 void EndEvent(
int rank,
const char* event);
113 void EndEventSynch(
const char* event);
114 void EndEventSynch(
int rank,
const char* event);
120 template <
typename T>
165 static void DeleteGlobalInstance();
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
friend class LogHeaderType
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
LogBodyType & operator<<(const T &s)
Type used to direct an output stream into the log's body.
Provides distributed log functionality.
void SetFileName(VTK_FILEPATH const std::string &fileName)
static vtkParallelTimer * GetGlobalInstance()
The log class implements the singleton pattern so that it may be shared across class boundaries...
vtkParallelTimer::LogBodyType GetBody()
stream output to log body(all ranks).
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
vtkParallelTimer::LogHeaderType GetHeader()
stream output to the log's header(root rank only).
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
vtkParallelTimer & operator<<(const T &s)
Insert text into the log header on the writer rank.