Skip to content

Commit

Permalink
test -input_matrix flag
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Aug 16, 2023
1 parent 6577981 commit 91a31ff
Show file tree
Hide file tree
Showing 22 changed files with 505 additions and 7 deletions.
12 changes: 12 additions & 0 deletions benchmark/test/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
expected_stderr="conversion.simple.stderr",
)

# input matrixfile
test_framework.compare_output(
[
"-input_matrix",
str(test_framework.matrixpath),
"-formats",
"coo,csr",
],
expected_stdout="conversion.matrix.stdout",
expected_stderr="conversion.matrix.stderr",
)

# check that all conversions work
test_framework.compare_output(
[
Expand Down
7 changes: 7 additions & 0 deletions benchmark/test/matrix_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@
expected_stdout="matrix_statistics.simple.stdout",
expected_stderr="matrix_statistics.simple.stderr",
)

# input matrix file
test_framework.compare_output(
["-input_matrix", str(test_framework.matrixpath)],
expected_stdout="matrix_statistics.matrix.stdout",
expected_stderr="matrix_statistics.matrix.stderr",
)
7 changes: 7 additions & 0 deletions benchmark/test/preconditioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
expected_stderr="preconditioner.simple.stderr",
)

# input matrix file
test_framework.compare_output(
["-input_matrix", str(test_framework.matrixpath)],
expected_stdout="preconditioner.matrix.stdout",
expected_stderr="preconditioner.matrix.stderr",
)

