def __init__(self, reliability, n=100): self.reliability = reliability ##TODO: simplify this # self.mainHeft = HeftExecutorRunner().main self.mainHeft = ExecutorsFactory.default().run_heft_executor # self.mainCloudHeft = CloudHeftExecutorRunner().main self.mainCloudHeft = ExecutorsFactory.default().run_cloudheft_executor self.n = n
def decoratee(tsk): res = ExecutorsFactory.default().run_mpgaheftoldpop_executor( # for this experiment it doesn't matter at all reliability=0.95, is_silent=True, wf_name=wf_name, logger=None, key_for_save='small_run', #task_id_to_fail="ID00005_000", task_id_to_fail=tsk, fixed_interval_for_ga=15, migrCount=5, emigrant_selection=None, all_iters_count=300, merged_pop_iters=100, ga_params={ "population": pop_size, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }, save_path=save_path, check_evolution_for_stopping=False, mixed_init_pop=False, mpnewVSmpoldmode=True) return res
def setUp(self): all_iters_count = 30 self.mixed_mpgaheftoldpop_func = partial( ExecutorsFactory.default().run_mpgaheftoldpop_executor, # for this experiment it doesn't matter at all reliability=self.RELIABLE, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='small_run', #task_id_to_fail="ID00005_000", #task_id_to_fail=tsk, #save_path=, fixed_interval_for_ga=15, migrCount=5, emigrant_selection=None, all_iters_count=all_iters_count, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 5 }, mixed_init_pop=True) def check_logbook(x): #all_iters = [i for i in range(0, all_iters_count)] for rec in x: assert "iter" in rec, "iter isn't presented in record" assert "worst" in rec, "worst isn't presented for iter {0}".format( rec["iter"]) assert "best" in rec, "best isn't presented for iter {0}".format( rec["iter"]) assert "avr" in rec, "avr isn't presented for iter {0}".format( rec["iter"]) #all_iters.remove(rec["iter"]) pass #assert len(all_iters) == 0, "Next iters wasn't be founded in results: {0}".format(all_iters) return True run_spec = { "iter": lambda x: x is None or x < all_iters_count, "makespan": lambda x: True, "pop_aggr": check_logbook } self.stat_specification = { "wf_name": lambda x: x == self.DEFAULT_WF_NAME, "event_name": lambda x: x == "NodeUp" or x == "NodeFailed" or x == "", # p for param "task_id": lambda x: len(x) > 0, "with_old_pop": run_spec, "with_random": run_spec } pass
def setUp(self): all_iters_count = 30 self.mixed_mpgaheftoldpop_func = partial(ExecutorsFactory.default().run_mpgaheftoldpop_executor, # for this experiment it doesn't matter at all reliability=self.RELIABLE, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='small_run', #task_id_to_fail="ID00005_000", #task_id_to_fail=tsk, #save_path=, fixed_interval_for_ga=15, migrCount=5, emigrant_selection=None, all_iters_count=all_iters_count, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 5 }, mixed_init_pop=True) def check_logbook(x): #all_iters = [i for i in range(0, all_iters_count)] for rec in x: assert "iter" in rec, "iter isn't presented in record" assert "worst" in rec, "worst isn't presented for iter {0}".format(rec["iter"]) assert "best" in rec, "best isn't presented for iter {0}".format(rec["iter"]) assert "avr" in rec, "avr isn't presented for iter {0}".format(rec["iter"]) #all_iters.remove(rec["iter"]) pass #assert len(all_iters) == 0, "Next iters wasn't be founded in results: {0}".format(all_iters) return True run_spec = { "iter": lambda x: x is None or x < all_iters_count, "makespan": lambda x: True, "pop_aggr": check_logbook } self.stat_specification = { "wf_name": lambda x: x == self.DEFAULT_WF_NAME, "event_name": lambda x: x == "NodeUp" or x == "NodeFailed" or x == "", # p for param "task_id": lambda x: len(x) > 0, "with_old_pop": run_spec, "with_random": run_spec } pass
def fnc(tsk): return ExecutorsFactory.default().run_gaheftoldpop_executor( reliability=0.95, is_silent=True, wf_name=wf_name, logger=None, key_for_save='small_run', #task_id_to_fail="ID00005_000", task_id_to_fail=tsk, fixed_interval_for_ga=6, save_path=save_path, ga_params={ "population": 30, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 100 }, check_evolution_for_stopping=False, nodes_conf=[10, 15, 25, 30] + [10, 15, 25, 30])
def decoratee(tsk): res = ExecutorsFactory.default().run_oldpop_executor( # for this experiment it doesn't matter at all reliability=0.95, is_silent=True, wf_name=wf_name, logger=None, key_for_save='small_run', task_id_to_fail=tsk, fixed_interval_for_ga=6, ga_params={ "population": pop_size, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 100 }, save_path=save_path, check_evolution_for_stopping=False, nodes_conf=[10, 15, 25, 30] + [10, 15, 25, 30]) return res
def decoratee(fl_percent): res = ExecutorsFactory.default().run_oldpop_executor_with_weakestfailonce( # for this experiment it doesn't matter at all reliability=0.95, is_silent=True, wf_name=wf_name, logger=None, key_for_save='small_run', # it doesn't matter at all for this experiment task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": pop_size, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }, fail_percent=fl_percent, save_path=save_path, check_evolution_for_stopping=False) return res
def decoratee(fl_percent): res = ExecutorsFactory.default( ).run_oldpop_executor_with_weakestfailonce( # for this experiment it doesn't matter at all reliability=0.95, is_silent=True, wf_name=wf_name, logger=None, key_for_save='small_run', # it doesn't matter at all for this experiment task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": pop_size, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }, fail_percent=fl_percent, save_path=save_path, check_evolution_for_stopping=False) return res
def __init__(self, n=25, time_koeff=0.1): self.mainHeft = ExecutorsFactory.default().run_heft_executor self.mainGaHeft = ExecutorsFactory.default().run_gaheft_executor self.n = n self.time_koeff = time_koeff
def __init__(self, reliability, n=100): self.reliability = reliability self.mainCloudHeft = ExecutorsFactory.default().run_cloudheft_executor self.mainHeft = ExecutorsFactory.default().run_heft_executor self.mainGA = ExecutorsFactory.default().run_ga_executor self.n = n
def __init__(self, reliability, n=25): self.reliability = reliability self.mainHeft = ExecutorsFactory.default().run_heft_executor self.mainGaHeft = ExecutorsFactory.default().run_gaheft_executor self.n = n
def setUp(self): self.ga_func = partial(ExecutorsFactory.default().run_ga_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, with_ga_initial=True) self.heft_func = partial(ExecutorsFactory.default().run_heft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None) self.gaheft_func = partial( ExecutorsFactory.default().run_gaheft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.cloudheft_func = partial( ExecutorsFactory.default().run_cloudheft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, ) self.oldpopga_func = partial( ExecutorsFactory.default().run_oldpop_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='by_5', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.oldpopgaheft_func = partial( ExecutorsFactory.default().run_gaheftoldpop_executor, is_silent=False, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.oldpopmpgaheft_func = partial( ExecutorsFactory.default().run_mpgaheftoldpop_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, migrCount=5, emigrant_selection=None, all_iters_count=10, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 2 }) self.oldpopmpgaheft_mixed_init_pop_func = partial( self.oldpopmpgaheft_func, mixed_init_pop=True) self.oldpopmpgaheft_with_merge_pop_func = partial( self.oldpopmpgaheft_func, merged_pop_iters=2) self.oldpopmpgaheft_vs_mpgaheft_func = partial( self.oldpopmpgaheft_func, mpnewVSmpoldmode=True) self.oldpopga_with_weakestfailonce_func = partial( ExecutorsFactory.default( ).run_oldpop_executor_with_weakestfailonce, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) pass
heft_path = base_dir + "[{0}]_[{1}]_[{2}].txt".format(wf_name, heft_name, ComparisonUtility.cur_time()) heft_f = open(heft_path, "w") heft_f.write("alg_name: " + heft_name + "\n") heft_f.write("wf_name: " + str(wf_name) + "\n") # gaheft_name = "GAHEFT" # gaheft_path = base_dir + "[{0}]_[{1}]_[{2}].txt".format(wf_name, gaheft_name, ComparisonUtility.cur_time()) # gaheft_f = open(gaheft_path, "w") # gaheft_f.write("alg_name: " + gaheft_name + "\n") # gaheft_f.write("wf_name: " + str(wf_name) + "\n") n = 20 # ## reliability 0.95 doesn't matter anything in this case# for id in ids[6:7]: failure_coeffs = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8] ## reliability 0.95 doesn't matter anything in this case heft_makespans = [ExecutorsFactory.default().run_singlefail_heft_executor(0.95, True, wf_name, None, ids[6], coeff) for coeff in failure_coeffs] save_result(heft_f, heft_makespans, id) # heft_makespans = [SingleFailHeftExecutorExample().main(0.95, True, wf_name, None, id) for i in range(n)] # save_result(heft_f, heft_makespans, id) # # # gaheft_makespans = [SingleFailGaHeftExecutorExample().main(0.95, True, wf_name, None, id) for i in range(n)] # # save_result(gaheft_f, gaheft_makespans, id) # pass heft_f.close() # gaheft_f.close()
heft_f = open(heft_path, "w") heft_f.write("alg_name: " + heft_name + "\n") heft_f.write("wf_name: " + str(wf_name) + "\n") # gaheft_name = "GAHEFT" # gaheft_path = base_dir + "[{0}]_[{1}]_[{2}].txt".format(wf_name, gaheft_name, ComparisonUtility.cur_time()) # gaheft_f = open(gaheft_path, "w") # gaheft_f.write("alg_name: " + gaheft_name + "\n") # gaheft_f.write("wf_name: " + str(wf_name) + "\n") n = 20 # ## reliability 0.95 doesn't matter anything in this case# for id in ids[6:7]: failure_coeffs = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8] ## reliability 0.95 doesn't matter anything in this case heft_makespans = [ ExecutorsFactory.default().run_singlefail_heft_executor( 0.95, True, wf_name, None, ids[6], coeff) for coeff in failure_coeffs ] save_result(heft_f, heft_makespans, id) # heft_makespans = [SingleFailHeftExecutorExample().main(0.95, True, wf_name, None, id) for i in range(n)] # save_result(heft_f, heft_makespans, id) # # # gaheft_makespans = [SingleFailGaHeftExecutorExample().main(0.95, True, wf_name, None, id) for i in range(n)] # # save_result(gaheft_f, gaheft_makespans, id) # pass heft_f.close() # gaheft_f.close()
def setUp(self): self.ga_func = partial(ExecutorsFactory.default().run_ga_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, with_ga_initial=True) self.heft_func = partial(ExecutorsFactory.default().run_heft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None) self.gaheft_func = partial(ExecutorsFactory.default().run_gaheft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.cloudheft_func = partial(ExecutorsFactory.default().run_cloudheft_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None,) self.oldpopga_func = partial(ExecutorsFactory.default().run_oldpop_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='by_5', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.oldpopgaheft_func = partial(ExecutorsFactory.default().run_gaheftoldpop_executor, is_silent=False, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 }) self.oldpopmpgaheft_func = partial(ExecutorsFactory.default().run_mpgaheftoldpop_executor, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, migrCount=5, emigrant_selection=None, all_iters_count=10, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 2 }) self.oldpopmpgaheft_mixed_init_pop_func = partial(self.oldpopmpgaheft_func, mixed_init_pop=True) self.oldpopmpgaheft_with_merge_pop_func = partial(self.oldpopmpgaheft_func, merged_pop_iters=2) self.oldpopmpgaheft_vs_mpgaheft_func = partial(self.oldpopmpgaheft_func, mpnewVSmpoldmode=True) self.oldpopga_with_weakestfailonce_func = partial(ExecutorsFactory.default().run_oldpop_executor_with_weakestfailonce, is_silent=True, wf_name=self.DEFAULT_WF_NAME, logger=None, key_for_save='test', task_id_to_fail="ID00005_000", fixed_interval_for_ga=15, ga_params={ "population": 10, "crossover_probability": 0.8, "replacing_mutation_probability": 0.5, "sweep_mutation_probability": 0.4, "generations": 10 } ) pass