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
36 changes: 26 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
pull_request:
branches: [main]

Expand Down Expand Up @@ -137,10 +135,18 @@ jobs:
- name: Run tests
run: |
export PYTHONPATH="$PWD/build"
mpirun -np 1 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
mpirun -np 2 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
mpirun -np 3 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
mpirun -np 4 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests --ignore=tests/test_hmatrix.py --ignore=tests/test_logger.py
mpirun -np 1 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_cluster.py
mpirun -np 2 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_cluster.py
mpirun -np 3 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_cluster.py
mpirun -np 4 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_cluster.py
mpirun -np 1 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_distributed_operator.py
mpirun -np 2 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_distributed_operator.py
mpirun -np 3 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_distributed_operator.py
mpirun -np 4 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_distributed_operator.py
mpirun -np 1 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_ddm_solver.py
mpirun -np 2 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_ddm_solver.py
mpirun -np 3 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_ddm_solver.py
mpirun -np 4 ${{ matrix.MPIEXEC_PREFLAGS }} python3 -m pytest tests/test_ddm_solver.py
python3 -m pytest tests/test_hmatrix.py
python3 -m pytest tests/test_logger.py

Expand All @@ -161,8 +167,18 @@ jobs:
- name: Generate coverage reports
if: matrix.CODE_COVERAGE == 'ON'
run: |
lcov --ignore-errors mismatch --capture --base-directory ./ --directory build/ --output-file coverage.info
lcov --remove coverage.info '/usr/*' '*/hpddm/*' '*/pybind11/*' '*/lib/htool/*' --output-file ../coverage.info
# Capture coverage: both MPI (.gcda in /tmp/gcov-mpi) and serial (.gcda in build/)
lcov --ignore-errors mismatch \
--capture \
--base-directory $(pwd) \
--directory build \
--output-file coverage.info

# Exclude third-party and system paths
lcov --remove coverage.info '/usr/*' '*/hpddm/*' '*/pybind11/*' '*/lib/htool/*' --output-file filtered.info

# Convert absolute paths to relative paths for Codecov
lcov --extract filtered.info "${PWD}/src/*" --output-file coverage.info

- uses: actions/upload-artifact@v4
with:
Expand All @@ -180,9 +196,9 @@ jobs:
fetch-depth: 0
- uses: actions/download-artifact@v4
- name: Upload coverage report
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
file: ./coverage.info
files: ./coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
8 changes: 3 additions & 5 deletions src/htool/misc/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ class PythonLoggerWriter : public htool::IObjectWriter {
case htool::LogLevel::INFO:
logger.attr("info")(message);
break;
default:
break;
}
}

void set_log_level(htool::LogLevel log_level) override {
}
// LCOV_EXCL_START
void set_log_level(htool::LogLevel log_level) override {}
// LCOV_EXCL_STOP
};

#endif
12 changes: 11 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@ def local_operator(request, generator, cluster, geometry):
False,
)
)
assert (
result[1][-1].local_target_renumbering.size
== target_local_cluster.get_size()
)
assert (
result[1][-1].local_source_renumbering.size
== source_cluster.get_size()
- source_local_cluster.get_size()
- source_local_cluster.get_offset()
)

if request.param == "LocalAndExtraDiagonal":
result[0] = "LocalAndExtraDiagonal"
result[1].append(
Expand All @@ -277,7 +288,6 @@ def local_operator(request, generator, cluster, geometry):
Htool.LocalRenumbering(source_local_cluster),
)
)

return result
else:
return None
Expand Down
5 changes: 5 additions & 0 deletions tests/test_distributed_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def test_distributed_operator(
Y_2 = generator.mat_mat(X)
assert np.linalg.norm(Y_1 - Y_2) / np.linalg.norm(Y_2) < epsilon

X = np.asfortranarray(np.random.rand(nb_cols, 1))
Y_1 = distributed_operator @ X
Y_2 = generator.mat_mat(X)
assert np.linalg.norm(Y_1 - Y_2) / np.linalg.norm(Y_2) < epsilon

# Test sub matrix vector product
test_offset = int(nb_cols / 10)
test_size = int(nb_cols / 10)
Expand Down