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
18#include "tarch/logging/Log.h"
19
20#ifdef UseScoreP
21#include <scorep/SCOREP_User_Types.h>
22#endif
23
24namespace tarch {
25 namespace logging {
26 class ScorePLogger;
27 }
28}
29
55 private:
56 static Log _log;
57
59
61
62 #ifdef UseScoreP
63 std::map< std::string, SCOREP_User_RegionHandle > _scorePHandles;
64 #endif
65
71
76 ScorePLogger(const ScorePLogger&) = delete;
77
94 std::string messageType,
95 long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message
96 );
97
102
103 std::string getTimeStampHumanReadable( long int timestampNanoseconds ) const;
104
105 public:
107
109
114 bool getLogMachineName() const;
115
120 bool getLogThreadName() const;
121
126 bool getLogTrace() const;
127
132 bool getLogTimeStamp() const;
133
134 void debug( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
135 void info( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
136
146 void warning( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
147
157 void error( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
158
159 void traceIn( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
160 void traceOut( long int timestampNanoseconds, int rank, int threadId, const std::string& trace, const std::string& message);
161
188 void indent( bool indent, const std::string& trace, const std::string& message );
189
190 void close();
191};
Log Device.
Definition Log.h:516
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)
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)
tarch::multicore::BooleanSemaphore _semaphore
void indent(bool indent, const std::string &trace, const std::string &message)
Tells the logger to increment/decrement the indent.
std::string constructMessageString(std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
Construct message string.
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