Peano
Loading...
Searching...
No Matches
ITTLogger.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#ifdef Parallel
6#include <mpi.h>
7#endif
8
9#include <iostream>
10#include <fstream>
11#include <set>
12#include <stack>
13#include <map>
14#include <string>
15
18#include "tarch/logging/Log.h"
19
20#ifdef UseITT
21#include <ittnotify.h>
22#endif
23
24namespace tarch {
25 namespace logging {
26 class ITTLogger;
27 }
28}
29
59 private:
60 static Log _log;
61
63
65
66 #ifdef UseITT
67 std::map< std::string, __itt_event > _ittHandles;
68 #endif
69
71
77
82 ITTLogger(const ITTLogger&) = delete;
83
99 std::string constructMessageString(
100 std::string messageType,
101 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
102 );
103
111 ITTLogger();
112
113 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
114
115 public:
116 ~ITTLogger();
117
118 static ITTLogger& getInstance();
119
124 bool getLogMachineName() const;
125
130 bool getLogThreadName() const;
131
136 bool getLogTrace() const;
137
142 bool getLogTimeStamp() const;
143
144 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
145 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
146
156 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
157
167 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
168
172 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
173 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
174
201 void indent( bool indent, const std::string& trace, const std::string& message );
202
203 void close();
204
205 void suspendTrace();
206 void continueTrace();
207};
Command Line Logger.
Definition ITTLogger.h:58
std::string getTimeStampHumanReadable(long int timestampNanoseconds) const
Definition ITTLogger.cpp:57
static ITTLogger _singleton
Definition ITTLogger.h:62
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
void indent(bool indent, const std::string &trace, const std::string &message)
Tells the logger to increment/decrement the indent.
Definition ITTLogger.cpp:54
ITTLogger & operator=(const CommandLineLogger &)=delete
Declared private since assignment does not make sense for an output class (output information mismatc...
bool getLogTrace() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void warning(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Warning.
void error(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Error.
tarch::multicore::BooleanSemaphore _semaphore
Definition ITTLogger.h:64
bool getLogTimeStamp() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
ITTLogger()
It's a singleton.
Definition ITTLogger.cpp:25
void info(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
std::string constructMessageString(std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string.
Definition ITTLogger.cpp:87
bool getLogMachineName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void debug(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
ITTLogger(const ITTLogger &)=delete
Declared private since copying does not make sense for an output class (output information mismatch).
static ITTLogger & getInstance()
Definition ITTLogger.cpp:30
bool getLogThreadName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void traceIn(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2023-0/event-api....
Log Device.
Definition Log.h:516
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19