18#ifdef PRECICE_COMPRESSION
48 static constexpr char type =
'b';
53 static constexpr char type =
'e';
60 static constexpr char type =
'd';
66 static constexpr char type =
'n';
167#ifdef PRECICE_COMPRESSION
#define PRECICE_UNREACHABLE(...)
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
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.
std::vector< char > _inbuf
Buffer for the text to be written to file.
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
void put(PendingEntry pe)
Records an event.
std::map< std::string, int, std::less<> > _nameDict
EventRegistry(EventRegistry &&)=delete
int _rank
The rank/number of parallel instance of the current program.
std::size_t _writeQueueMax
EventRegistry & operator=(EventRegistry &&)=delete
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.
bool accepting(Group g) const
Should an event of this class be forwarded to the registry?
std::string _applicationName
The name of the current participant.
void putCritical(PendingEntry pe)
Records an event without flushing events.
EventRegistry(EventRegistry const &)=delete
Deleted copy and move SMFs for singleton pattern.
void flush()
Writes all recorded events to file and flushes the buffer.
bool parallel() const
Is the solver running in parallel?
std::chrono::system_clock::time_point _initTime
The initial time, used to describe when the run started.
contains profiling utilities.
static constexpr Group API
Convenience instance of the Cat::API.
Mode
The Mode of the Event utility.
std::variant< StartEntry, StopEntry, DataEntry, NameEntry > PendingEntry
Group
Tag to annotate event group.
static constexpr Group Fundamental
Convenience instance of the Cat::Fundamental.
DataEntry(int eid, Event::Clock::time_point c, int did, int dv)
static constexpr char type
static constexpr char type
TimedEntry(int eid, Event::Clock::time_point c)
static constexpr char type
TimedEntry(int eid, Event::Clock::time_point c)
static constexpr char type
TimedEntry(int eid, Event::Clock::time_point c)
Event::Clock::time_point clock