Skip to content

Commit 8faebb4

Browse files
author
Vasileios Karakasis
committed
Merge branch 'master' into ci-generate-pipeline-new
2 parents 4cce474 + 07459a0 commit 8faebb4

File tree

14 files changed

+183
-81
lines changed

14 files changed

+183
-81
lines changed

bin/reframe

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
# PYTHON_ARGCOMPLETE_OK
23
#
34
# Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
45
# ReFrame Project Developers. See the top-level LICENSE file for details.

cscs-checks/apps/cp2k/cp2k_check.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ def __init__(self):
1414
self.executable = 'cp2k.psmp'
1515
self.executable_opts = ['H2O-256.inp']
1616

17-
energy = sn.extractsingle(r'\s+ENERGY\| Total FORCE_EVAL \( QS \) '
18-
r'energy \(a\.u\.\):\s+(?P<energy>\S+)',
19-
self.stdout, 'energy', float, item=-1)
17+
energy = sn.extractsingle(
18+
r'\s+ENERGY\| Total FORCE_EVAL \( QS \) '
19+
r'energy [\[\(]a\.u\.[\]\)]:\s+(?P<energy>\S+)',
20+
self.stdout, 'energy', float, item=-1
21+
)
2022
energy_reference = -4404.2323
2123
energy_diff = sn.abs(energy-energy_reference)
2224
self.sanity_patterns = sn.all([
2325
sn.assert_found(r'PROGRAM STOPPED IN', self.stdout),
2426
sn.assert_eq(sn.count(sn.extractall(
25-
r'(?P<step_count>STEP NUM)',
27+
r'(?i)(?P<step_count>STEP NUMBER)',
2628
self.stdout, 'step_count')), 10),
2729
sn.assert_lt(energy_diff, 1e-4)
2830
])

docs/config_reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ Common scheduler options
10171017
As an example, you could have ReFrame trying to resubmit a job in case that the maximum submission limit per user is reached by setting this field to ``["QOSMaxSubmitJobPerUserLimit"]``.
10181018
You can ignore multiple errors at the same time if you add more error strings in the list.
10191019

1020-
.. versionadded:: 3.5
1020+
.. versionadded:: 3.4.1
10211021

10221022
.. warning::
10231023
Job submission is a synchronous operation in ReFrame.

docs/started.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ All you need is a Python 3.6+ installation with ``pip``:
9090
For previous ReFrame versions you should install its requirements using ``pip install -r requirements.txt`` in a Python virtual environment.
9191

9292

93+
Enabling auto-completion
94+
------------------------
95+
96+
.. versionadded:: 3.4.1
97+
98+
You can enable auto-completion for ReFrame by sourcing in your shell the corresponding script in ``<install_prefix>/etc/reframe_completion.<shell>``.
99+
Auto-completion is supported for Bash, Tcsh and Fish shells.
100+
101+
102+
93103
Running the Unit Tests
94104
----------------------
95105

docs/tutorial_deps.rst

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ Here is the output when running the OSU tests with the asynchronous execution po
104104
[ReFrame Setup]
105105
version: 3.4-dev2 (rev: 56c6c237)
106106
command: './bin/reframe --system=daint -C tutorials/config/settings.py -c tutorials/deps/osu_benchmarks.py -r'
107-
launched by: karakasv@dom101
108-
working directory: '/users/karakasv/Devel/reframe'
107+
launched by: user@daint101
108+
working directory: '/users/user/Devel/reframe'
109109
settings file: 'tutorials/config/settings.py'
110-
check search path: '/users/karakasv/Devel/reframe/tutorials/deps/osu_benchmarks.py'
111-
stage directory: '/users/karakasv/Devel/reframe/stage'
112-
output directory: '/users/karakasv/Devel/reframe/output'
110+
check search path: '/users/user/Devel/reframe/tutorials/deps/osu_benchmarks.py'
111+
stage directory: '/users/user/Devel/reframe/stage'
112+
output directory: '/users/user/Devel/reframe/output'
113113
114114
[==========] Running 8 check(s)
115115
[==========] Started on Mon Jan 25 19:34:09 2021
@@ -234,7 +234,7 @@ For example, if we select only the :class:`OSULatencyTest` for running, ReFrame
234234
[ReFrame Setup]
235235
version: 3.3-dev2 (rev: 8ded20cd)
236236
command: './bin/reframe -C tutorials/config/settings.py -c tutorials/deps/osu_benchmarks.py -n OSULatencyTest -l'
237-
launched by: user@dom101
237+
launched by: user@daint101
238238
working directory: '/users/user/Devel/reframe'
239239
settings file: 'tutorials/config/settings.py'
240240
check search path: '/users/user/Devel/reframe/tutorials/deps/osu_benchmarks.py'
@@ -256,48 +256,50 @@ As a result, its immediate dependency :class:`OSUBuildTest` will be skipped, whi
256256

