8 #ifndef ABLASTR_WARN_MANAGER_H_
9 #define ABLASTR_WARN_MANAGER_H_
87 const std::string& topic,
88 const std::string& text,
99 const std::string& when)
const;
109 const std::string& when)
const;
189 const std::string& when,
202 const std::string& msg,
207 std::unique_ptr<ablastr::utils::msg_logger::Logger>
m_p_logger ;
228 const std::string& topic,
229 const std::string& text,
Definition: WarnManager.H:49
WarnManager & operator=(const WarnManager &&)=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:219
static std::string GetHeader(const std::string &when, int line_size, bool is_global)
This function generates the header of the warning messages list.
Definition: WarnManager.cpp:269
WarnManager & operator=(const WarnManager &)=delete
void SetAlwaysWarnImmediately(bool always_warn_immediately)
Setter for the m_always_warn_immediately.
Definition: WarnManager.cpp:163
std::unique_ptr< ablastr::utils::msg_logger::Logger > m_p_logger
Definition: WarnManager.H:207
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:106
WarnManager(const WarnManager &)=delete
bool GetAlwaysWarnImmediatelyFlag() const
Getter for the m_always_warn_immediately.
Definition: WarnManager.cpp:168
static const int warn_tab_size
Definition: WarnManager.H:149
void debug_read_warnings_from_input(const amrex::ParmParse ¶ms)
This function reads warning messages from the inputfile. It is intended for debug&testing purposes.
Definition: WarnManager.cpp:183
std::optional< WarnPriority > m_abort_on_warning_threshold
Definition: WarnManager.H:209
int m_rank
Definition: WarnManager.H:206
std::optional< WarnPriority > GetAbortThreshold() const
Getter for the m_abort_on_warning_threshold flag.
Definition: WarnManager.cpp:178
WarnManager(WarnManager &&)=delete
static std::string MsgFormatter(const std::string &msg, int line_size, int tab_size)
This function formats each line of a warning message text.
Definition: WarnManager.cpp:294
bool m_always_warn_immediately
Definition: WarnManager.H:208
void RecordWarning(const std::string &topic, const std::string &text, const WarnPriority &priority=WarnPriority::medium)
This function records a warning message (recording a warning message is thread-safe)
Definition: WarnManager.cpp:57
WarnManager()
Definition: WarnManager.cpp:52
static WarnManager & GetInstance()
Definition: WarnManager.cpp:47
static const int warn_line_size
Definition: WarnManager.H:148
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:173
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:131
Definition: WarnManager.H:20
void WMRecordWarning(const std::string &topic, const std::string &text, const WarnPriority &priority=WarnPriority::medium)
Helper function to abbreviate the call to WarnManager::GetInstance().RecordWarning (recording a warni...
Definition: WarnManager.cpp:318
WarnManager & GetWMInstance()
Helper function to abbreviate the call to get a WarnManager instance.
Definition: WarnManager.cpp:313
WarnPriority
Definition: WarnManager.H:27
Definition: MsgLogger.H:133
Definition: MsgLogger.H:95