Skip to content

Commit

Permalink
Merge branch 'devel' of github.com:jcosborn/qex into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy committed Jan 24, 2025
2 parents d116981 + cc55c9f commit 785dff2
Show file tree
Hide file tree
Showing 9 changed files with 486 additions and 82 deletions.
35 changes: 29 additions & 6 deletions src/bench/benchStagProp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,34 @@ var v1 = lo.ColorVector()
var v2 = lo.ColorVector()
var r = lo.ColorVector()
var rs = newRNGField(RngMilc6, lo, intParam("seed", 987654321).uint64)
let warm0 = 0.29 + 500.0/lo.physVol.float
var warm = floatParam("warm", warm0)
var mass = floatParam("mass", 0.000001)
var warm = floatParam("warm", 0.5)
var maxtime = floatParam("maxtime", 2.0)
var comm = getDefaultComm()
#sp.maxits = intParam("maxits",int(1e9/lo.nSitesOuter.float))
echo "mass: ", mass
echo "warm: ", warm
echo "maxtime(seconds): ", maxtime
threads:
#g.random rs
g.warm warm, rs
threadBarrier()
g.setBC
threadBarrier()
g.stagPhase
v1 := 0
#for e in v1:
# template x(d:int):untyped = lo.vcoords(d,e)
# v1[e][0].re := foldl(x, 4, a*10+b)
# #echo v1[e][0]
#echo v1.norm2
echo "g.norm2: ", g.norm2
if myRank==0:
v1{0}[0] := 1
#v1{2*1024}[0] := 1
echo v1.norm2
#var gs = lo.newGaugeS
#for i in 0..<gs.len: gs[i] := g[i]
var s = newStag(g)
var mass = floatParam("mass", 0.000001)
threads:
v2 := 0
echo v2.norm2
Expand All @@ -51,8 +58,15 @@ threads:
echo v2.norm2
#echo v2
var sp = initSolverParams()
sp.maxits = intParam("maxits",int(1e9/lo.nSitesOuter.float))
sp.maxits = 10
s.solve(v2, v1, mass, sp)
sp.maxits = comm.broadcast int(1.0+(0.1*sp.iterations*maxtime)/sp.seconds)
#echo "maxits: ", sp.maxits
sp.resetStats
s.solve(v2, v1, mass, sp)
sp.maxits = comm.broadcast int(1.0+(sp.iterations*maxtime)/sp.seconds)
#echo "maxits: ", sp.maxits
sp.resetStats
resetTimers()
s.solve(v2, v1, mass, sp)
threads:
Expand All @@ -71,13 +85,22 @@ var g3:array[8,type(g[0])]
for i in 0..3:
g3[2*i] = g[i]
g3[2*i+1] = lo.ColorMatrix()
g3[2*i+1].randomSU rs
g3[2*i+1].warmSU warm, rs
g3[2*i+1] *= 0.1
for i in 0..<g3.len:
echo &"g3[{i}]2: {g3[i].norm2}"
var s3 = newStag3(g3)
#s3.D(v2, v1, m)
sp.resetStats
sp.maxits = 10
s3.solve(v2, v1, mass, sp)
sp.maxits = comm.broadcast int(1.0+(0.1*sp.iterations*maxtime)/sp.seconds)
#echo "maxits: ", sp.maxits
sp.resetStats
s3.solve(v2, v1, mass, sp)
sp.maxits = comm.broadcast int(1.0+(sp.iterations*maxtime)/sp.seconds)
#echo "maxits: ", sp.maxits
sp.resetStats
resetTimers()
s3.solve(v2, v1, mass, sp)
echoProf()
Expand Down
8 changes: 6 additions & 2 deletions src/eigens/hisqev.nim
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ when isMainModule:
#var defaultLat = [16,16,16,16]
defaultSetup()
var rs = newRNGField(RngMilc6, lo, 987654321)
if fn == "":
var warm = floatParam("warm", 0.0)
g.warm warm, rs

when false: # HISQ
threads:
Expand Down Expand Up @@ -653,8 +656,9 @@ when isMainModule:
let s2 = t2.even.norm2
let r2req = sp.r2req
sp.r2req = r2req * (s1/s2)
sp.resetStats
t := 0
s.solveEO(t, t2, m, sp)
s.solveEE(t, t2, m, sp)
dt += t
sp.r2req = r2req

Expand All @@ -663,7 +667,7 @@ when isMainModule:
sp.r2req = 1e-16

d1 := 0
s.solveEO(d1, src, m, sp)
s.solveEE(d1, src, m, sp)
getResid(r, d1, src)
echo "r1: ", r.even.norm2

Expand Down
Loading

0 comments on commit 785dff2

Please sign in to comment.