From 9a90b21d05b0b9621dd94c8a48705c93afaff611 Mon Sep 17 00:00:00 2001 From: James Osborn Date: Thu, 19 Dec 2024 10:28:06 -0600 Subject: [PATCH] fix and test hisqsmear --- src/gauge/hisqsmear.nim | 115 ++++++++++++++++++++++++++++------------ src/layout/layoutX.nim | 40 ++++++++++++-- 2 files changed, 118 insertions(+), 37 deletions(-) diff --git a/src/gauge/hisqsmear.nim b/src/gauge/hisqsmear.nim index d9e931f..77b7749 100644 --- a/src/gauge/hisqsmear.nim +++ b/src/gauge/hisqsmear.nim @@ -39,7 +39,7 @@ proc smearGetForce*[T]( var dsdx_dxdw = newOneOf(dsdu) dsdx_dxdw_dwdv = newOneOf(dsdu) - dsdx_dxdw.fat7lDeriv(su,dsdsu,fat7l2,sul,dsdsul,naik,info) # Second fat7 + dsdx_dxdw.fat7lDeriv(w,dsdsu,fat7l2,w,dsdsul,naik,info) # Second fat7 threads: # Unitary projection for mu in 0.. tol*eps: + echo &"> ERROR rel error |{r}| > {tol*eps}" + + proc checkG = + echo "Checking GaugeDeriv" + for mu in 0.. 1: var k = x.len-1 - while (lx[k] and 1) > 0: + while (lx[k] and 1) > 0 or (k in noSplitInnerList): k.dec if k < 0: echo "not enough 2's in partitioned geom:" @@ -27,7 +31,7 @@ proc partitionGeom[T](lx,nx:var openArray[T]; x:openArray[T]; n,dist:int) = echo " /", n quit(-1) for i in countdown(k-1,0): - if (lx[i] and 1) == 0: + if (lx[i] and 1) == 0 and (k notin noSplitInnerList): if dist == 0: if lx[i]>lx[k] or (lx[i]==lx[k] and nx[i]>nx[k]): k = i else: @@ -298,6 +302,36 @@ proc paritySubset*(s: var Subset; l: Layout; par: int) = s.layoutSubset(l, "e") else: s.layoutSubset(l, "o") +proc timesliceSubsetsRange*(l: Layout, i0,i1: int): seq[Subset] = + # find timeslice subsets within a range of outer sites [i0,i1] inclusive + doAssert(l.innerGeom[^1] == 1) + let nt = l.physGeom[^1] + result.newSeq(nt) + var x = newSeq[int32](l.nDim) + for i in 0..