From d6eb1b11dd446b807e1eb65e050191f8075e6cbf Mon Sep 17 00:00:00 2001 From: Logan Harbour Date: Sat, 16 Nov 2024 17:20:47 -0700 Subject: [PATCH] Resolve issues with kill --- python/TestHarness/schedulers/RunHPC.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/TestHarness/schedulers/RunHPC.py b/python/TestHarness/schedulers/RunHPC.py index a925c0ad0a9f..2815b533cb59 100644 --- a/python/TestHarness/schedulers/RunHPC.py +++ b/python/TestHarness/schedulers/RunHPC.py @@ -783,7 +783,8 @@ def killHPCJobs(self, functor): def killRemaining(self, keyboard=False): """Kills all currently running HPC jobs""" - functor = lambda hpc_job: hpc_job.state not in [hpc_job.State.killed, hpc_job.State.done] + running_states = [HPCJob.State.killed, HPCJob.State.done] + functor = lambda hpc_job: hpc_job is not None and hpc_job.state not in running_states killed_jobs = self.killHPCJobs(functor) if keyboard and killed_jobs: print(f'\nAttempted to kill remaining {killed_jobs} HPC jobs...') @@ -990,7 +991,7 @@ def setupRunEnvironment(self, harness): # --hpc-pre-source contents if self.options.hpc_pre_source: - submission_env['PRE_SOURCE_FILE'] = options.hpc_pre_source + submission_env['PRE_SOURCE_FILE'] = self.options.hpc_pre_source submission_env['PRE_SOURCE_CONTENTS'] = self.source_contents submission_env['SOURCE_FILE'] = options.hpc_pre_source