19#include <scorep/SCOREP_User.h>
39 long int timestampSeconds = timestampNanoseconds / 1000 / 1000 / 1000;
40 const int HourScaling = 60 * 60;
41 long int hours = timestampSeconds / HourScaling;
42 timestampSeconds = timestampSeconds - HourScaling * hours;
44 const int MinutesScaling = 60;
45 long int minutes = timestampSeconds / MinutesScaling;
46 timestampSeconds = timestampSeconds - MinutesScaling * minutes;
48 const int SecondsScaling = 1;
49 long int seconds = timestampSeconds / SecondsScaling;
51 std::stringstream result;
55 result << hours <<
":";
59 result << minutes <<
":";
68 [[maybe_unused]] std::string messageType,
69 [[maybe_unused]]
long int timestampNanoseconds,
70 [[maybe_unused]]
int rank,
71 [[maybe_unused]]
int threadId,
72 [[maybe_unused]]
const std::string& trace,
73 [[maybe_unused]]
const std::string& message
75 std::ostringstream result;
76 result << getTimeStampHumanReadable(timestampNanoseconds)
79 <<
"\t" << messageType
86 #if !defined(PeanoDebug) || PeanoDebug<1
90 std::string outputMessage = constructMessageString(
92 timestampNanoseconds, rank, threadId, trace, message
96 std::cout << outputMessage;
100 std::string outputMessage = constructMessageString(
102 timestampNanoseconds, rank, threadId, trace, message
106 std::cout << outputMessage;
110 std::string outputMessage = constructMessageString(
112 timestampNanoseconds, rank, threadId, trace, message
116 std::cerr << outputMessage;
121 std::string outputMessage = constructMessageString(
123 timestampNanoseconds, rank, threadId, trace, message
127 std::cerr << outputMessage;
135 [[maybe_unused]]
long int timestampNanoseconds,
136 [[maybe_unused]]
int rank,
137 [[maybe_unused]]
int threadId,
138 [[maybe_unused]]
const std::string& trace,
139 [[maybe_unused]]
const std::string& message
144 if (_scorePHandles.count(trace)==0) {
145 _scorePHandles.insert( std::pair<std::string, int>(trace,SCOREP_USER_INVALID_REGION) );
148 SCOREP_USER_REGION_ENTER(_scorePHandles[trace]);
153 [[maybe_unused]]
long int timestampNanoseconds,
154 [[maybe_unused]]
int rank,
155 [[maybe_unused]]
int threadId,
156 [[maybe_unused]]
const std::string& trace,
157 [[maybe_unused]]
const std::string& message
160 SCOREP_USER_REGION_LEAVE(_scorePHandles[trace]);
void debug(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
void traceOut(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
static ScorePLogger & getInstance()
void traceIn(long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message)
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)
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.
static ScorePLogger _singleton
static void abort(int errorCode)
A proper abort in an MPI context has to use MPI_Abort.
Create a lock around a boolean semaphore region.
static const std::string TargetDebug
static const std::string TargetInfo