Skip to content

Commit

Permalink
Let Fetcher and reports log number of unexplained errors instead of p…
Browse files Browse the repository at this point in the history
…rinting all of them to stderr.
  • Loading branch information
jendrikseipp committed Dec 20, 2023
1 parent 4af49c0 commit d617dc2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ next (unreleased)
Lab
^^^
* Allow passing properties files to fetchers directly (Jendrik Seipp).
* Let fetch and report steps log onyl the total number of unexplained errors instead of printing all of them to stderr (Jendrik Seipp).

Downward Lab
^^^^^^^^^^^^
Expand Down
5 changes: 2 additions & 3 deletions downward/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _scan_planning_data(self):
int(bool(tools.get_unexplained_errors_message(run)))
for run in self.runs.values()
)
func = logging.info if num_unexplained_errors == 0 else logging.error
func = logging.info if num_unexplained_errors == 0 else logging.warning
func(
f"Report contains {num_unexplained_errors} runs with unexplained"
f" errors."
Expand Down Expand Up @@ -227,7 +227,6 @@ def _get_warnings_text_and_table(self):
for run in self.runs.values():
error_message = tools.get_unexplained_errors_message(run)
if error_message:
logging.error(error_message)
run_dir = run["run_dir"]
for attr in self.ERROR_ATTRIBUTES:
value = run.get(attr, "?")
Expand Down Expand Up @@ -256,7 +255,7 @@ def _get_warnings_text_and_table(self):
f"There was output to {slurm_err_file}. Below is the output without"
f'"memory cg" errors:\n```\n{slurm_err_content}\n```'
)
logging.error(f"There was output to {slurm_err_file}.")
logging.warning(f"There was output to {slurm_err_file}.")

if table:
errors.append(str(table))
Expand Down
10 changes: 5 additions & 5 deletions lab/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __call__(self, src_dir, eval_dir=None, merge=None, filter=None, **kwargs):
slurm_err_content = ""

if slurm_err_content:
logging.error("There was output to *-grid-steps/slurm.err")
logging.warning("There was output to *-grid-steps/slurm.err")

new_props = tools.Properties()
run_dirs = sorted(src_dir.glob("runs-*-*/*"))
Expand All @@ -159,12 +159,12 @@ def __call__(self, src_dir, eval_dir=None, merge=None, filter=None, **kwargs):
for props in combined_props.values():
error_message = tools.get_unexplained_errors_message(props)
if error_message:
logging.error(error_message)
unexplained_errors += 1

tools.makedirs(eval_dir)
combined_props.write()
logging.info(
f"Wrote properties file (contains {unexplained_errors} "
f"runs with unexplained errors)."
func = logging.info if unexplained_errors == 0 else logging.warning
func(
f"Wrote properties file. It contains {unexplained_errors} "
f"runs with unexplained errors."
)

0 comments on commit d617dc2

Please sign in to comment.