diff --git a/tests/testTWMCloverFull.cc b/tests/testTWMCloverFull.cc index 6bcb8ed6..cdac8024 100644 --- a/tests/testTWMCloverFull.cc +++ b/tests/testTWMCloverFull.cc @@ -117,7 +117,7 @@ void TestTMClover::operator()() args_.MinCt, true); - RandomGauge gauge(geom); + RandomGauge gauge(geom, 1, 0.01); // The TM clover operator expects an array of inverse clover terms such that // it is the normal and hermitian conjugate. Since there is no twisted mass @@ -134,11 +134,9 @@ void TestTMClover::operator()() HybridSpinor hs_source(geom), hs_qphix1(geom), hs_qphix2(geom), hs_qdp1(geom), hs_qdp2(geom); - if (true) { - gaussian(hs_source.qdp()); - } else { - make_point_source(hs_source.qdp()); - } + //gaussian(hs_source.qdp()); + make_point_source(hs_source.qdp()); + hs_source.pack(); TMClovDslash D32( @@ -216,44 +214,44 @@ void TestTMClover::operator()() } // isign #endif - // This tests the full even/odd operators - QDPIO::cout << std::endl - << std::endl - << "TESTING TWISTED MASS EVEN/ODD (DEGENERATE) DSLASH CLOVER OPERATOR" - << std::endl; - - int const cb = 1; - int const other_cb = 1 - cb; - - EvenOddTMCloverOperator M(gauge.u_packed, - gauge.clov_packed[cb], - gauge_inv_clov_array[other_cb], - &geom, - gauge.t_boundary, - gauge.aniso_fac_s, - gauge.aniso_fac_t); - Phi ltmp = zero; - Real betaFactor = Real(0.25); + for (int const cb : {1, 0}) { + // This tests the full even/odd operators + QDPIO::cout << std::endl + << std::endl + << "TESTING TWISTED MASS EVEN/ODD (DEGENERATE) DSLASH CLOVER OPERATOR" + << std::endl; - for (int const isign : {1, -1}) { - masterPrintf("isign: %d\n", isign); + int const other_cb = 1 - cb; - // (a) Apply QPhiX Operator - M(hs_qphix1[cb], hs_source[cb], isign); - hs_qphix1.unpack(); + EvenOddTMCloverOperator M(gauge.u_packed, + gauge.clov_packed[cb], + gauge_inv_clov_array[other_cb], + &geom, + gauge.t_boundary, + gauge.aniso_fac_s, + gauge.aniso_fac_t); + Phi ltmp = zero; + Real betaFactor = Real(0.25); - // (b) Apply QDP Dslash - qdp_apply_operator(hs_qdp1.qdp(), - hs_source.qdp(), - gauge.u_aniso, - gauge.clov_qdp, - gauge.invclov_qdp, - isign, - cb); + for (int const isign : {1, -1}) { + masterPrintf("isign: %d\n", isign); - expect_near(hs_qdp1.qdp(), hs_qphix1.qdp(), 1e-20, geom, cb, "TM clover linop"); + // (a) Apply QPhiX Operator + M(hs_qphix1[cb], hs_source[cb], isign); + hs_qphix1.unpack(); - } // isign + // (b) Apply QDP Dslash + qdp_apply_operator(hs_qdp1.qdp(), + hs_source.qdp(), + gauge.u_aniso, + gauge.clov_qdp, + gauge.invclov_qdp, + isign, + cb); + + expect_near(hs_qdp1.qdp(), hs_qphix1.qdp(), 1e-20, geom, cb, "TM clover linop"); + + } // isign // This tests the CG #if 1 @@ -367,6 +365,7 @@ void TestTMClover::operator()() masterPrintf("GFLOPS=%e\n", 1.0e-9 * (double)(total_flops) / (end - start)); } #endif + } QDPIO::cout << std::endl; }