From 8a07b5200960cabc24a3ceefe9c20c331b1c2954 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 13 Oct 2022 18:44:47 -0400 Subject: [PATCH] Dirichlet --- .../GeneralEvenOddRationalRatio.h | 10 +++- .../pseudofermion/TwoFlavourEvenOddRatio.h | 5 ++ Grid/qcd/hmc/HMC.h | 2 +- Grid/qcd/hmc/integrators/Integrator.h | 42 +++++++++++++++ Grid/simd/Grid_vector_types.h | 53 ------------------- configure.ac | 2 +- systems/Crusher/config-command | 2 + 7 files changed, 59 insertions(+), 57 deletions(-) diff --git a/Grid/qcd/action/pseudofermion/GeneralEvenOddRationalRatio.h b/Grid/qcd/action/pseudofermion/GeneralEvenOddRationalRatio.h index 027f37b3..ff605362 100644 --- a/Grid/qcd/action/pseudofermion/GeneralEvenOddRationalRatio.h +++ b/Grid/qcd/action/pseudofermion/GeneralEvenOddRationalRatio.h @@ -59,7 +59,7 @@ NAMESPACE_BEGIN(Grid); typedef RationalActionParams Params; Params param; - + RealD RefreshAction; //For action evaluation MultiShiftFunction ApproxPowerAction ; //rational approx for X^{1/inv_pow} MultiShiftFunction ApproxNegPowerAction; //rational approx for X^{-1/inv_pow} @@ -270,12 +270,18 @@ NAMESPACE_BEGIN(Grid); assert(NumOp.ConstEE() == 1); assert(DenOp.ConstEE() == 1); PhiEven = Zero(); - std::cout< &_NumOp, FermionOperator &_DenOp, @@ -132,6 +134,9 @@ NAMESPACE_BEGIN(Grid); // Even det factors DenOp.MooeeDag(etaEven,tmp); NumOp.MooeeInvDag(tmp,PhiEven); + + RefreshAction = norm2(etaEven)+norm2(etaOdd); + std::cout << " refresh " < + void operator()(std::vector*> repr_set, Repr& Rep, int level, RealD& H) { + + for (int a = 0; a < repr_set.size(); ++a) { + RealD Hterm = repr_set.at(a)->Sinitial(Rep.U); + std::cout << GridLogMessage << "Sinitial Level " << level << " term " << a << " H Hirep = " << Hterm << std::endl; + H += Hterm; + + } + } + } Sinitial_hireps{}; + + RealD Sinitial(Field& U) + { // here also U not used + + std::cout << GridLogIntegrator << "Integrator initial action\n"; + + RealD H = - FieldImplementation::FieldSquareNorm(P)/HMC_MOMENTUM_DENOMINATOR; // - trace (P*P)/denom + + RealD Hterm; + + // Actions + for (int level = 0; level < as.size(); ++level) { + for (int actionID = 0; actionID < as[level].actions.size(); ++actionID) { + // get gauge field from the SmearingPolicy and + // based on the boolean is_smeared in actionID + Field& Us = Smearer.get_U(as[level].actions.at(actionID)->is_smeared); + std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] action eval " << std::endl; + as[level].actions.at(actionID)->S_timer_start(); + Hterm = as[level].actions.at(actionID)->Sinitial(Us); + as[level].actions.at(actionID)->S_timer_stop(); + std::cout << GridLogMessage << "S [" << level << "][" << actionID << "] H = " << Hterm << std::endl; + H += Hterm; + } + as[level].apply(Sinitial_hireps, Representations, level, H); + } + + return H; + } + + void integrate(Field& U) { // reset the clocks diff --git a/Grid/simd/Grid_vector_types.h b/Grid/simd/Grid_vector_types.h index 42460c48..daf41cae 100644 --- a/Grid/simd/Grid_vector_types.h +++ b/Grid/simd/Grid_vector_types.h @@ -148,23 +148,6 @@ accelerator_inline Grid_half sfw_float_to_half(float ff) { #endif #endif -/* -#ifdef A64FXVLA -#pragma message("building A64FX VLA") -#if defined(ARMCLANGCOMPAT) - #pragma message("applying data types patch") -#endif -#include -#include "Grid_a64fx-2.h" -#endif - -#ifdef A64FXVLS -#pragma message("building A64FX VLS") -#include -#include "Grid_a64fx-fixedsize.h" -#endif -*/ - #ifdef SSE4 #include "Grid_sse4.h" #endif @@ -1147,42 +1130,6 @@ static_assert(sizeof(SIMD_Ftype) == sizeof(SIMD_Itype), "SIMD vector lengths inc #endif #endif -///////////////////////////////////////// -// Some traits to recognise the types -///////////////////////////////////////// -template -struct is_simd : public std::false_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; -template <> struct is_simd : public std::true_type {}; - -template using IfSimd = Invoke::value, int> >; -template using IfNotSimd = Invoke::value, unsigned> >; - -/////////////////////////////////////////////// -// Convenience insert / extract with complex support -/////////////////////////////////////////////// -template -accelerator_inline S getlane(const Grid_simd &in,int lane) { - return in.getlane(lane); -} -template -accelerator_inline void putlane(Grid_simd &vec,const S &_S, int lane){ - vec.putlane(_S,lane); -} -template = 0 > -accelerator_inline S getlane(const S &in,int lane) { - return in; -} -template = 0 > -accelerator_inline void putlane(S &vec,const S &_S, int lane){ - vec = _S; -} - NAMESPACE_END(Grid); diff --git a/configure.ac b/configure.ac index 9e7b8b80..2e6199c7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_PREREQ([2.71]) +AC_PREREQ([2.69]) AC_INIT([Grid],[0.7.0],[https://github.com/paboyle/Grid],[Grid]) AC_CANONICAL_BUILD AC_CANONICAL_HOST diff --git a/systems/Crusher/config-command b/systems/Crusher/config-command index 854c2c01..57b93e03 100644 --- a/systems/Crusher/config-command +++ b/systems/Crusher/config-command @@ -14,4 +14,6 @@ CXXFLAGS="-fPIC -I{$ROCM_PATH}/include/ -std=c++14 -I${MPICH_DIR}/include -L/lib LDFLAGS="-L/lib64 -L/opt/rocm-5.2.0/lib/ -L${MPICH_DIR}/lib -lmpi -L${CRAY_MPICH_ROOTDIR}/gtl/lib -lmpi_gtl_hsa -lamdhip64 " +#--enable-simd=GPU-RRII \ +