From 53ec8833b19670438332da380165a5feef833e89 Mon Sep 17 00:00:00 2001 From: zaihuaji Date: Mon, 28 Sep 2026 12:11:09 -0500 Subject: [PATCH] word the progress queue depths as states and guard -A 7 too; bump version to 3.0.15 Only -A 4 and -A 6 transfer, so reporting the status 'T' count as 'N to transfer' in an -A 3 report claimed work that run never performs. Both queue depths are now worded as states. -A 7, a documented action and the longest running combination, was missing from the walltime guard's action list and so could never report progress at all. Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- src/rda_python_dsquasar/dsquasar.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4d92e1a..1aa17f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rda_python_dsquasar" -version = "3.0.14" +version = "3.0.15" authors = [ { name="Zaihua Ji", email="zji@ucar.edu" }, ] diff --git a/src/rda_python_dsquasar/dsquasar.py b/src/rda_python_dsquasar/dsquasar.py index ccfc5c8..f92985c 100644 --- a/src/rda_python_dsquasar/dsquasar.py +++ b/src/rda_python_dsquasar/dsquasar.py @@ -867,15 +867,17 @@ def report_dscheck_email(self, title, cache = 0): self.pglog("Cannot clean the progress report of {}; it is emailed again".format(cnd), self.LOGWRN) return estat - # guard the long PBS batch jobs (-A 2/3/4/6) against the walltime: once past MAXRUNTIME + # guard the long PBS batch jobs (-A 2/3/4/6/7) against the walltime: once past MAXRUNTIME # the run keeps going, but a progress report is parked in dscheck.einfo so that # something is reported even if PBS kills the job at the walltime. the final report # follows and drops the parked one if the run does finish in time. the live email # buffers are saved and put back, so the final report still carries everything logged # before the cutoff. - # both queue depths are reported rather than the current phase's: -A 3 and -A 6 run the - # build and the transfer phase in one run, and -A 3 tars each input file right after - # creating it, so its status 'N' count stays near zero while that is the busy phase. + # both queue depths are reported rather than the current phase's, because -A 3 tars each + # input file right after creating it, so its status 'N' count stays near zero while that + # is the busy phase. they are worded as STATES ('left to build', 'tarred') and not as + # work this run will do: only -A 4 and -A 6 transfer, so calling the status 'T' count + # 'to transfer' in an -A 2 or -A 3 report claims work that run never performs. # a no-op for command-line runs, other actions, before the cutoff, or once a progress # report is cached. # called from the top of every per-item loop, not only where a tar is dispatched: a long @@ -885,7 +887,7 @@ def report_dscheck_email(self, title, cache = 0): def check_batch_deadline(self): act = self.PGBACK['action'] if self.PGBACK['einfo'] or not (self.PGBACK['doemail'] and self.PGLOG['DSCHECK']): return - if self.PGLOG['CURBID'] < 1 or act not in (self.TARACT, self.CTACTS, self.BCKACT, self.TBACTS): return + if self.PGLOG['CURBID'] < 1 or act not in (self.TARACT, self.CTACTS, self.BCKACT, self.TBACTS, self.CBACTS): return elapsed = tm() - self.PGBACK['starttime'] if elapsed < self.MAXRUNTIME: return tcnt = self.batch_tar_count('N') @@ -894,7 +896,7 @@ def check_batch_deadline(self): amsg = self.ACTMSG[act] bmsg = self.BACKMSG[self.PGBACK['backflag']] if self.PGBACK['backflag'] else 'backup' dmsg = self.batch_done_count() - rmsg = "{} {} tar file(s) left to build and {} to transfer".format(tcnt, bmsg, bcnt) + rmsg = "{} {} tar file(s) left to build and {} tarred".format(tcnt, bmsg, bcnt) msg = "{}: Still running after {} of the {} PBS walltime, {}, with {}".format(amsg, etime, self.seconds_to_string_time(self.WALLTIME), dmsg, rmsg) self.pglog(self.INDENT + msg, self.LOGACT) saved = {key : self.PGLOG[key] for key in ('EMLMSG', 'ERRMSG', 'ERRCNT', 'SUMMSG', 'PRGMSG')}