Peano
Loading...
Searching...
No Matches
ScorePLogger.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
19#include "tarch/logging/Log.h"
20
21#ifdef UseScoreP
22#include <scorep/SCOREP_User_Types.h>
23#endif
24
25namespace tarch {
26 namespace logging {
27 class ScorePLogger;
28 }
29}
30
80 private:
81 static Log _log;
82
84
86
87 #ifdef UseScoreP
88 std::map< std::string, SCOREP_User_RegionHandle > _scorePHandles;
89 #endif
90
96
101 ScorePLogger(const ScorePLogger&) = delete;
102
119 std::string messageType,
120 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
121 );
122
127
128 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
129
130 public:
132
134
139 bool getLogMachineName() const;
140
145 bool getLogThreadName() const;
146
151 bool getLogTrace() const;
152
157 bool getLogTimeStamp() const;
158
159 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
160 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
161
171 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
172
182 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
183
184 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
185
203 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
204
212 void indent( bool indent, const std::string& trace ) {};
213
214 void close();
215};
Log Device.
Definition Log.h:517
Command Line Logger.
void debug(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.
bool getLogMachineName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
bool getLogThreadName() const
Is public as some analysis frameworks check explicitly whether these features are switched on.
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Log trace out event.
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.
static ScorePLogger _singleton
static ScorePLogger & getInstance()
ScorePLogger()
It's a singleton.
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 getTimeStampHumanReadable(long int timestampNanoseconds) const
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.
tarch::multicore::MultiReadSingleWriteSemaphore _semaphore
void indent(bool indent, const std::string &trace)
Tells the logger to increment/decrement the indent.
ScorePLogger & operator=(const CommandLineLogger &)=delete
Declared private since assignment does not make sense for an output class (output information mismatc...
ScorePLogger(const ScorePLogger &)=delete
Declared private since copying does not make sense for an output class (output information mismatch).
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19