# profiler annotations
test_framework.compare_output(
[
Expand Down
46 changes: 46 additions & 0 deletions benchmark/test/reference/conversion.matrix.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
This is Ginkgo 1.7.0 (develop)
running with core module 1.7.0 (develop)
Running on reference(0)
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
The formats are coo,csr
Benchmarking conversions.
Running test case
{
"filename": "../../matrices/test/ani1.mtx",
"conversions": {}
}
Matrix is of size (36, 36)
Current state:
[
{
"filename": "../../matrices/test/ani1.mtx",
"conversions": {
"coo-csr": {
"time": 1.0,
"repetitions": 10,
"completed": true
}
},
"size": 36
}
]
Current state:
[
{
"filename": "../../matrices/test/ani1.mtx",
"conversions": {
"coo-csr": {
"time": 1.0,
"repetitions": 10,
"completed": true
},
"csr-coo": {
"time": 1.0,
"repetitions": 10,
"completed": true
}
},
"size": 36
}
]
19 changes: 19 additions & 0 deletions benchmark/test/reference/conversion.matrix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

[
{
"filename": "../../matrices/test/ani1.mtx",
"conversions": {
"coo-csr": {
"time": 1.0,
"repetitions": 10,
"completed": true
},
"csr-coo": {
"time": 1.0,
"repetitions": 10,
"completed": true
}
},
"size": 36
}
]
17 changes: 17 additions & 0 deletions benchmark/test/reference/distributed_solver.matrix.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This is Ginkgo 1.7.0 (develop)
running with core module 1.7.0 (develop)
Running on reference(0)
Running with 2 warm iterations and 1 running iterations
The random seed for right hand sides is 42
Running cg with 1000 iterations and residual goal of 1.000000e-06
The number of right hand sides is 1
Running test case
{
"filename": "../../matrices/test/ani1.mtx",
"optimal": {
"spmv": "csr-csr"
},
"solver": {}
}
Matrix is of size (36, 36)
Running solver: cg
57 changes: 57 additions & 0 deletions benchmark/test/reference/distributed_solver.matrix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

[
{
"filename": "../../matrices/test/ani1.mtx",
"optimal": {
"spmv": "csr-csr"
},
"solver": {
"cg": {
"recurrent_residuals": [],
"true_residuals": [],
"implicit_residuals": [],
"iteration_timestamps": [],
"rhs_norm": 1.0,
"generate": {
"components": {
"generate(<typename>)": 1.0,
"free": 1.0,
"overhead": 1.0
},
"time": 1.0
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"iteration": 1.0,
"allocate": 1.0,
"dense::fill": 1.0,
"cg::initialize": 1.0,
"advanced_apply(<typename>)": 1.0,
"dense::row_gather": 1.0,
"csr::advanced_spmv": 1.0,
"dense::compute_squared_norm2": 1.0,
"dense::compute_sqrt": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"dense::compute_conj_dot_dispatch": 1.0,
"check(<typename>)": 1.0,
"residual_norm::residual_norm": 1.0,
"cg::step_1": 1.0,
"csr::spmv": 1.0,
"cg::step_2": 1.0,
"free": 1.0,
"overhead": 1.0
},
"iterations": 27,
"time": 1.0
},
"preconditioner": {},
"residual_norm": 1.0,
"repetitions": 1,
"completed": true
}
},
"size": 36
}
]
8 changes: 8 additions & 0 deletions benchmark/test/reference/matrix_statistics.matrix.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is Ginkgo 1.7.0 (develop)
running with core module 1.7.0 (develop)
Running test case
{
"filename": "../../matrices/test/ani1.mtx",
"problem": {}
}
Matrix is of size (36, 36)
38 changes: 38 additions & 0 deletions benchmark/test/reference/matrix_statistics.matrix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

[
{
"filename": "../../matrices/test/ani1.mtx",
"problem": {
"rows": 36,
"columns": 36,
"nonzeros": 208,
"row_distribution": {
"min": 4,
"q1": 4.5,
"median": 6.0,
"q3": 7.0,
"max": 9,
"mean": 5.777777777777778,
"variance": 2.061728395061728,
"skewness": 0.3366362745126052,
"kurtosis": 2.0507009932231366,
"hyperskewness": 1.9165991338199193,
"hyperflatness": 6.0545648993883665
},
"col_distribution": {
"min": 4,
"q1": 4.5,
"median": 6.0,
"q3": 7.0,
"max": 9,
"mean": 5.777777777777778,
"variance": 2.061728395061728,
"skewness": 0.3366362745126052,
"kurtosis": 2.0507009932231366,
"hyperskewness": 1.9165991338199193,
"hyperflatness": 6.0545648993883665
}
},
"size": 36
}
]
42 changes: 42 additions & 0 deletions benchmark/test/reference/preconditioner.matrix.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
This is Ginkgo 1.7.0 (develop)
running with core module 1.7.0 (develop)
Running on reference(0)
Running with 2 warm iterations and 10 running iterations
The random seed for right hand sides is 42
Running with preconditioners: none
Running test case
{
"filename": "../../matrices/test/ani1.mtx",
"preconditioner": {}
}
Matrix is of size (36, 36)
Current state:
[
{
"filename": "../../matrices/test/ani1.mtx",
"preconditioner": {
"none": {
"generate": {
"components": {
"generate(<typename>)": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"completed": true
}
},
"size": 36
}
]
30 changes: 30 additions & 0 deletions benchmark/test/reference/preconditioner.matrix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

[
{
"filename": "../../matrices/test/ani1.mtx",
"preconditioner": {
"none": {
"generate": {
"components": {
"generate(<typename>)": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"overhead": 1.0
},
"time": 1.0,
"repetitions": 10
},
"completed": true
}
},
"size": 36
}
]
17 changes: 17 additions & 0 deletions benchmark/test/reference/solver.matrix.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This is Ginkgo 1.7.0 (develop)
running with core module 1.7.0 (develop)
Running on reference(0)
Running with 2 warm iterations and 1 running iterations
The random seed for right hand sides is 42
Running cg with 1000 iterations and residual goal of 1.000000e-06
The number of right hand sides is 1
Running test case
{
"filename": "../../matrices/test/ani1.mtx",
"optimal": {
"spmv": "csr"
},
"solver": {}
}
Matrix is of size (36, 36)
Running solver: cg
55 changes: 55 additions & 0 deletions benchmark/test/reference/solver.matrix.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

[
{
"filename": "../../matrices/test/ani1.mtx",
"optimal": {
"spmv": "csr"
},
"solver": {
"cg": {
"recurrent_residuals": [],
"true_residuals": [],
"implicit_residuals": [],
"iteration_timestamps": [],
"rhs_norm": 1.0,
"generate": {
"components": {
"generate(<typename>)": 1.0,
"free": 1.0,
"overhead": 1.0
},
"time": 1.0
},
"apply": {
"components": {
"apply(<typename>)": 1.0,
"iteration": 1.0,
"allocate": 1.0,
"dense::fill": 1.0,
"cg::initialize": 1.0,
"advanced_apply(<typename>)": 1.0,
"csr::advanced_spmv": 1.0,
"dense::compute_norm2_dispatch": 1.0,
"copy(<typename>)": 1.0,
"dense::copy": 1.0,
"dense::compute_conj_dot_dispatch": 1.0,
"check(<typename>)": 1.0,
"residual_norm::residual_norm": 1.0,
"cg::step_1": 1.0,
"csr::spmv": 1.0,
"cg::step_2": 1.0,
"free": 1.0,
"overhead": 1.0
},
"iterations": 27,
"time": 1.0
},
"preconditioner": {},
"residual_norm": 1.0,
"repetitions": 1,
"completed": true
}
},
"size": 36
}
]
Loading

0 comments on commit 91a31ff

Please sign in to comment.