def main(): bundleFilename = sys.argv[1] with benchmark('Loading Bundle from: %s (%dk)'%(bundleFilename, os.path.getsize(bundleFilename)/1000 ) ): bundle = SimMetaDataBundle.load_from_file(bundleFilename) # Load the random number seed if bundle.random_seed is not None: mfrandom.MFRandom.seed(bundle.random_seed) with benchmark('Running simulation'): result = bundle.get_simulation().run(do_spawn=False) result.set_simulation_time(t_start, time.time()) #LogMgr.info("Simulation Ran OK. Post Processing:") with benchmark('Post-processing'): bundle.do_postprocessing_actions()
def main(): bundleFilename = sys.argv[1] with benchmark('Loading Bundle from: %s (%dk)' % (bundleFilename, os.path.getsize(bundleFilename) / 1000)): bundle = SimMetaDataBundle.load_from_file(bundleFilename) # Load the random number seed if bundle.random_seed is not None: mfrandom.MFRandom.seed(bundle.random_seed) with benchmark('Running simulation'): result = bundle.get_simulation().run(do_spawn=False) result.set_simulation_time(t_start, time.time()) #LogMgr.info("Simulation Ran OK. Post Processing:") with benchmark('Post-processing'): bundle.do_postprocessing_actions()
with benchmark('Running simulation'): result = bundle.get_simulation().run(do_spawn=False) result.set_simulation_time(t_start, time.time()) #LogMgr.info("Simulation Ran OK. Post Processing:") with benchmark('Post-processing'): bundle.do_postprocessing_actions() #LogMgr.info("Bundle Completed OK") try: with benchmark('Entire load-run-save time'): main() except: #import traceback traceback.print_exc() print "Simulation Failled" sys.exit(0) print "Suceeded" sys.exit(1)
(bundleFilename, os.path.getsize(bundleFilename) / 1000)): bundle = SimMetaDataBundle.load_from_file(bundleFilename) # Load the random number seed if bundle.random_seed is not None: mfrandom.MFRandom.seed(bundle.random_seed) with benchmark('Running simulation'): result = bundle.get_simulation().run(do_spawn=False) result.set_simulation_time(t_start, time.time()) #LogMgr.info("Simulation Ran OK. Post Processing:") with benchmark('Post-processing'): bundle.do_postprocessing_actions() #LogMgr.info("Bundle Completed OK") try: with benchmark('Entire load-run-save time'): main() except: #import traceback traceback.print_exc() print "Simulation Failled" sys.exit(0) print "Suceeded" sys.exit(1)