8 #ifndef ABLASTR_WARN_MANAGER_H_
9 #define ABLASTR_WARN_MANAGER_H_
84 const std::string& when)
const;
94 const std::string& when)
const;
174 const std::string& when,
176 const bool is_global);
187 const std::string& msg,
192 std::unique_ptr<ablastr::utils::msg_logger::Logger>
m_p_logger ;
Definition: WarnManager.H:49
static std::string MsgFormatter(const std::string &msg, const int line_size, const int tab_size)
This function formats each line of a warning message text.
Definition: WarnManager.cpp:283
WarnManager(WarnManager &other)=delete
std::string PrintWarnMsg(const ablastr::utils::msg_logger::MsgWithCounter &msg_with_counter) const
This function generates a string for a single entry of the warning list for a MessageWithCounter stru...
Definition: WarnManager.cpp:211
void SetAlwaysWarnImmediately(bool always_warn_immediately)
Setter for the m_always_warn_immediately.
Definition: WarnManager.cpp:155
std::unique_ptr< ablastr::utils::msg_logger::Logger > m_p_logger
Definition: WarnManager.H:192
std::string PrintLocalWarnings(const std::string &when) const
This function prints all the warning messages collected on the present MPI rank (i....
Definition: WarnManager.cpp:99
bool GetAlwaysWarnImmediatelyFlag() const
Getter for the m_always_warn_immediately.
Definition: WarnManager.cpp:160
static std::string GetHeader(const std::string &when, const int line_size, const bool is_global)
This function generates the header of the warning messages list.
Definition: WarnManager.cpp:258
static const int warn_tab_size
Definition: WarnManager.H:134
void RecordWarning(std::string topic, std::string text, WarnPriority priority=WarnPriority::medium)
This function records a warning message (recording a warning message is thread-safe)
Definition: WarnManager.cpp:52
std::optional< WarnPriority > m_abort_on_warning_threshold
Definition: WarnManager.H:194
int m_rank
Definition: WarnManager.H:191
std::optional< WarnPriority > GetAbortThreshold() const
Getter for the m_abort_on_warning_threshold flag.
Definition: WarnManager.cpp:170
void operator=(const WarnManager &)=delete
bool m_always_warn_immediately
Definition: WarnManager.H:193
void debug_read_warnings_from_input(amrex::ParmParse ¶ms)
This function reads warning messages from the inputfile. It is intended for debug&testing purposes.
Definition: WarnManager.cpp:175
WarnManager()
Definition: WarnManager.cpp:47
static WarnManager & GetInstance()
Definition: WarnManager.cpp:42
static const int warn_line_size
Definition: WarnManager.H:133
void SetAbortThreshold(std::optional< WarnPriority > abort_threshold)
Setter for the m_abort_on_warning_threshold flag (pass std::nullopt in order to never abort)
Definition: WarnManager.cpp:165
std::string PrintGlobalWarnings(const std::string &when) const
This function prints all the warning messages collected by all the MPI ranks (i.e....
Definition: WarnManager.cpp:124
Definition: WarnManager.H:20
void WMRecordWarning(std::string topic, std::string text, WarnPriority priority=WarnPriority::medium)
Helper function to abbreviate the call to WarnManager::GetInstance().RecordWarning (recording a warni...
Definition: WarnManager.cpp:306
WarnManager & GetWMInstance()
Helper function to abbreviate the call to get a WarnManager instance.
Definition: WarnManager.cpp:301
WarnPriority
Definition: WarnManager.H:27
Definition: MsgLogger.H:133
Definition: MsgLogger.H:95