Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Remove warning from existing report (#49)
Browse files Browse the repository at this point in the history
- Avoid poluting the log file with prints from each rank
  • Loading branch information
jorblancoa authored Oct 24, 2024
1 parent c94dce8 commit b42e721
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/library/reports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ int sonata_create_report(const char* report_name,
double dt,
const char* units,
const char* kind) {
if (sonata_report.report_exists(report_name)) {
return -2;
}
try {
if (!sonata_report.report_exists(report_name)) {
sonata_report.create_report(report_name, kind, tstart, tend, dt, units);
} else {
logger->warn("Report '{}' already exists.", report_name);
return -2;
}
sonata_report.create_report(report_name, kind, tstart, tend, dt, units);
} catch (const std::exception& err) {
logger->error(err.what());
return -1;
Expand Down

0 comments on commit b42e721

Please sign in to comment.