import time import dask.array as da import dask_mpi as dm import dask.distributed as dd def elapsed(start): return str(time.time()-start)+"s" def main(): dm.initialize() client=dd.Client() #about 6G of random numbers dim=50000000*16 numChunks=4 randomArray=da.random.normal(0.0,0.1,size=dim,chunks=(int(dim/numChunks))) meanDelayed=randomArray.mean() meanDelayed.visualize() start=time.time() mean=meanDelayed.compute() computeTime=elapsed(start) print("mean is "+str(mean)) print() print("==================================") print("compute time: "+computeTime) print("==================================") print() if __name__=="__main__": start=time.time() main() wallClock=elapsed(start) print() print("----------------------------------------") print("wall clock time:"+wallClock) print("----------------------------------------") print()