class TestDALiuGEGraph(unittest.TestCase): def setUp(self): self.workflow = Workflow( 'test/data/daliugesample.json', cfg.test_heuristic_data['topcuoglu_graph_system'], calc_time=False) self.dense = Workflow( 'test/data/ggen_out_4-denselu.json', cfg.test_heuristic_data['topcuoglu_graph_system'], calc_time=False) self.gnp = Workflow('test/data/ggen_out_20-0.5.json', cfg.test_heuristic_data['topcuoglu_graph_system'], calc_time=False) def tearDown(self): pass def test_it_works(self): # print(heft(self.workflow)) print(heft(self.dense)) self.dense.pretty_print_allocation() # for p in self.dense.machines: # print(p) # #print(heft(self.gnp)) pass
# import config as cfg from shadow.algorithms.heuristic import heft from shadow.models.workflow import Workflow # This workflow calculates the task time for each resource based on the demand # and supply vectors provided in the 'flop_rep_test.json' fsile. wf = Workflow('topcuoglu.graphml') retval = wf.load_attributes('flop_rep_test.json') print(heft(wf)) wf.pretty_print_allocation() # Original HEFT workflow; task time on reach resource is provided directly by # the .json file. wf = Workflow('topcuoglu.graphml') retval = wf.load_attributes('heft.json',calc_time=False) print(heft(wf)) wf.pretty_print_allocation()