From 823d66ea643b2f6325de42689cc151926505cc26 Mon Sep 17 00:00:00 2001 From: rafael Date: Tue, 5 May 2020 18:40:48 +0200 Subject: [PATCH 1/3] add -A to pbs backend --- reframe/core/schedulers/pbs.py | 4 ++++ unittests/test_schedulers.py | 1 + 2 files changed, 5 insertions(+) diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index 74310d8247..fccfc04ca7 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -84,6 +84,10 @@ def emit_preamble(self, job): self._format_option('-e %s' % job.stderr), ] + if job.sched_account: + preamble.append( + self._format_option('-A %s' % job.sched_account)) + if job.time_limit is not None: h, m, s = seconds_to_hms(job.time_limit.total_seconds()) preamble.append( diff --git a/unittests/test_schedulers.py b/unittests/test_schedulers.py index 8442277a01..69f4e2fa4a 100644 --- a/unittests/test_schedulers.py +++ b/unittests/test_schedulers.py @@ -515,6 +515,7 @@ def expected_directives(self): '#PBS -l walltime=0:5:0', '#PBS -o %s' % self.testjob.stdout, '#PBS -e %s' % self.testjob.stderr, + '#PBS -A %s' % self.testjob.sched_account, *self.node_select_options, '#PBS -q %s' % self.testjob.sched_partition, '#PBS --gres=gpu:4', From 10d23bb830f221dc2e3a92b93319f7eaf6d35e27 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 2 Jun 2020 22:19:36 +0200 Subject: [PATCH 2/3] Unset all ReFrame environment variables before running the unit tests --- test_reframe.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test_reframe.py b/test_reframe.py index 69aa9046e5..c11fb50bdb 100755 --- a/test_reframe.py +++ b/test_reframe.py @@ -6,6 +6,7 @@ # SPDX-License-Identifier: BSD-3-Clause import argparse +import os import pytest import sys @@ -13,6 +14,12 @@ if __name__ == '__main__': + # Unset any ReFrame environment variable; unit tests must start in a clean + # environment + for var in list(os.environ.keys()): + if var.startswith('RFM_') and var != 'RFM_INSTALL_PREFIX': + del os.environ[var] + parser = argparse.ArgumentParser( add_help=False, usage='%(prog)s [REFRAME_OPTIONS...] [NOSE_OPTIONS...]') From 0d3ac18351f1b989549b2b82be866a8758c091f9 Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Tue, 2 Jun 2020 22:40:05 +0200 Subject: [PATCH 3/3] Fix unit tests --- unittests/test_schedulers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unittests/test_schedulers.py b/unittests/test_schedulers.py index 5a8599f4ac..f5264c23ef 100644 --- a/unittests/test_schedulers.py +++ b/unittests/test_schedulers.py @@ -184,6 +184,7 @@ def _expected_pbs_directives(job): '#PBS -l walltime=0:5:0', '#PBS -o %s' % job.stdout, '#PBS -e %s' % job.stderr, + '#PBS -A %s' % job.sched_account, '#PBS -l select=%s:mpiprocs=%s:ncpus=%s' ':mem=100GB:cpu_type=haswell' % (num_nodes, job.num_tasks_per_node, @@ -203,6 +204,7 @@ def _expected_torque_directives(job): '#PBS -l walltime=0:5:0', '#PBS -o %s' % job.stdout, '#PBS -e %s' % job.stderr, + '#PBS -A %s' % job.sched_account, '#PBS -l nodes=%s:ppn=%s:haswell' % (num_nodes, num_cpus_per_node), '#PBS -l mem=100GB', '#PBS -q %s' % job.sched_partition,