Skip to content

Commit

Permalink
Add 3-d Laplace TRLM-3d to ctest
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyscientist committed Nov 18, 2024
1 parent a66dbf0 commit 8b10adb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/staggered_eigensolve_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ std::vector<double> eigensolve(test_t test_param)
// whether we are using the resident smeared gauge or not
eig_param.use_smeared_gauge = gauge_smear;

if (laplace3D == 3) {
if (dslash_type == QUDA_LAPLACE_DSLASH) {
eig_inv_param.kappa = 1.0 / ((laplace3D == 3 ? 6 : 8) + mass);
eig_inv_param.laplace3D = laplace3D;
eig_param.ortho_dim = laplace3D;
eig_param.ortho_dim_size_local = tdim;
if (laplace3D == 3) {
eig_param.ortho_dim = laplace3D;
eig_param.ortho_dim_size_local = tdim;
}
}

// For gtest testing, we prohibit the use of polynomial acceleration as
Expand Down
15 changes: 15 additions & 0 deletions tests/staggered_eigensolve_test_gtest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ bool skip_test(test_t test_param)
auto compute_svd = ::testing::get<3>(test_param);
auto spectrum = ::testing::get<4>(test_param);

// 3-d operator only supported for Laplace
if (eig_type == QUDA_EIG_TR_LANCZOS_3D && dslash_type != QUDA_LAPLACE_DSLASH) return true;

// Reverse engineer the operator type
QudaSolveType combo_solve_type = get_solve_type(use_norm_op, use_pc, compute_svd);
if (combo_solve_type == QUDA_DIRECT_PC_SOLVE) {
Expand Down Expand Up @@ -87,6 +90,7 @@ bool skip_test(test_t test_param)
case QUDA_LAPLACE_DSLASH:
switch (eig_type) {
case QUDA_EIG_TR_LANCZOS:
case QUDA_EIG_TR_LANCZOS_3D:
case QUDA_EIG_BLK_TR_LANCZOS:
if (spectrum != QUDA_SPECTRUM_LR_EIG && spectrum != QUDA_SPECTRUM_SR_EIG) return true;
break;
Expand Down Expand Up @@ -117,6 +121,8 @@ TEST_P(StaggeredEigensolveTest, verify)
auto eig_type = ::testing::get<0>(GetParam());
if (eig_type == QUDA_EIG_IR_ARNOLDI || eig_type == QUDA_EIG_BLK_IR_ARNOLDI) factor *= 10;
auto tol = factor * eig_param.tol;
if (dslash_type == QUDA_LAPLACE_DSLASH) laplace3D = eig_type == QUDA_EIG_TR_LANCZOS_3D ? 3 : 4;

for (auto rsd : eigensolve(GetParam())) EXPECT_LE(rsd, tol);
}

Expand All @@ -143,6 +149,9 @@ auto hermitian_solvers = Values(QUDA_EIG_TR_LANCZOS, QUDA_EIG_BLK_TR_LANCZOS, QU
// Can solve non-hermitian systems
auto non_hermitian_solvers = Values(QUDA_EIG_IR_ARNOLDI);

// Batched solvers for 3-d operators
auto batched_solvers = Values(QUDA_EIG_TR_LANCZOS_3D);

// Eigensolver spectrum types
auto hermitian_spectrum = Values(QUDA_SPECTRUM_LR_EIG, QUDA_SPECTRUM_SR_EIG);
auto non_hermitian_spectrum = Values(QUDA_SPECTRUM_LR_EIG, QUDA_SPECTRUM_SR_EIG, QUDA_SPECTRUM_LM_EIG,
Expand Down Expand Up @@ -171,3 +180,9 @@ INSTANTIATE_TEST_SUITE_P(DirectFull, StaggeredEigensolveTest,
::testing::Combine(hermitian_solvers, Values(QUDA_BOOLEAN_FALSE), Values(QUDA_BOOLEAN_FALSE),
Values(QUDA_BOOLEAN_FALSE), non_hermitian_spectrum),
gettestname);

// 3-d full system direct solve
INSTANTIATE_TEST_SUITE_P(DirectFull3D, StaggeredEigensolveTest,
::testing::Combine(batched_solvers, Values(QUDA_BOOLEAN_FALSE), Values(QUDA_BOOLEAN_FALSE),
Values(QUDA_BOOLEAN_FALSE), hermitian_spectrum),
gettestname);

0 comments on commit 8b10adb

Please sign in to comment.