def compute_barray(sexpr, clevel, kernel): # Uncomment the next for disabling threading #blz.set_nthreads(1) #blz.blosc_set_nthreads(1) print("*** barray (using compression clevel = %d):" % clevel) x = cx # comment this for using numpy arrays in inputs t0 = time() cout = blz.eval(sexpr, vm=kernel, bparams=blz.bparams(clevel)) print("Time for blz.eval (%s) --> %.3f" % (kernel, time()-t0,))
def compute_blz(sexpr, clevel, kernel): # Uncomment the next for disabling threading # Maybe due to some contention between Numexpr and Blosc? # blz.set_nthreads(blz.ncores//2) print "*** blz (using compression clevel = %d):" % clevel if clevel > 0: x, y, z = cx, cy, cz t0 = time() cout = blz.eval(sexpr, vm=kernel, bparams=blz.bparams(clevel)) print "Time for blz.eval (%s) --> %.3f" % (kernel, time()-t0,), print ", cratio (out): %.1f" % (cout.nbytes / float(cout.cbytes))
def compute_blz(sexpr, clevel, kernel): # Uncomment the next for disabling threading # Maybe due to some contention between Numexpr and Blosc? # blz.set_nthreads(blz.ncores//2) print "*** blz (using compression clevel = %d):" % clevel if clevel > 0: x, y, z = cx, cy, cz t0 = time() cout = blz.eval(sexpr, vm=kernel, bparams=blz.bparams(clevel)) print "Time for blz.eval (%s) --> %.3f" % ( kernel, time() - t0, ), print ", cratio (out): %.1f" % (cout.nbytes / float(cout.cbytes))
t0 = time() c = blz.barray(rootdir='myarray') print "time open (disk) ->", round(time()-t0, 3) #print "meta (disk):", c.read_meta() print "data (disk):", repr(c) t0 = time() print sum(ac) print "time sum (memory, iter) ->", round(time()-t0, 3) t0 = time() print sum(c) print "time sum (disk, iter) ->", round(time()-t0, 3) t0 = time() print blz.eval('sum(ac)') print "time sum (memory, eval) ->", round(time()-t0, 3) t0 = time() print blz.eval('sum(c)') print "time sum (disk, eval) ->", round(time()-t0, 3) t0 = time() print ac.sum() print "time sum (memory, method) ->", round(time()-t0, 3) t0 = time() print c.sum() print "time sum (disk, method) ->", round(time()-t0, 3) t0 = time()