257257
.. code-block:: console
258258
259-
./bin/reframe --system=daint:gpu -c tutorials/deps/osu_benchmarks.py -n OSULatencyTest -l
259+
./bin/reframe -c tutorials/deps/osu_benchmarks.py -n OSULatencyTest -l
260260
261261
.. code-block:: none
262262
263263
[ReFrame Setup]
264-
version: 3.4-dev2 (rev: c1a364f3)
265-
command: './bin/reframe --system=daint:gpu -C tutorials/config/settings.py -c tutorials/deps/osu_benchmarks.py -n OSULatencyTest -l'
266-
launched by: karakasv@dom101
267-
working directory: '/users/karakasv/Devel/reframe'
264+
version: 3.5-dev0 (rev: 93948510)
265+
command: './bin/reframe -C tutorials/config/settings.py --system=daint:gpu -c tutorials/deps/osu_benchmarks.py -l'
266+
launched by: user@daint101
267+
working directory: '/users/user/Devel/reframe'
268268
settings file: 'tutorials/config/settings.py'
269-
check search path: '/users/karakasv/Devel/reframe/tutorials/deps/osu_benchmarks.py'
270-
stage directory: '/users/karakasv/Devel/reframe/stage'
271-
output directory: '/users/karakasv/Devel/reframe/output'
272-
273-
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'gnu') -> 'OSUDownloadTest'; skipping dependent test cases:
274-
./bin/reframe: - ('OSUBuildTest', 'daint:gpu', 'gnu')
275-
./bin/reframe: - ('OSUBandwidthTest', 'daint:gpu', 'gnu')
276-
./bin/reframe: - ('OSUAllreduceTest_16', 'daint:gpu', 'gnu')
277-
./bin/reframe: - ('OSULatencyTest', 'daint:gpu', 'gnu')
278-
./bin/reframe: - ('OSUAllreduceTest_4', 'daint:gpu', 'gnu')
279-
./bin/reframe: - ('OSUAllreduceTest_8', 'daint:gpu', 'gnu')
280-
./bin/reframe: - ('OSUAllreduceTest_2', 'daint:gpu', 'gnu')
281-
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'intel') -> 'OSUDownloadTest'; skipping dependent test cases:
282-
./bin/reframe: - ('OSUBuildTest', 'daint:gpu', 'intel')
283-
./bin/reframe: - ('OSULatencyTest', 'daint:gpu', 'intel')
284-
./bin/reframe: - ('OSUAllreduceTest_4', 'daint:gpu', 'intel')
285-
./bin/reframe: - ('OSUAllreduceTest_16', 'daint:gpu', 'intel')
286-
./bin/reframe: - ('OSUBandwidthTest', 'daint:gpu', 'intel')
287-
./bin/reframe: - ('OSUAllreduceTest_2', 'daint:gpu', 'intel')
288-
./bin/reframe: - ('OSUAllreduceTest_8', 'daint:gpu', 'intel')
289-
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'pgi') -> 'OSUDownloadTest'; skipping dependent test cases:
290-
./bin/reframe: - ('OSUBuildTest', 'daint:gpu', 'pgi')
291-
./bin/reframe: - ('OSUAllreduceTest_8', 'daint:gpu', 'pgi')
292-
./bin/reframe: - ('OSUAllreduceTest_2', 'daint:gpu', 'pgi')
293-
./bin/reframe: - ('OSUBandwidthTest', 'daint:gpu', 'pgi')
294-
./bin/reframe: - ('OSUAllreduceTest_16', 'daint:gpu', 'pgi')
295-
./bin/reframe: - ('OSUAllreduceTest_4', 'daint:gpu', 'pgi')
296-
./bin/reframe: - ('OSULatencyTest', 'daint:gpu', 'pgi')
269+
check search path: '/users/user/Devel/reframe/tutorials/deps/osu_benchmarks.py'
270+
stage directory: '/users/user/Devel/reframe/stage'
271+
output directory: '/users/user/Devel/reframe/output'
272+
273+
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'gnu') -> 'OSUDownloadTest'
274+
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'intel') -> 'OSUDownloadTest'
275+
./bin/reframe: could not resolve dependency: ('OSUBuildTest', 'daint:gpu', 'pgi') -> 'OSUDownloadTest'
276+
./bin/reframe: skipping all dependent test cases
277+
- ('OSUBuildTest', 'daint:gpu', 'intel')
278+
- ('OSUBuildTest', 'daint:gpu', 'pgi')
279+
- ('OSUAllreduceTest_4', 'daint:gpu', 'intel')
280+
- ('OSUAllreduceTest_2', 'daint:gpu', 'intel')
281+
- ('OSULatencyTest', 'daint:gpu', 'pgi')
282+
- ('OSUBandwidthTest', 'daint:gpu', 'pgi')
283+
- ('OSUAllreduceTest_8', 'daint:gpu', 'intel')
284+
- ('OSUAllreduceTest_16', 'daint:gpu', 'pgi')
285+
- ('OSUBuildTest', 'daint:gpu', 'gnu')
286+
- ('OSUBandwidthTest', 'daint:gpu', 'intel')
287+
- ('OSULatencyTest', 'daint:gpu', 'intel')
288+
- ('OSUAllreduceTest_16', 'daint:gpu', 'intel')
289+
- ('OSUAllreduceTest_8', 'daint:gpu', 'pgi')
290+
- ('OSULatencyTest', 'daint:gpu', 'gnu')
291+
- ('OSUBandwidthTest', 'daint:gpu', 'gnu')
292+
- ('OSUAllreduceTest_2', 'daint:gpu', 'pgi')
293+
- ('OSUAllreduceTest_4', 'daint:gpu', 'pgi')
294+
- ('OSUAllreduceTest_8', 'daint:gpu', 'gnu')
295+
- ('OSUAllreduceTest_4', 'daint:gpu', 'gnu')
296+
- ('OSUAllreduceTest_2', 'daint:gpu', 'gnu')
297+
- ('OSUAllreduceTest_16', 'daint:gpu', 'gnu')
298+
297299
[List of matched checks]
298300
299301
Found 0 check(s)
300-
Log file(s) saved in: '/tmp/rfm-eiay984f.log'
302+
Log file(s) saved in: '/tmp/rfm-hjit66h2.log'
301303
302304
303305
Listing Dependencies
@@ -381,7 +383,7 @@ The following listing shows how the actual test cases dependencies are formed wh
381383
<none>
382384
383385
Location:
384-
/users/karakasv/Devel/reframe/tutorials/deps/osu_benchmarks.py
386+
/users/user/Devel/reframe/tutorials/deps/osu_benchmarks.py
385387
386388
Maintainers:
387389
<none>

