48 static constexpr char type =
'b';
53 static constexpr char type =
'e';
60 static constexpr char type =
'd';
66 static constexpr char type =
'n';
This class provides a lightweight logger.
static EventRegistry & instance()
Returns the only instance (singleton) of the EventRegistry class.
void startBackend()
Create the file and starts the filestream if profiling is turned on.
void initialize(std::string_view applicationName, int rank=0, int size=1)
Sets the global start time.
EventRegistry & operator=(EventRegistry const &)=delete
std::string prefix
Currently active prefix. Changing that applies only to newly created events.
void clear()
Clears the registry.
void setWriteQueueMax(std::size_t size)
Sets the maximum size of the writequeue before calling flush(). Use 0 to flush on destruction.
void setDirectory(std::string_view directory)
Sets the directory where to write the event files to.
int nameToID(std::string_view name)
int _size
The amount of parallel instances of the current program.
void finalize()
Sets the global end time and flushes buffers.
void setMode(Mode mode)
Sets the operational mode of the registry.
void stopBackend()
Stops the global event, flushes the buffers and closes the filestream.
Mode _mode
The operational mode of the registry.
std::vector< PendingEntry > _writeQueue
bool _firstwrite
Indicator for the first record to be written.
void put(PendingEntry pe)
Records an event.
std::map< std::string, int, std::less<> > _nameDict
EventRegistry(EventRegistry &&)=delete
std::size_t _writeQueueMax
EventRegistry & operator=(EventRegistry &&)=delete
bool accepting(EventClass ec) const
Should an event of this class be forwarded to the registry?
Event::Clock::time_point _initClock
The initial time clock, used to take runtime measurements.
std::optional< int > _globalId
The id of the global event.
EventRegistry()=default
Private, empty constructor for singleton pattern.
std::string _applicationName
The name of the current participant.
EventRegistry(EventRegistry const &)=delete
Deleted copy and move SMFs for singleton pattern.
void flush()
Writes all recorded events to file and flushes the buffer.
std::chrono::system_clock::time_point _initTime
The initial time, used to describe when the run started.
contains profiling utilities.
static constexpr FundamentalTag Fundamental
Convenience instance of the FundamentalTag.
EventClass toEventClass(bool isFundamental)
Mode
The Mode of the Event utility.
DataEntry(int eid, Event::Clock::time_point c, int did, int dv)
static constexpr char type
static constexpr char type
static constexpr char type
static constexpr char type
An event that has been recorded and it waiting to be written to file.
TimedEntry(int eid, Event::Clock::time_point c)
Event::Clock::time_point clock