Esempio n. 1
0
def start_il2_engine(bn, ie_alg=zc_norm, order=None):
    cpts = bn.cpts()
    subdomains = list(cpts)
    if order is None:
        order = EO.minFill(subdomains, 6, Random(0)).order
        # order = EO.minSize(subdomains).order
    if ie_alg is rc:
        ie = rc.create(cpts, order)
        ie.fullCaching()
    else:
        jt = EO.traditionalJoinTree(subdomains, order)
        # jt = EO.bucketerJoinTree(subdomains,order)
        start = nanoTime()
        ie = ie_alg(jt, cpts)
        ie.compilationTime = (nanoTime() - start) * 1e-9
    return ie
Esempio n. 2
0
 def perf_counter():
     return nanoTime() / 1000000000
Esempio n. 3
0
 def perf_counter():
     return nanoTime() / 1000000000
Esempio n. 4
0
if len(sys.argv) < 2:
    print "Usage: %s NET" % sys.argv[0]
    exit(1)

filename = sys.argv[1]
if len(sys.argv) >= 3:
    out_path = None
    full_path = sys.argv[2]
else:
    split = os.path.split(filename)
    out_name = os.path.splitext(split[-1])[0] + ".order"
    out_path = os.path.join('orders',split[0])
    full_path = os.path.join(out_path,out_name)

t1 = nanoTime()
print "opening: %s" % filename,
bn = pybn.net_io.open_network(filename)
t2 = nanoTime()
print "(%.4fs)" % ((t2-t1)*1e-9)

print "minfill ...",
t1 = nanoTime()
mf_order,mf_size = pybn.engines.minfill(bn,10)
t2 = nanoTime()
print "(%.4fs once)" % ((t2-t1)*1e-9)

#mf_order,mf_size = pybn.engines.minfill(bn,100)
#mf_order,mf_size = pybn.engines.minfill(bn,100)
#mf_order,mf_size = None,1000
#print "minsize ..."