aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2021-10-20 21:02:22 +0200
committerGravatar GitHub <noreply@github.com> 2021-10-20 19:02:22 +0000
commit02096d079680a2f7125db230bcde872dde63732c (patch)
tree14064a6a0b029a16f77ad357772546334e841867 /Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
parentc3f481bca813d834e248d1adeb5b5a02495b9e1a (diff)
downloadWarpX-02096d079680a2f7125db230bcde872dde63732c.tar.gz
WarpX-02096d079680a2f7125db230bcde872dde63732c.tar.zst
WarpX-02096d079680a2f7125db230bcde872dde63732c.zip
⚠️ Add warning logger (#2113)
* improve error msg * eliminate final dot * initial layout of the main classes * progress * progress with warnings * print local errors * progress with warning logger * improved MsgLogger * added file to test warnings * added method to read debug warnings from inputfile * progress towards collective gather of warnings * add missing blank line in warning message * move misplaced file * refactoring * fixed bugs * progress * fixed bugs * fixed some bugs * it finally works! * add comments in WarpX.H * add missing comment * added comments to WarpX.cpp * add profiler to WarpX.cpp * expose option to enable 'warn immediately' feature in cmake * Add comment to main.cpp * add missing comment in WarpX.cpp * add copyright and include guards to WarnManager_fwd.H * cleaning and added comments to WarnManager.H * updated test * added fwd file for MsgLogger * cleaning * Added copyright in WarnManager.cpp * Cleaning * cleaning * Add missing copyright * cleaning * clean and add comments to MsgLoggerSerialization.H * cleaning MsgLogger_fwd.H * cleaning * continue cleaning MsgLogger * added comments & bugfixing * removed test file * fixed bugs * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/WarpX.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLogger.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/MsgLogger/MsgLoggerSerialization.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.H Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Update Source/Utils/WarnManager.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * fixed bugs * Update Source/Utils/MsgLogger/MsgLogger.cpp Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com> * Added comment to explain rotation * use last value computed by partial_sum * fix bug * now use error stream * using anonymous namespace for helper functions * print on both stderr and stdout * now using runtime parameter to always print warnings * added documentation * using long int for counter * sort affected warnings list * add doc entry * removed doc * added documentation * fixed bug * fixed bug * removing unnecessary text * reformatting * reformatting * fixed bug * fixed bug * correction * add warning_logger.rst to toctree in developers.rst Co-authored-by: Neïl Zaim <49716072+NeilZaim@users.noreply.github.com>
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp')
-rw-r--r--Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
index 08230ac1a..62fea2dd8 100644
--- a/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
+++ b/Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
@@ -522,14 +522,16 @@ FlushFormatPlotfile::WriteAllRawFields(
WriteRawMF( warpx.getBfield_fp(lev, 2), dm, raw_pltname, default_level_prefix, "Bz_fp", lev, plot_raw_fields_guards);
if (plot_raw_F) {
if (warpx.get_pointer_F_fp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw F data, but F_fp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw F data, but F_fp was not allocated");
} else {
WriteRawMF(warpx.getF_fp(lev), dm, raw_pltname, default_level_prefix, "F_fp", lev, plot_raw_fields_guards);
}
}
if (plot_raw_rho) {
if (warpx.get_pointer_rho_fp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw rho data, but rho_fp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw rho data, but rho_fp was not allocated");
} else {
// Use the component 1 of `rho_fp`, i.e. rho_new for time synchronization
// If nComp > 1, this is the upper half of the list of components.
@@ -579,9 +581,11 @@ FlushFormatPlotfile::WriteAllRawFields(
dm, raw_pltname, default_level_prefix, lev, plot_raw_fields_guards);
if (plot_raw_F) {
if (warpx.get_pointer_F_fp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw F data, but F_fp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw F data, but F_fp was not allocated");
} else if (warpx.get_pointer_F_cp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw F data, but F_cp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw F data, but F_cp was not allocated");
} else {
WriteCoarseScalar("F", warpx.get_pointer_F_cp(lev), warpx.get_pointer_F_fp(lev),
dm, raw_pltname, default_level_prefix, lev, plot_raw_fields_guards, 0);
@@ -589,9 +593,11 @@ FlushFormatPlotfile::WriteAllRawFields(
}
if (plot_raw_rho) {
if (warpx.get_pointer_rho_fp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw rho data, but rho_fp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw rho data, but rho_fp was not allocated");
} else if (warpx.get_pointer_rho_cp(lev) == nullptr) {
- amrex::Warning("The user requested to write raw rho data, but rho_cp was not allocated");
+ WarpX::GetInstance().RecordWarning("Diagnostics",
+ "The user requested to write raw rho data, but rho_cp was not allocated");
} else {
// Use the component 1 of `rho_cp`, i.e. rho_new for time synchronization
WriteCoarseScalar("rho", warpx.get_pointer_rho_cp(lev), warpx.get_pointer_rho_fp(lev),