#! python from gaepsi.tools import timer ses_import = timer.session('import extra modules') from optparse import OptionParser, OptionValueError from gaepsi.tools.cmdline import parsearray, parsematrix parser = OptionParser(conflict_handler="resolve") parser.add_option("-r", "--range", dest="range", type="string", action="callback", callback=parsearray, callback_kwargs=dict(sep=',', dtype='i4', len=2)) parser.add_option("-r", "--rangefile", dest="rangefile", type="string", help="a file listing file ids to operate") parser.add_option("-s", "--snapname", dest="snapname") parser.add_option("-f", "--format", dest="format", help="the format of the snapshot") parser.add_option( "-z", "--zip", dest="zip", action="store_true", help="save to the gzip format instead of a direct dump(only the raster)") parser.add_option("-g", "--geometry",
if opt.sfr != None: msfrmin, msfrmax = loadminmax(comm, opt.prefix+ 'hist-msfr.npz') if opt.temp!= None: mtempmin, mtempmax = loadminmax(comm, opt.prefix+ 'hist-mtemp.npz') if opt.blackhole != None: bhmin, bhmax = loadminmax(comm, opt.prefix + 'hist-bh.npz') if opt.star != None: starmin, starmax = loadminmax(comm, opt.prefix + 'hist-star.npz') if opt.output != None: mpifile = MPI.File.Open(comm, opt.output, MPI.MODE_WRONLY + MPI.MODE_CREATE) mpifile.Set_view(disp = 0, etype=MPI.BYTE, filetype=MPI.BYTE) else: mpifile = None for step in range(steps): ses_step = timer.session("step %d" % step) ses_reading = timer.session('reading') if step < len(stripeids): stripeid = stripeids[step] stripe = Stripe(rank = stripeid, total = opt.total, imagesize = opt.geometry) if stripe.total < 1000: fn = opt.prefix + '%03d.raw' % stripe.rank else: fn = opt.prefix + '%04d.raw' % stripe.rank if mpifile == None and os.path.exists(fn): ses_step.end() continue image = zeros(dtype=('u1', 3), shape = stripe.shape) else: stripe = None
msfrmin, msfrmax = loadminmax(comm, opt.prefix + 'hist-msfr.npz') if opt.temp != None: mtempmin, mtempmax = loadminmax(comm, opt.prefix + 'hist-mtemp.npz') if opt.blackhole != None: bhmin, bhmax = loadminmax(comm, opt.prefix + 'hist-bh.npz') if opt.star != None: starmin, starmax = loadminmax(comm, opt.prefix + 'hist-star.npz') if opt.output != None: mpifile = MPI.File.Open(comm, opt.output, MPI.MODE_WRONLY + MPI.MODE_CREATE) mpifile.Set_view(disp=0, etype=MPI.BYTE, filetype=MPI.BYTE) else: mpifile = None for step in range(steps): ses_step = timer.session("step %d" % step) ses_reading = timer.session('reading') if step < len(stripeids): stripeid = stripeids[step] stripe = Stripe(rank=stripeid, total=opt.total, imagesize=opt.geometry) if stripe.total < 1000: fn = opt.prefix + '%03d.raw' % stripe.rank else: fn = opt.prefix + '%04d.raw' % stripe.rank if mpifile == None and os.path.exists(fn): ses_step.end() continue image = zeros(dtype=('u1', 3), shape=stripe.shape) else: stripe = None
#! python from gaepsi.tools import timer ses_import = timer.session("import extra modules") from optparse import OptionParser, OptionValueError from gaepsi.tools.cmdline import parsearray, parsematrix parser = OptionParser(conflict_handler="resolve") parser.add_option( "-r", "--range", dest="range", type="string", action="callback", callback=parsearray, callback_kwargs=dict(sep=",", dtype="i4", len=2), ) parser.add_option("-r", "--rangefile", dest="rangefile", type="string", help="a file listing file ids to operate") parser.add_option("-s", "--snapname", dest="snapname") parser.add_option("-f", "--format", dest="format", help="the format of the snapshot") parser.add_option( "-z", "--zip", dest="zip", action="store_true", help="save to the gzip format instead of a direct dump(only the raster)", ) parser.add_option( "-g", "--geometry", dest="geometry",