Skip to content

Add proxy tests for MFEM integration#1994

Open
nbeams wants to merge 2 commits into
developfrom
add_derived_vec_test
Open

Add proxy tests for MFEM integration#1994
nbeams wants to merge 2 commits into
developfrom
add_derived_vec_test

Conversation

@nbeams
Copy link
Copy Markdown
Collaborator

@nbeams nbeams commented Mar 24, 2026

This PR adds two new solver tests that rely on wrapper classes meant to simulate the ones used for the Ginkgo integration in MFEM, to hopefully catch if a proposed Ginkgo change would break the integration with MFEM (or any other library that uses a similar integration approach).

For the purposes of these tests, the wrapped vector type is the Ginkgo MultiVector, since it is a non-Dense type that has the functionality needed from the wrapped type (namely, scale/add and understanding of handling device or host data). In order to handle all the scenarios in the test suite, these proxy wrapper classes have a few notable differences from the actual MFEM wrappers: the wrappers here have a 2D size and understanding of stride (MFEM Vectors do not), and the OperatorWrapper has to be able to handle mixed precision application.

Besides the wrapper classes, the MFEM integration relies on being able to change factory parameters with code like

// Update this object's solver_factory for generating concrete solvers
auto current_params = gko::as<typename SolverType::Factory>
                        (solver_factory)->get_parameters();
this->solver_factory = current_params.with_criteria(this->stop_factory)
                         .on(this->executor);

in order to update the relative tolerance, maximum iterations, etc. I'm not sure if this needs a specific test (or is maybe already covered by a test?).

@nbeams nbeams added reg:testing This is related to testing. type:solver This is related to the solvers reg:external-lib-interfacing This is related to wrappers/interfaces of Ginkgo with external libraries labels Mar 24, 2026
@yhmtsai
Copy link
Copy Markdown
Member

yhmtsai commented Apr 1, 2026

for update criterion, we have the corresponding test in the core/test/solver/<solver>.

@nbeams nbeams force-pushed the add_derived_vec_test branch from aaeff43 to adc56ae Compare April 1, 2026 15:57
@nbeams
Copy link
Copy Markdown
Collaborator Author

nbeams commented Apr 1, 2026

I tried adding a new test in core/test/solver/cg.cpp for the way we use with_criteria in the MFEM wrappers.

@nbeams nbeams force-pushed the add_derived_vec_test branch from adc56ae to c98f1b3 Compare April 1, 2026 15:59
@nbeams nbeams added the 1:ST:ready-for-review This PR is ready for review label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1:ST:ready-for-review This PR is ready for review reg:external-lib-interfacing This is related to wrappers/interfaces of Ginkgo with external libraries reg:testing This is related to testing. type:solver This is related to the solvers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants