Skip to content

Commit 4a00c56

Browse files
authored
Add progress counter to ./mfc.sh test (#980)
1 parent 8937245 commit 4a00c56

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/frontier/submit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ job_slug="`basename "$1" | sed 's/\.sh$//' | sed 's/[^a-zA-Z0-9]/-/g'`-$2"
2929

3030
sbatch <<EOT
3131
#!/bin/bash
32-
#SBATCH -JMFC-$job_slug # Job name
32+
#SBATCH -J MFC-$job_slug # Job name
3333
#SBATCH -A CFD154 # charge account
3434
#SBATCH -N 1 # Number of nodes required
3535
$sbatch_device_opts
36-
#SBATCH -t 03:59:00 # Duration of the job (Ex: 15 mins)
36+
#SBATCH -t 04:59:00 # Duration of the job (Ex: 15 mins)
3737
#SBATCH -o$job_slug.out # Combined output and error messages file
3838
#SBATCH -p extended # Extended partition for shorter queues
3939
#SBATCH -W # Do not exit until the submitted job terminates.

toolchain/mfc/test/test.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
nFAIL = 0
2020
nPASS = 0
2121
nSKIP = 0
22+
current_test_number = 0
23+
total_test_count = 0
2224
errors = []
2325

2426
# pylint: disable=too-many-branches, trailing-whitespace
@@ -95,7 +97,7 @@ def __filter(cases_) -> typing.List[TestCase]:
9597

9698
def test():
9799
# pylint: disable=global-statement, global-variable-not-assigned
98-
global nFAIL, nPASS, nSKIP
100+
global nFAIL, nPASS, nSKIP, total_test_count
99101
global errors
100102

101103
cases = list_cases()
@@ -113,6 +115,7 @@ def test():
113115

114116
cases, skipped_cases = __filter(cases)
115117
cases = [ _.to_case() for _ in cases ]
118+
total_test_count = len(cases)
116119

117120
if ARG("list"):
118121
table = rich.table.Table(title="MFC Test Cases", box=rich.table.box.SIMPLE)
@@ -150,7 +153,7 @@ def test():
150153

151154
# Run cases with multiple threads (if available)
152155
cons.print()
153-
cons.print(" tests/[bold magenta]UUID[/bold magenta] (s) Summary")
156+
cons.print(" Progress [bold magenta]UUID[/bold magenta] (s) Summary")
154157
cons.print()
155158

156159
# Select the correct number of threads to use to launch test cases
@@ -185,6 +188,7 @@ def test():
185188
# pylint: disable=too-many-locals, too-many-branches, too-many-statements, trailing-whitespace
186189
def _handle_case(case: TestCase, devices: typing.Set[int]):
187190
# pylint: disable=global-statement, global-variable-not-assigned
191+
global current_test_number
188192
start_time = time.time()
189193

190194
tol = case.compute_tolerance()
@@ -269,7 +273,9 @@ def _handle_case(case: TestCase, devices: typing.Set[int]):
269273
end_time = time.time()
270274
duration = end_time - start_time
271275

272-
cons.print(f" [bold magenta]{case.get_uuid()}[/bold magenta] {duration:6.2f} {case.trace}")
276+
current_test_number += 1
277+
progress_str = f"({current_test_number:3d}/{total_test_count:3d})"
278+
cons.print(f" {progress_str} [bold magenta]{case.get_uuid()}[/bold magenta] {duration:6.2f} {case.trace}")
273279

274280

275281
def handle_case(case: TestCase, devices: typing.Set[int]):

0 commit comments

Comments
 (0)