Peano
Loading...
Searching...
No Matches
ITACLogger.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
20namespace tarch {
21 namespace logging {
22 class ITACLogger;
23 }
24}
25
52 private:
53 static Log _log;
54
56
58
59 std::map< std::string, int > _itacHandles;
60
62
68
73 ITACLogger(const ITACLogger&) = delete;
74
90 std::string constructMessageString(
91 std::string messageType,
92 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
93 );
94
102 ITACLogger();
103
104 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
105
106 public:
107 ~ITACLogger();
108
109 static ITACLogger& getInstance();
110
115 bool getLogMachineName() const;
116
121 bool getLogThreadName() const;
122
127 bool getLogTrace() const;
128
133 bool getLogTimeStamp() const;
134
135 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
136 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
137
147 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
148
158 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
159
160 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
161 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
162
189 void indent( bool indent, const std::string& trace, const std::string& message );
190
191 void close();
192
193 void suspendTrace();
194 void continueTrace();
195};
Command Line Logger.
Definition ITACLogger.h:51
void info(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
tarch::multicore::BooleanSemaphore _semaphore
Definition ITACLogger.h:57
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)
std::map< std::string, int > _itacHandles
Definition ITACLogger.h:59
void indent(bool indent, const std::string &trace, const std::string &message)
Tells the logger to increment/decrement the indent.
static ITACLogger _singleton
Definition ITACLogger.h:55
std::string getTimeStampHumanReadable(long int timestampNanoseconds) const
ITACLogger(const ITACLogger &)=delete
Declared private since copying does not make sense for an output class (output information mismatch).
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
bool getLogMachineName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void error(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Error.
void warning(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Warning.
std::string constructMessageString(std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string.
bool getLogTimeStamp() 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)
ITACLogger()
It's a singleton.
bool getLogTrace() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
ITACLogger & operator=(const CommandLineLogger &)=delete
Declared private since assignment does not make sense for an output class (output information mismatc...
static ITACLogger & getInstance()
Log Device.
Definition Log.h:516
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19