etc/reframe_completion.bash

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# Run something, muting output or redirecting it to the debug stream
3+
# depending on the value of _ARC_DEBUG.
4+
# If ARGCOMPLETE_USE_TEMPFILES is set, use tempfiles for IPC.
5+
__python_argcomplete_run() {
6+
if [[ -z "${ARGCOMPLETE_USE_TEMPFILES-}" ]]; then
7+
__python_argcomplete_run_inner "$@"
8+
return
9+
fi
10+
local tmpfile="$(mktemp)"
11+
_ARGCOMPLETE_STDOUT_FILENAME="$tmpfile" __python_argcomplete_run_inner "$@"
12+
local code=$?
13+
cat "$tmpfile"
14+
rm "$tmpfile"
15+
return $code
16+
}
17+
18+
__python_argcomplete_run_inner() {
19+
if [[ -z "${_ARC_DEBUG-}" ]]; then
20+
"$@" 8>&1 9>&2 1>/dev/null 2>&1
21+
else
22+
"$@" 8>&1 9>&2 1>&9 2>&1
23+
fi
24+
}
25+
26+
_python_argcomplete() {
27+
local IFS=$'\013'
28+
local SUPPRESS_SPACE=0
29+
if compopt +o nospace 2> /dev/null; then
30+
SUPPRESS_SPACE=1
31+
fi
32+
COMPREPLY=( $(IFS="$IFS" \
33+
COMP_LINE="$COMP_LINE" \
34+
COMP_POINT="$COMP_POINT" \
35+
COMP_TYPE="$COMP_TYPE" \
36+
_ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" \
37+
_ARGCOMPLETE=1 \
38+
_ARGCOMPLETE_SUPPRESS_SPACE=$SUPPRESS_SPACE \
39+
__python_argcomplete_run "$1") )
40+
if [[ $? != 0 ]]; then
41+
unset COMPREPLY
42+
elif [[ $SUPPRESS_SPACE == 1 ]] && [[ "${COMPREPLY-}" =~ [=/:]$ ]]; then
43+
compopt -o nospace
44+
fi
45+
}
46+
complete -o nospace -o default -o bashdefault -F _python_argcomplete reframe

