Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreMarchand20 committed Nov 15, 2023
1 parent 9121a5a commit e7f50e6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 69 deletions.
2 changes: 1 addition & 1 deletion example/use_block_jacobi_solver_with_default_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

ax1.set_title("cluster at depth 1")
ax2.set_title("cluster at depth 2")
ax4.set_title("Hmatrix on rank 0")
ax3.set_title("Hmatrix on rank 0")
ax4.set_title("Block diagonal Hmatrix on rank 0")
Htool.plot(ax1, cluster, points, 1)
Htool.plot(ax2, cluster, points, 2)
Expand Down
10 changes: 6 additions & 4 deletions src/htool/hmatrix/interfaces/virtual_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ class VirtualGeneratorWithPermutationPython : public htool::VirtualGeneratorWith
VirtualGeneratorWithPermutationPython(const py::array_t<int> &target_permutation, const py::array_t<int> &source_permutation) : VirtualGeneratorWithPermutation<CoefficientPrecision>(target_permutation.data(), source_permutation.data()) {}

void copy_submatrix_from_user_numbering(int M, int N, const int *const rows, const int *const cols, CoefficientPrecision *ptr) const override {
if (M * N > 0) {
py::array_t<CoefficientPrecision, py::array::f_style> mat(std::array<long int, 2>{M, N}, ptr, py::capsule(ptr));

py::array_t<CoefficientPrecision, py::array::f_style> mat(std::array<long int, 2>{M, N}, ptr, py::capsule(ptr));
py::array_t<int> py_rows(std::array<long int, 2>{M, 1}, rows, py::capsule(rows));
py::array_t<int> py_cols(std::array<long int, 2>{N, 1}, cols, py::capsule(cols));
py::array_t<int> py_rows(std::array<long int, 2>{M, 1}, rows, py::capsule(rows));
py::array_t<int> py_cols(std::array<long int, 2>{N, 1}, cols, py::capsule(cols));

build_submatrix(py_rows, py_cols, mat);
build_submatrix(py_rows, py_cols, mat);
}
}

// lcov does not see it because of trampoline I assume
Expand Down
59 changes: 0 additions & 59 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,62 +357,3 @@ def load_data_solver(symmetry, mu):
ovr_subdomain_to_global,
local_neumann_matrix,
]


@pytest.fixture(
params=[True, False],
ids=["block_jacobi_solver", "ddm_solver"],
)
def setup_solver_dependencies(request, load_data_solver, epsilon, eta):
[
A,
x_ref,
f,
cluster,
neighbors,
intersections,
symmetry,
UPLO,
cluster_to_ovr_subdomain,
ovr_subdomain_to_global,
local_neumann_matrix,
] = load_data_solver

generator = GeneratorFromMatrix(cluster.get_permutation(), A)
default_approximation = Htool.ComplexDefaultApproximationBuilder(
generator,
cluster,
cluster,
epsilon,
eta,
symmetry,
UPLO,
mpi4py.MPI.COMM_WORLD,
)

solver = None
if request.param:
default_solver_builder = Htool.ComplexDefaultSolverBuilder(
default_approximation.distributed_operator,
default_approximation.block_diagonal_hmatrix,
)
solver = default_solver_builder.solver
else:
default_solver_builder = Htool.ComplexDefaultDDMSolverBuilder(
default_approximation.distributed_operator,
default_approximation.block_diagonal_hmatrix,
generator,
ovr_subdomain_to_global,
cluster_to_ovr_subdomain,
neighbors,
intersections,
)
solver = default_solver_builder.solver

return (
solver,
x_ref,
f,
default_approximation.distributed_operator,
local_neumann_matrix,
)
2 changes: 1 addition & 1 deletion tests/test_ddm_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_ddm_solver(
+ restart
+ " -hpddm_schwarz_method "
+ hpddm_schwarz_method
+ " -hpddm_max_it 200 -hpddm_variant right -hpddm_compute_residual l2 -hpddm_tol "
+ " -hpddm_max_it 200 -hpddm_variant right -hpddm_tol "
+ str(tol)
)

Expand Down
4 changes: 0 additions & 4 deletions tests/test_hmatrix.py

This file was deleted.

0 comments on commit e7f50e6

Please sign in to comment.