38 #ifndef vtkParallelTimer_h
39 #define vtkParallelTimer_h
41 #define vtkParallelTimerDEBUG -1
44 #include "vtkRenderingParallelLICModule.h"
49 #if vtkParallelTimerDEBUG > 0
53 class vtkParallelTimerBuffer;
92 vtkSetMacro(WriterRank,
int);
93 vtkGetMacro(WriterRank,
int);
102 vtkSetFilePathMacro(FileName);
103 vtkGetFilePathMacro(FileName);
108 this->SetFileName(fileName.c_str());
120 void StartEvent(
const char* event);
121 void StartEvent(
int rank,
const char* event);
122 void EndEvent(
const char* event);
123 void EndEvent(
int rank,
const char* event);
124 void EndEventSynch(
const char* event);
125 void EndEventSynch(
int rank,
const char* event);
131 template <
typename T>
176 static void DeleteGlobalInstance();
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;
246 template <
typename T>
249 if (this->WorldRank == this->WriterRank)
251 this->HeaderBuffer << s;
252 #if vtkParallelTimerDEBUG > 0
260 template <
typename T>
265 if (log->WorldRank == log->WriterRank)
267 log->HeaderBuffer << s;
268 #if vtkParallelTimerDEBUG > 0
277 template <
typename T>
283 #if vtkParallelTimerDEBUG > 0
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.