Skip to content

Commit eb3b694

Browse files
committed
Merge branch 'master' into develop
2 parents f06c1a9 + 04c0be4 commit eb3b694

File tree

13 files changed

+84
-293
lines changed

13 files changed

+84
-293
lines changed

bootstrap.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ if [ -n "$PYGELF" ]; then
116116
sed -e 's/^#+pygelf%//g' requirements.txt > $tmp_requirements
117117
CMD_M +pygelf $python -m pip install --no-cache-dir -q -r $tmp_requirements --target=$py_pkg_prefix/ --upgrade $PIPOPTS && rm $tmp_requirements
118118
else
119-
CMD $python -m pip install --no-cache-dir -q -r requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
119+
CMD $python -m pip install --use-pep517 --no-cache-dir -q -r requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
120120
fi
121121

122122
if [ -n "$MAKEDOCS" ]; then
123-
CMD_M +docs $python -m pip install --no-cache-dir -q -r docs/requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
123+
CMD_M +docs $python -m pip install --use-pep517 --no-cache-dir -q -r docs/requirements.txt --target=$py_pkg_prefix/ --upgrade $PIPOPTS
124124
make -C docs PYTHON=$python
125125
fi

docs/config_reference.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,17 @@ System Partition Configuration
336336
.. versionadded:: 4.4
337337
The ``ssh`` scheduler is added.
338338

339+
.. versionchanged:: 4.8.1
340+
All ``SBATCH_*`` variables are unset before submitting a job through the Slurm-based backends.
341+
See note below for information.
342+
343+
.. note::
344+
The Slurm-based backends unset all ``SBATCH_*`` environment variables before submitting a job.
345+
This is done to avoid environment variables bypassing ReFrame's configuration.
346+
For example, if the :attr:`~config.systems.partitions.access` options for a partition used ``-A foo`` and ``SBATCH_ACCOUNT=bar`` was set, then the environment variable would override the configuration, as ReFrame emits those (by default) in the submission script.
347+
348+
Job submission in ReFrame is controlled exclusively by the system partition's :attr:`~config.systems.partitions.access` options, the test job's :attr:`~reframe.core.schedulers.Job.options` and the :option:`-J` command-line option.
349+
339350
.. note::
340351

341352
The way that multiple node jobs are submitted using the SGE scheduler can be very site-specific.

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
archspec==0.2.5
2+
ClusterShell==1.9.3
23
docutils==0.18.1; python_version < '3.9'
34
docutils==0.21.2; python_version >= '3.9'
45
jinja2==3.0.3; python_version == '3.6'

reframe/core/launchers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class JobLauncher(metaclass=_JobLauncherMeta):
5454
#: :type: :class:`List[str]`
5555
#: :default: ``[]``
5656
#:
57-
#: :versionadded:: 4.6.0
57+
#: .. versionadded:: 4.6.0
5858
modifier_options = variable(typ.List[str], value=[])
5959

6060
def __init__(self):

reframe/core/schedulers/slurm.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import functools
77
import glob
88
import itertools
9+
import os
910
import re
1011
import shlex
1112
import time
@@ -260,17 +261,35 @@ def emit_preamble(self, job):
260261
# Filter out empty statements before returning
261262
return list(filter(None, preamble))
262263

264+
def sbatch(self, args):
265+
'''Run sbatch using a clean environment
266+
267+
We unset all `SBATCH_*` environment variables before submitting;
268+
submission should be controlled entirely by ReFrame through the
269+
partition's `access` options, the test's `job.options` and the
270+
command-line `-J` option
271+
'''
272+
273+
with rt.temp_environment():
274+
for var in [name for name in os.environ.keys()
275+
if name.startswith('SBATCH_')]:
276+
self.log(f'unsetting environment variable {var}',
277+
logging.DEBUG)
278+
del os.environ[var]
279+
280+
cmd = ' '.join(['sbatch'] + args)
281+
return _run_strict(cmd, timeout=self._submit_timeout)
282+
263283
def submit(self, job):
264-
cmd_parts = ['sbatch']
284+
sbatch_args = []
265285
if self._sched_access_in_submit:
266-
cmd_parts += job.sched_access
286+
sbatch_args += job.sched_access
267287

268-
cmd_parts += [job.script_filename]
269-
cmd = ' '.join(cmd_parts)
288+
sbatch_args += [job.script_filename]
270289
intervals = itertools.cycle([1, 2, 3])
271290
while True:
272291
try:
273-
completed = _run_strict(cmd, timeout=self._submit_timeout)
292+
completed = self.sbatch(sbatch_args)
274293
break
275294
except SpawnedProcessError as e:
276295
error_match = re.search(

reframe/frontend/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ def print_infoline(param, value):
12321232

12331233
# Print command line
12341234
session_info = report['session_info']
1235+
storage_status = 'on' if rt.get_option('storage/0/enable') else 'off'
12351236
printer.info('[ReFrame Setup]')
12361237
print_infoline('version', session_info['version'])
12371238
print_infoline('command', repr(session_info['cmdline']))
@@ -1254,7 +1255,8 @@ def print_infoline(param, value):
12541255
', '.join(repr(s) for s in session_info['log_files']))
12551256
print_infoline(
12561257
'results database',
1257-
repr(osext.expandvars(rt.get_option('storage/0/sqlite_db_file')))
1258+
f'[{storage_status}] '
1259+
f'{osext.expandvars(rt.get_option("storage/0/sqlite_db_file"))!r}'
12581260
)
12591261
printer.info('')
12601262
try:

reframe/frontend/printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _file_info(filename, prefix):
119119

120120
def _print_failure_info(rec, runid, total_runs):
121121
self.info(line_width * '-')
122-
self.info(f"FAILURE INFO for {rec['name']} "
122+
self.info(f"FAILURE INFO for {rec['display_name']} "
123123
f"(run: {runid}/{total_runs})")
124124
self.info(f" * Description: {rec['descr']}")
125125
self.info(f" * System partition: {rec['system']}")

reframe/frontend/reporting/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,13 +646,11 @@ def _group_testcases(testcases, groups, columns):
646646
@time_function
647647
def _aggregate_perf(grouped_testcases, aggr_fn, cols):
648648
# Update delimiter for joining unique values based on the table format
649-
table_foramt = runtime().get_option('general/0/table_format')
650-
if table_foramt == 'csv':
651-
delim = '|'
652-
elif table_foramt == 'plain':
653-
delim = ','
654-
else:
649+
table_format = runtime().get_option('general/0/table_format')
650+
if table_format == 'pretty':
655651
delim = '\n'
652+
else:
653+
delim = '|'
656654

657655
other_aggr = Aggregator.create('join_uniq', delim)
658656
count_aggr = Aggregator.create('count')

0 commit comments

Comments
 (0)