Skip to content

Commit

Permalink
allow setting target time for benchStagProp benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
jcosborn committed Jan 17, 2025
1 parent f0e54e1 commit 5f22bc6
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/bench/benchStagProp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ 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
Expand All @@ -42,7 +48,6 @@ 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 @@ -53,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 @@ -73,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

0 comments on commit 5f22bc6

Please sign in to comment.