etc/reframe_completion.fish

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
function __fish_reframe_complete
3+
set -x _ARGCOMPLETE 1
4+
set -x _ARGCOMPLETE_DFS \t
5+
set -x _ARGCOMPLETE_IFS \n
6+
set -x _ARGCOMPLETE_SUPPRESS_SPACE 1
7+
set -x _ARGCOMPLETE_SHELL fish
8+
set -x COMP_LINE (commandline -p)
9+
set -x COMP_POINT (string length (commandline -cp))
10+
set -x COMP_TYPE
11+
if set -q _ARC_DEBUG
12+
reframe 8>&1 9>&2 1>/dev/null 2>&1
13+
else
14+
reframe 8>&1 9>&2 1>&9 2>&1
15+
end
16+
end
17+
complete -c reframe -f -a '(__fish_reframe_complete)'

etc/reframe_completion.tcsh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
complete "reframe" 'p@*@`python-argcomplete-tcsh "reframe"`@' ;

reframe/frontend/argparse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6+
import argcomplete
67
import argparse
78
import os
89

@@ -257,6 +258,9 @@ def parse_args(self, args=None, namespace=None):
257258
`add_argument()` call. If no default value was specified either, the
258259
attribute will be set to `None`.'''
259260

261+
# Enable auto-completion
262+
argcomplete.autocomplete(self._holder)
263+
260264
# We always pass an empty namespace to our internal argparser and we do
261265
# the namespace resolution ourselves. We do this, because we want the
262266
# newly parsed options to completely override any options defined in

reframe/frontend/cli.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,12 @@ def main():
451451
help='Use a login shell for job scripts'
452452
)
453453

454+
# Parse command line
455+
options = argparser.parse_args()
454456
if len(sys.argv) == 1:
455457
argparser.print_help()
456458
sys.exit(1)
457459

458-
# Parse command line
459-
options = argparser.parse_args()
460-
461460
# First configure logging with our generic configuration so as to be able
462461
# to print pretty messages; logging will be reconfigured by user's
463462
# configuration later

0 commit comments

Comments
 (0)