Peano
Loading...
Searching...
No Matches
NVTXLogger.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
16#include "tarch/logging/Log.h"
17
18namespace tarch {
19 namespace logging {
20 class NVTXLogger;
21 }
22}
23
49 private:
50 static Log _log;
51
53
55
61
66 NVTXLogger(const NVTXLogger&) = delete;
67
83 std::string constructMessageString(
84 std::string messageType,
85 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
86 );
87
91 NVTXLogger();
92
93 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
94
95 public:
97
98 static NVTXLogger& getInstance();
99
104 bool getLogMachineName() const;
105
110 bool getLogThreadName() const;
111
116 bool getLogTrace() const;
117
122 bool getLogTimeStamp() const;
123
124 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
125 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
126
136 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
137
147 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
148
149 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
150 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
151
178 void indent( bool indent, const std::string& trace, const std::string& message );
179
180 void close();
181};
Log Device.
Definition Log.h:516
Command Line Logger.
Definition NVTXLogger.h:48
tarch::multicore::BooleanSemaphore _semaphore
Definition NVTXLogger.h:54
void indent(bool indent, const std::string &trace, const std::string &message)
Tells the logger to increment/decrement the indent.
static NVTXLogger _singleton
Definition NVTXLogger.h:52
NVTXLogger & operator=(const CommandLineLogger &)=delete
Declared private since assignment does not make sense for an output class (output information mismatc...
void traceIn(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
bool getLogTimeStamp() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void info(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
bool getLogTrace() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
NVTXLogger()
It's a singleton.
static NVTXLogger & getInstance()
void warning(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Warning.
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
NVTXLogger(const NVTXLogger &)=delete
Declared private since copying does not make sense for an output class (output information mismatch).
std::string getTimeStampHumanReadable(long int timestampNanoseconds) const
void error(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Write Error.
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)
bool getLogThreadName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
std::string constructMessageString(std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19