From f5768ede67e7e7d8fc35e627c45fd3710b1d391c Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 22 Apr 2021 09:43:35 +0200 Subject: [PATCH 1/2] Mark jobs properly as completed in PBS scheduler In case `qstat` returns 153, although we did set the job status as completed, we did not set the `_completed` variable. --- reframe/core/schedulers/pbs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index 03c980404e..869c7cd197 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -55,6 +55,9 @@ class _PbsJob(sched.Job): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._cancelled = False + + # This is set by the scheduler when both the job's state is + # 'COMPLETED' and the job's stdout and stderr are written back self._completed = False @property @@ -196,6 +199,7 @@ def poll(self, *jobs): 'assuming all jobs completed') for job in jobs: job._state = 'COMPLETED' + job._completed = True return From 07d8f11302b8a4e2c3b8a7100c71715493e8805a Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Thu, 22 Apr 2021 15:58:51 +0200 Subject: [PATCH 2/2] PBS: Assume that jobs have finished in case of exitcode == 35 --- reframe/core/schedulers/pbs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index 869c7cd197..46e97d3d75 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -194,9 +194,9 @@ def poll(self, *jobs): # If qstat cannot find any of the job IDs, it will return 153. # Otherwise, it will return with return code 0 and print information # only for the jobs it could find. - if completed.returncode == 153: - self.log('Return code is 153: jobids not known by scheduler, ' - 'assuming all jobs completed') + if completed.returncode in (153, 35): + self.log(f'Return code is {completed.returncode}: ' + f'assuming all jobs completed') for job in jobs: job._state = 'COMPLETED' job._completed = True