From 0fce189ef2a77f9f00e498b8661cf262764c0bb6 Mon Sep 17 00:00:00 2001 From: 13thProgression Date: Mon, 19 Apr 2021 14:43:21 -0600 Subject: [PATCH] Include job age any time that a plot is held off; Insert the last delay message into the log if it isn't a stagger --- src/plotman/interactive.py | 7 +++++++ src/plotman/manager.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plotman/interactive.py b/src/plotman/interactive.py index 321aa14c..f6dafb68 100644 --- a/src/plotman/interactive.py +++ b/src/plotman/interactive.py @@ -87,6 +87,7 @@ def curses_main(stdscr): pressed_key = '' # For debugging archdir_freebytes = None + aging_reason = None while True: @@ -113,10 +114,16 @@ def curses_main(stdscr): cfg.directories, cfg.scheduling, cfg.plotting ) if (started): + if aging_reason is not None: + log.log(aging_reason) + aging_reason = None log.log(msg) plotting_status = '' jobs = Job.get_running_jobs(cfg.directories.log, cached_jobs=jobs) else: + # If a plot is delayed for any reason other than stagger, log it + if msg.find("stagger") < 0: + aging_reason = msg plotting_status = msg if archiving_configured: diff --git a/src/plotman/manager.py b/src/plotman/manager.py index 19a45d63..9463bdd4 100644 --- a/src/plotman/manager.py +++ b/src/plotman/manager.py @@ -77,7 +77,7 @@ def maybe_start_new_plot(dir_cfg, sched_cfg, plotting_cfg): if (youngest_job_age < global_stagger): wait_reason = 'stagger (%ds/%ds)' % (youngest_job_age, global_stagger) elif len(jobs) >= sched_cfg.global_max_jobs: - wait_reason = 'max jobs (%d)' % sched_cfg.global_max_jobs + wait_reason = 'max jobs (%d) - (%ds/%ds)' % (sched_cfg.global_max_jobs, youngest_job_age, global_stagger) else: tmp_to_all_phases = [(d, job.job_phases_for_tmpdir(d, jobs)) for d in dir_cfg.tmp] eligible = [ (d, phases) for (d, phases) in tmp_to_all_phases @@ -86,7 +86,7 @@ def maybe_start_new_plot(dir_cfg, sched_cfg, plotting_cfg): for (d, phases) in eligible ] if not eligible: - wait_reason = 'no eligible tempdirs' + wait_reason = 'no eligible tempdirs (%ds/%ds)' % (youngest_job_age, global_stagger) else: # Plot to oldest tmpdir. tmpdir = max(rankable, key=operator.itemgetter(1))[0]