Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 45 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential ca-certificates wget
sudo apt-get install -y build-essential ca-certificates wget python3
CMAKE_VERSION=4.4.0
echo "Installing CMake ${CMAKE_VERSION}"
wget -qO /tmp/cmake.tar.gz "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-x86_64.tar.gz"
Expand All @@ -47,6 +47,21 @@ jobs:
Add-Content -Path $env:GITHUB_PATH -Value $cmakeBin
& "$cmakeBin\cmake.exe" --version

- name: Download quick_ci matrices (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y python3
cd clients/matrices
python3 matrix_downloader.py quick_ci

- name: Download quick_ci matrices (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Set-Location clients/matrices
python matrix_downloader.py quick_ci

- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
Expand Down Expand Up @@ -79,7 +94,7 @@ jobs:
set -e
if command -v apt-get >/dev/null 2>&1; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates git wget
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential ca-certificates git wget python3
elif command -v yum >/dev/null 2>&1; then
yum -y install gcc gcc-c++ make wget git
if ! command -v cmake >/dev/null 2>&1; then
Expand All @@ -100,6 +115,20 @@ jobs:
ln -sfn /tmp/cmake-${CMAKE_VERSION}-linux-x86_64/bin/* /usr/local/bin/ || true
cmake --version || true

- name: Download quick_ci matrices
run: |
if command -v apt-get >/dev/null 2>&1; then
apt-get update
apt-get install -y python3
elif command -v yum >/dev/null 2>&1; then
yum -y install python3
else
echo "Package manager not found for Python installation" >&2
exit 1
fi
cd clients/matrices
python3 matrix_downloader.py quick_ci

- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}

Expand Down Expand Up @@ -144,10 +173,23 @@ jobs:
- name: Install coverage dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential ca-certificates wget python3-pip
sudo apt-get install -y build-essential ca-certificates wget python3 python3-pip
python3 -m pip install --user gcovr
echo "${HOME}/.local/bin" >> $GITHUB_PATH

- name: Download quick_ci matrices
run: |
if command -v python3 >/dev/null 2>&1; then
cd clients/matrices
python3 matrix_downloader.py quick_ci
elif command -v python >/dev/null 2>&1; then
cd clients/matrices
python matrix_downloader.py quick_ci
else
echo "Python interpreter not found" >&2
exit 1
fi

- name: Configure coverage build
run: |
cmake -S . -B build-coverage -DENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
Expand Down
292 changes: 148 additions & 144 deletions clients/matrices/matrix_downloader.py

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions clients/testing/test_functions_krylov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ bool testing::test_krylov(krylov_solver solver_type, Arguments arg)
linalg::csr_matrix mat_A;
mat_A.read_mtx(arg.filename);

linalg::vector<double> D1(mat_A.get_m());
linalg::vector<double> D2(mat_A.get_m());
mat_A.apply_ruiz_scaling(D1, D2, 30, 1e-03);

// Solution vector
linalg::vector<double> vec_x(mat_A.get_m());
vec_x.zeros();
Expand Down
16 changes: 15 additions & 1 deletion clients/testing/test_functions_multiply_by_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,28 @@ bool testing::test_multiply_by_vector(Arguments arg)
// Inline host solution
linalg::vector<double> host_y(mat_A.get_m());
host_y.zeros();

int max_nnz_per_row = 0;
for(int i = 0; i < mat_A.get_m(); ++i)
{
for(int j = mat_A.get_row_ptr()[i]; j < mat_A.get_row_ptr()[i + 1]; ++j)
const int start = mat_A.get_row_ptr()[i];
const int end = mat_A.get_row_ptr()[i + 1];

max_nnz_per_row = std::max(max_nnz_per_row, end - start);

for(int j = start; j < end; ++j)
{
host_y[i] += mat_A.get_val()[j] * vec_x.get_vec()[mat_A.get_col_ind()[j]];
}
}

std::cout << "max_nnz_per_row: " << max_nnz_per_row << std::endl;

// mat_A.print_matrix("A");

// vec_y.print_vector("Computed solution");
// host_y.print_vector("Reference solution");

// Compare solutions
bool success = check_vector_equality(vec_y, host_y);

Expand Down
17 changes: 17 additions & 0 deletions clients/testing/tests/test_BICGSTAB.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
Tests:
quick_ci:
precond: [none, jacobi, SOR]
matrix_file: ["matrices/SPD/nos7/nos7.mtx"]
max_iters: [400]
backend: [CPU]

quick_ci_2:
precond: [jacobi]
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx"]
max_iters: [1500]
backend: [CPU]

small:
precond: [none, jacobi]
matrix_file: ["matrices/SPD/mesh1em6/mesh1em6.mtx",
Expand Down
17 changes: 17 additions & 0 deletions clients/testing/tests/test_CG.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
Tests:
quick_ci:
precond: [none, jacobi, SOR]
matrix_file: ["matrices/SPD/nos7/nos7.mtx"]
max_iters: [400]
backend: [CPU]

quick_ci_2:
precond: [jacobi]
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx"]
max_iters: [1500]
backend: [CPU]

small1:
precond: [none, jacobi, SOR]
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_SOR.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [200]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_SSOR.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [200]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_gauss_seidel.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [200]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Tests:
small:
m: [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
m: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
backend: [CPU, GPU]

medium:
m: [200,300,400]
m: [200, 300, 400]
backend: [CPU, GPU]
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Tests:
quick_ci:
m: [23, 77, 99, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
157, 163, 167, 173, 179, 181, 191, 193, 197, 199]
backend: [CPU]

small:
m: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_jacobi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [200]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
10 changes: 10 additions & 0 deletions clients/testing/tests/test_multiply_by_matrix.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/ex5/ex5.mtx"]
backend: [CPU, GPU]
10 changes: 10 additions & 0 deletions clients/testing/tests/test_multiply_by_vector.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
12 changes: 12 additions & 0 deletions clients/testing/tests/test_ruiz_scaling.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [30]
tol: [1e-6]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_symmetric_gauss_seidel.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [200]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
12 changes: 12 additions & 0 deletions clients/testing/tests/test_symmetric_ruiz_scaling.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
max_iters: [30]
tol: [1e-6]
backend: [GPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
4 changes: 4 additions & 0 deletions clients/testing/tests/test_transpose_dense.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Tests:
quick_ci:
m: [35, 56, 78, 90, 100, 120, 150, 200]
backend: [CPU]

small:
m: [10, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
Expand Down
11 changes: 11 additions & 0 deletions clients/testing/tests/test_triangular_solve.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
Tests:
quick_ci:
matrix_file: ["matrices/SPD/nos1/nos1.mtx",
"matrices/SPD/nos2/nos2.mtx",
"matrices/SPD/nos3/nos3.mtx",
"matrices/SPD/nos4/nos4.mtx",
"matrices/SPD/nos5/nos5.mtx",
"matrices/SPD/nos6/nos6.mtx",
"matrices/SPD/nos7/nos7.mtx"]
uplo: [lower, upper]
backend: [CPU]

small:
matrix_file: ["matrices/SPD/bcsstm02/bcsstm02.mtx",
"matrices/SPD/ex5/ex5.mtx",
Expand Down
4 changes: 2 additions & 2 deletions clients/testing/tests/test_tridiagonal_solver.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Tests:
small:
quick_ci:
m: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
n: [2, 3, 4, 5, 6, 7, 8, 9, 10]
pivoting_strategy: [none, partial]
backend: [CPU, GPU]
backend: [CPU]

small1:
m: [20, 40, 75, 110, 150, 312, 625, 1000]
Expand Down
Loading
Loading