예제 #1
0
def getChoiceSites(tx):
  getSiteRe = re.compile( re.escape(nameof(tx)) + "_([0-9]*)_lvl[0-9]*_.*" )
  getSite=lambda t: int(getSiteRe.match(nameof(t)).group(1))
  #it would be nice to export this data, for now parse it from tunable names
  sites=[]
  sites.extend(map(getSite, getTunables(tx,"algchoice.cutoff")))
  sites.extend(map(getSite, getTunables(tx,"algchoice.alg")))
  return list(set(sites))
예제 #2
0
def printTx(tx, depth, loops):
    t = len(getTunables(tx, "system.cutoff.splitsize"))
    cs = len(getChoiceSites(tx))
    if loops == 0:
        t += len(getTunables(tx, "system.cutoff.sequential"))
    print ''.ljust(
        2 *
        depth) + ' - ' + nameof(tx) + " (%d choice site, %d cutoffs)" % (cs, t)
예제 #3
0
def getChoiceSites(tx):
    getSiteRe = re.compile(re.escape(nameof(tx)) + "_([0-9]*)_lvl[0-9]*_.*")
    getSite = lambda t: int(getSiteRe.match(nameof(t)).group(1))
    #it would be nice to export this data, for now parse it from tunable names
    sites = []
    sites.extend(map(getSite, getTunables(tx, "algchoice.cutoff")))
    sites.extend(map(getSite, getTunables(tx, "algchoice.alg")))
    return list(set(sites))
예제 #4
0
def getChoiceSiteWeight(tx, site, cutoffs):
    getSiteRe = re.compile(re.escape(nameof(tx)) + "_([0-9]*)_lvl[0-9]*_.*")
    getSite = lambda t: int(getSiteRe.match(nameof(t)).group(1))
    tunables = filter(lambda x: getSite(x) == site,
                      getTunables(tx, "algchoice.alg"))
    algcounts = map(
        lambda x: int(x.getAttribute("max")) - int(x.getAttribute("min")),
        tunables)
    return reduce(max, algcounts, 1) + len(cutoffs)
예제 #5
0
def printTx(tx, depth, loops):
  t = len(getTunables(tx, "system.cutoff.splitsize"))
  cs = len(getChoiceSites(tx))
  if loops == 0:
    t+=len(getTunables(tx, "system.cutoff.sequential"))
  print ''.ljust(2*depth) + ' - ' + nameof(tx) + " (%d choice site, %d cutoffs)"%(cs,t)
예제 #6
0
def getChoiceSiteWeight(tx, site, cutoffs):
  getSiteRe = re.compile( re.escape(nameof(tx)) + "_([0-9]*)_lvl[0-9]*_.*" )
  getSite=lambda t: int(getSiteRe.match(nameof(t)).group(1))
  tunables=filter(lambda x: getSite(x)==site, getTunables(tx,"algchoice.alg"))
  algcounts=map(lambda x: int(x.getAttribute("max"))-int(x.getAttribute("min")),tunables) 
  return reduce(max, algcounts, 1)+len(cutoffs)