Skip to content

Commit 855e43e

Browse files
committed
[bench] update tests
1 parent 1011d52 commit 855e43e

File tree

81 files changed

+1083
-944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1083
-944
lines changed

benchmark/test/conversion.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/usr/bin/env python3
22
import test_framework
33

4+
stencil_input = '[{"operator": {"stencil": {"name": "7pt", "size": 100}}}]'
5+
6+
47
# check that all input modes work:
58
# parameter
69
test_framework.compare_output(
7-
["-input", '[{"size": 100, "stencil": "7pt"}]', "-formats", "coo,csr"],
10+
["-input", stencil_input],
811
expected_stdout="conversion.simple.stdout",
912
expected_stderr="conversion.simple.stderr",
1013
)
@@ -14,7 +17,7 @@
1417
["-formats", "coo,csr"],
1518
expected_stdout="conversion.simple.stdout",
1619
expected_stderr="conversion.simple.stderr",
17-
stdin='[{"size": 100, "stencil": "7pt"}]',
20+
stdin=stencil_input,
1821
)
1922

2023
# input file
@@ -29,23 +32,11 @@
2932
expected_stderr="conversion.simple.stderr",
3033
)
3134

32-
# input matrixfile
33-
test_framework.compare_output(
34-
[
35-
"-input_matrix",
36-
str(test_framework.matrixpath),
37-
"-formats",
38-
"coo,csr",
39-
],
40-
expected_stdout="conversion.matrix.stdout",
41-
expected_stderr="conversion.matrix.stderr",
42-
)
43-
4435
# check that all conversions work
4536
test_framework.compare_output(
4637
[
4738
"-input",
48-
'[{"size": 100, "stencil": "7pt"}]',
39+
stencil_input,
4940
"-formats",
5041
"coo,csr,ell,sellp,hybrid",
5142
],
@@ -57,7 +48,7 @@
5748
test_framework.compare_output(
5849
[
5950
"-input",
60-
'[{"size": 100, "stencil": "7pt"}]',
51+
stencil_input,
6152
"-formats",
6253
"coo,csr",
6354
"-profile",
@@ -70,7 +61,7 @@
7061

7162
# complex
7263
test_framework.compare_output(
73-
["-input", '[{"size": 100, "stencil": "7pt"}]', "-formats", "coo,csr"],
64+
["-input", stencil_input, "-formats", "coo,csr"],
7465
expected_stdout="conversion_dcomplex.simple.stdout",
7566
expected_stderr="conversion_dcomplex.simple.stderr",
7667
use_complex=True
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
[
2-
{
3-
"size": 100,
4-
"stencil": "7pt",
5-
"comm_pattern": "stencil"
6-
}
2+
{
3+
"operator": {
4+
"stencil": {
5+
"local_size": 100,
6+
"name": "7pt"
7+
}
8+
},
9+
"format": "csr-csr"
10+
}
711
]
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
[
2-
{
3-
"size": 100,
4-
"stencil": "7pt",
5-
"comm_pattern": "stencil",
6-
"optimal": {
7-
"spmv": "csr-csr"
8-
}
2+
{
3+
"operator": {
4+
"stencil": {
5+
"local_size": 100,
6+
"name": "7pt"
7+
}
8+
},
9+
"solver": {
10+
"type": "solver::Cg"
11+
},
12+
"optimal": {
13+
"spmv": {
14+
"format": "csr-csr"
15+
}
916
}
17+
}
1018
]

benchmark/test/input.mtx.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[
2-
{
2+
{
3+
"operator": {
4+
"stencil": {
35
"size": 100,
4-
"stencil": "7pt"
5-
}
6+
"name": "7pt"
7+
}
8+
},
9+
"format": "coo"
10+
}
611
]

benchmark/test/input.solver.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
[
2-
{
2+
{
3+
"operator": {
4+
"stencil": {
35
"size": 100,
4-
"stencil": "7pt",
5-
"optimal": {
6-
"spmv": "csr"
7-
}
6+
"name": "7pt"
7+
}
8+
},
9+
"solver": {
10+
"type": "solver::Cg"
11+
},
12+
"optimal": {
13+
"spmv": {
14+
"format": "csr"
15+
}
816
}
17+
}
918
]

benchmark/test/matrix_statistics.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# check that all input modes work:
55
# parameter
66
test_framework.compare_output(
7-
["-input", '[{"size": 100, "stencil": "7pt"}]'],
7+
["-input", '[{"operator": {"stencil": {"name": "7pt", "size": 100}}}]'],
88
expected_stdout="matrix_statistics.simple.stdout",
99
expected_stderr="matrix_statistics.simple.stderr",
1010
)
@@ -14,7 +14,7 @@
1414
[],
1515
expected_stdout="matrix_statistics.simple.stdout",
1616
expected_stderr="matrix_statistics.simple.stderr",
17-
stdin='[{"size": 100, "stencil": "7pt"}]',
17+
stdin='[{"operator": {"stencil": {"name": "7pt", "size": 100}}}]',
1818
)
1919

2020
# input file
@@ -23,10 +23,3 @@
2323
expected_stdout="matrix_statistics.simple.stdout",
2424
expected_stderr="matrix_statistics.simple.stderr",
2525
)
26-
27-
# input matrix file
28-
test_framework.compare_output(
29-
["-input_matrix", str(test_framework.matrixpath)],
30-
expected_stdout="matrix_statistics.matrix.stdout",
31-
expected_stderr="matrix_statistics.matrix.stderr",
32-
)

benchmark/test/preconditioner.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/usr/bin/env python3
22
import test_framework
3+
import json
4+
5+
stencil_input = [{"operator": {"stencil": {"name": "7pt", "size": 100}},
6+
"preconditioner": {"type": "matrix::Identity"},
7+
"format": "csr"}]
38

49
# check that all input modes work:
510
# parameter
611
test_framework.compare_output(
7-
["-input", '[{"size": 100, "stencil": "7pt"}]'],
12+
["-input", json.dumps(stencil_input)],
813
expected_stdout="preconditioner.simple.stdout",
914
expected_stderr="preconditioner.simple.stderr",
1015
)
@@ -14,34 +19,23 @@
1419
[],
1520
expected_stdout="preconditioner.simple.stdout",
1621
expected_stderr="preconditioner.simple.stderr",
17-
stdin='[{"size": 100, "stencil": "7pt"}]',
22+
stdin=json.dumps(stencil_input),
1823
)
1924

2025
# input file
2126
test_framework.compare_output(
22-
["-input", str(test_framework.sourcepath / "input.mtx.json")],
27+
["-input", str(test_framework.sourcepath / "input.preconditioner.json")],
2328
expected_stdout="preconditioner.simple.stdout",
2429
expected_stderr="preconditioner.simple.stderr",
2530
)
2631

27-
# input matrix file
28-
test_framework.compare_output(
29-
["-input_matrix", str(test_framework.matrixpath)],
30-
expected_stdout="preconditioner.matrix.stdout",
31-
expected_stderr="preconditioner.matrix.stderr",
32-
)
33-
3432
# set preconditioner works
33+
precond_config = [stencil_input[0] | {
34+
"preconditioner": {"type": "preconditioner::Jacobi", "max_block_size": 32, "storage_optimization": [0, 0]}}]
3535
test_framework.compare_output(
3636
[
37-
"-preconditioners",
38-
"jacobi",
39-
"-jacobi_max_block_size",
40-
"32",
41-
"-jacobi_storage",
42-
"0,0",
4337
"-input",
44-
'[{"size": 100, "stencil": "7pt"}]'],
38+
json.dumps(precond_config)],
4539
expected_stdout="preconditioner.precond.stdout",
4640
expected_stderr="preconditioner.precond.stderr",
4741
)
@@ -50,7 +44,7 @@
5044
test_framework.compare_output(
5145
[
5246
"-input",
53-
'[{"size": 100, "stencil": "7pt"}]',
47+
json.dumps(stencil_input),
5448
"-profile",
5549
"-profiler_hook",
5650
"debug",
@@ -61,15 +55,15 @@
6155

6256
# stdin
6357
test_framework.compare_output(
64-
["-reorder", "amd"],
58+
[],
6559
expected_stdout="preconditioner.reordered.stdout",
6660
expected_stderr="preconditioner.reordered.stderr",
67-
stdin='[{"size": 100, "stencil": "7pt"}]',
61+
stdin=json.dumps([stencil_input[0] | {"reorder": "amd"}]),
6862
)
6963

7064
# complex
7165
test_framework.compare_output(
72-
["-input", '[{"size": 100, "stencil": "7pt"}]'],
66+
["-input", json.dumps(stencil_input)],
7367
expected_stdout="preconditioner_dcomplex.simple.stdout",
7468
expected_stderr="preconditioner_dcomplex.simple.stderr",
7569
use_complex=True

benchmark/test/reference/blas.profile.stderr

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,15 @@ Running on ReferenceExecutor
22
Running with 0 warm iterations and 1 running iterations
33
The random seed for right hand sides is 42
44
The operations are copy,axpy,scal
5-
Running test case n = 100
6-
DEBUG: begin n = 100
7-
Running blas: copy
8-
DEBUG: begin copy
5+
Running test case
6+
{"n":100}
7+
DEBUG: begin {"n":100}
98
DEBUG: begin dense::fill
109
DEBUG: end dense::fill
1110
DEBUG: begin repetition
1211
DEBUG: begin dense::copy
1312
DEBUG: end dense::copy
1413
DEBUG: end repetition
15-
DEBUG: end copy
16-
Running blas: axpy
17-
DEBUG: begin axpy
1814
DEBUG: begin dense::fill
1915
DEBUG: end dense::fill
2016
DEBUG: begin dense::fill
@@ -25,9 +21,6 @@ DEBUG: begin repetition
2521
DEBUG: begin dense::add_scaled
2622
DEBUG: end dense::add_scaled
2723
DEBUG: end repetition
28-
DEBUG: end axpy
29-
Running blas: scal
30-
DEBUG: begin scal
3124
DEBUG: begin dense::fill
3225
DEBUG: end dense::fill
3326
DEBUG: begin dense::fill
@@ -36,5 +29,4 @@ DEBUG: begin repetition
3629
DEBUG: begin dense::scale
3730
DEBUG: end dense::scale
3831
DEBUG: end repetition
39-
DEBUG: end scal
40-
DEBUG: end n = 100
32+
DEBUG: end {"n":100}

benchmark/test/reference/blas.profile.stdout

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,29 @@
66
"time": 1.0,
77
"flops": 1.0,
88
"bandwidth": 1.0,
9-
"repetitions": 1,
10-
"completed": true
9+
"repetitions": 1
1110
},
1211
"axpy": {
1312
"time": 1.0,
1413
"flops": 1.0,
1514
"bandwidth": 1.0,
16-
"repetitions": 1,
17-
"completed": true
15+
"repetitions": 1
1816
},
1917
"scal": {
2018
"time": 1.0,
2119
"flops": 1.0,
2220
"bandwidth": 1.0,
23-
"repetitions": 1,
24-
"completed": true
25-
}
26-
}
21+
"repetitions": 1
22+
},
23+
"completed": true
24+
},
25+
"k": 100,
26+
"m": 100,
27+
"r": 1,
28+
"stride_x": 1,
29+
"stride_y": 1,
30+
"stride_A": 100,
31+
"stride_B": 100,
32+
"stride_C": 100
2733
}
2834
]

benchmark/test/reference/blas.simple.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@ Running on ReferenceExecutor
22
Running with 2 warm iterations and 10 running iterations
33
The random seed for right hand sides is 42
44
The operations are copy,axpy,scal
5-
Running test case n = 100
6-
Running blas: copy
7-
Running blas: axpy
8-
Running blas: scal
5+
Running test case
6+
{"n":100}

0 commit comments

Comments
 (0)