def integrated_main(options): TimingServiceLocator() if opts.predict: histm = HistoryManager(**options) evsim = EventSimulator(**options) if opts.bgjob: bqsim = BGQsim(**options) if opts.cjob: cqsim = ClusterQsim(**options) if opts.bgjob and opts.cjob and opts.coscheduling: print "inserting 'unhold' events into event list..." if opts.coscheduling[0] == "hold": evsim.init_unhold_events(0) if opts.coscheduling[1] == "hold": evsim.init_unhold_events(1) if opts.batch: print "simulation started" else: raw_input("Press Enter to start simulation...") starttime_sec = time.time() if opts.batch: while not evsim.is_finished(): evsim.event_driver() else: while not evsim.is_finished(): evsim.event_driver() os.system('clear') if opts.bgjob: bqsim.print_screen() pass if opts.cjob: cqsim.print_screen() pass if opts.bgjob: bqsim.post_simulation_handling() if opts.cjob: cqsim.post_simulation_handling() endtime_sec = time.time() print "----Simulation is finished, please check output log for further analysis.----" print "the simulation lasts %s seconds (~%s minutes)" % (int( endtime_sec - starttime_sec), int((endtime_sec - starttime_sec) / 60))
def integrated_main(options): TimingServiceLocator() if opts.predict: histm = HistoryManager(**options) evsim = EventSimulator(**options) if opts.bgjob: bqsim = BGQsim(**options) if opts.cjob: cqsim = ClusterQsim(**options) if opts.bgjob and opts.cjob and opts.coscheduling: print "inserting 'unhold' events into event list..." if opts.coscheduling[0] == "hold": evsim.init_unhold_events(0) if opts.coscheduling[1] == "hold": evsim.init_unhold_events(1) if opts.batch: print "simulation started" else: raw_input("Press Enter to start simulation...") starttime_sec = time.time() if opts.batch: while not evsim.is_finished(): evsim.event_driver() else: while not evsim.is_finished(): evsim.event_driver() os.system('clear') if opts.bgjob: bqsim.print_screen() pass if opts.cjob: cqsim.print_screen() pass if opts.bgjob: bqsim.post_simulation_handling() if opts.cjob: cqsim.post_simulation_handling() endtime_sec = time.time() print "----Simulation is finished, please check output log for further analysis.----" print "the simulation lasts %s seconds (~%s minutes)" % (int(endtime_sec - starttime_sec), int((endtime_sec - starttime_sec)/60))
def integrated_main(options): TimingServiceLocator() if opts.predict: histm = HistoryManager(**options) evsim = EventSimulator(**options) if opts.bgjob: bqsim = BGQsim(**options) if opts.cjob: cqsim = ClusterQsim(**options) if opts.bgjob and opts.cjob and opts.coscheduling: print "inserting 'unhold' events into event list..." if opts.coscheduling[0] == "hold": evsim.init_unhold_events(0) if opts.coscheduling[1] == "hold": evsim.init_unhold_events(1) if opts.adaptive: print "inserting metrics monitor events into event list..." evsim.init_mmon_events() if opts.batch: print "simulation started" else: raw_input("Press Enter to start simulation...") starttime_sec = time.time() # dwang: if opts.batch: # --> logRec # backf_fname = './_rec_' + options.get( "name") + '/backf_' + options.get("name") + '_' + str( options.get("times")) + '.txt' fp_backf = open(backf_fname, 'w+') # pre_bj_fname = './_rec_' + options.get( "name") + '/preBj_' + options.get("name") + '_' + str( options.get("times")) + '.txt' fp_pre_bj = open(pre_bj_fname, 'w+') while not evsim.is_finished(): # dwang: #evsim.event_driver(opts.preempt_overhead) #evsim.event_driver(opts.preempt_overhead,options.get("name"), options.get("times")) evsim.event_driver(opts.preempt_overhead, fp_backf, fp_pre_bj, options.get("checkpoint"), options.get("checkp_dsize"), options.get("checkp_w_bandwidth"), options.get("checkp_r_bandwidth"), options.get("checkp_t_internval"), options.get("intv_pcent"), options.get("checkpH_opt"), options.get("job_length_type"), options.get("checkp_overhead_percentage")) # dwang else: while not evsim.is_finished(): evsim.event_driver() os.system('clear') if opts.bgjob: bqsim.print_screen() pass if opts.cjob: cqsim.print_screen() pass if opts.bgjob: print "--- test dW-1" bqsim.monitor_metrics() print "--- test dW-2" if opts.bgjob: # dwang: #bqsim.post_simulation_handling() experiment_metrics = bqsim.post_simulation_handling( options.get("name"), options.get("times"), options.get("checkp_t_internval"), options.get("checkp_dsize"), options.get("checkp_w_bandwidth")) # dwang if opts.cjob: cqsim.post_simulation_handling() # dwang endtime_sec = time.time() print "----Simulation is finished, please check output log for further analysis.----" return experiment_metrics