Esempio n. 1
0
 def setUp(self):
     self.wf = Workflow("{0}/{1}".format(
         current_dir, cfg.test_metaheuristic_data['topcuoglu_graph']))
     env = Environment("{0}/{1}".format(
         current_dir, cfg.test_metaheuristic_data['graph_sys_with_costs']))
     self.wf.add_environment(env)
     self.rng = np.random.default_rng(40)
Esempio n. 2
0
def run_algorithm(arg, parser):
    if arg['algorithm'] == 'heft':
        pass
        wf = Workflow(arg['workflow'])
        env = Environment(arg['environment'])
        wf.add_environment(env)
        print(heft(wf))
        print(wf.machine_alloc)
Esempio n. 3
0
 def test_large_workflow(self):
     self.workflow = Workflow(
         "/home/rwb/Dropbox/PhD/writeups/observation_graph-model/json/3000Node.json"
     )
     env = Environment(
         "/home/rwb/Dropbox/PhD/writeups/observation_graph-model/json/3000Node_sys.json"
     )
     self.workflow.add_environment(env)
     heft(self.workflow)
Esempio n. 4
0
    def setUp(self):
        self.workflow = Workflow("{0}/{1}".format(
            current_dir, cfg.test_workflow_data['topcuoglu_graph']))
        env = Environment("{0}/{1}".format(
            current_dir, cfg.test_workflow_data['topcuoglu_graph_system']))

        # self.workflow = Workfow(cfg.test_heuristic_data['topcuoglu_graph'],
        # cfg.test_heuristic_data['topcuoglu_graph_system'])

        self.workflow.add_environment(env)
Esempio n. 5
0
# Copyright (C) 26/6/20 RW Bunney

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
from shadow.models.workflow import Workflow
from shadow.models.environment import Environment
import shadow.visualiser.graph as sgraph
from IPython.display import Image

workflow_file = 'TestAskapCont_channels-10_shadow.json'
sys = 'final_heft_sys.json'
workflow = Workflow(workflow_file)
env = Environment(sys)
workflow.add_environment(env)

# png = sgraph.visualise_graph(workflow, workflow_file.strip('.json')+'.png')

graphviz = sgraph.convert_to_graphviz(workflow)
graphviz.render('output.gz')
Esempio n. 6
0
from queue import Queue
from shadow.algorithms.heuristic import heft

from shadow.models.workflow import Workflow, Task
from shadow.models.environment import Environment

HEFTWorkflow = Workflow('heft.json')
env = Environment('sys.json')
HEFTWorkflow.add_environment(env)

print(heft(HEFTWorkflow))

DelayWorkflow = Workflow('heft_delay.json')
DelayWorkflow.add_environment(env)
print(heft(DelayWorkflow))


def calc_task_delay(task, delay, workflow):
    t = workflow.graph.tasks[task]
    aft = t.aft
    update_list = list(workflow.graph.successors(t))
    # add 10 to the start and finish time of each of these successors, and their successors
    update_queue = Queue()
    update_queue.put(update_list)
    print(update_queue)
    return workflow


task = HEFTWorkflow.tasks[0]
calc_task_delay(task, 10, workflow=HEFTWorkflow)
Esempio n. 7
0
# Copyright (C) 17/6/20 RW Bunney

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# This is adapted and expanded upon in the shadowgen.ipynb notebook

from shadow.models.workflow import Workflow
from shadow.models.environment import Environment
import shadow.algorithms.heuristic as heuristic

workflow = Workflow('dax_files/output/shadow_Epigenomics_24.json')
env = Environment('environments/sys.json')
workflow.add_environment(env)
heuristic.heft(workflow)
Esempio n. 8
0
from shadow.algorithms.heuristic import heft

from shadow.models.workflow import Workflow
from shadow.models.environment import Environment

from shadow.visualiser.plot import AllocationPlot
import matplotlib.pyplot as plt
from test import config

HEFTWorkflow = Workflow(config.test_heuristic_data['topcuoglu_graph'])
env = Environment(config.test_heuristic_data['topcuoglu_graph_system'])
HEFTWorkflow.add_environment(env)
heft(HEFTWorkflow)

sample_allocation = AllocationPlot(solution=HEFTWorkflow.solution)
fig, ax = sample_allocation.plot()
plt.show()
Esempio n. 9
0
 def setUp(self):
     self.workflow = Workflow(cfg.test_heuristic_data['pheft_graph'])
     env = Environment(cfg.test_workflow_data['topcuoglu_graph_system'])
     self.workflow.add_environment(env)
     self.up_oct_rank_values = [72, 41, 37, 43, 31, 41, 17, 20, 16, 0]
     self.up_rank_values = [169, 114, 102, 110, 129, 119, 52, 92, 42, 20]
Esempio n. 10
0
    return heft(workflow)


if __name__ == '__main__':

    output_dir_path = Path(f"notebooks/sdp_comparison/output")
    if not output_dir_path.exists():
        raise RuntimeError(f"{output_dir_path} does not exist!")

    config_path = output_dir_path / "shadow_config.json"

    wfs = []
    for wf_path in (output_dir_path / "workflows").iterdir():
        wfs.append(Workflow(wf_path))

    env = Environment(config_path)
    environs = [deepcopy(env) for i in range(3)]

    params = list(zip(wfs, environs))
    start = time.time()

    with Pool(processes=4) as pool:
        result = pool.starmap(run_workflow, params)
    finish = time.time()
    print(f"{finish-start=}")

    # start = time.time()
    # for x in range(3):
    #     workflow = Workflow("/home/rwb/github/thesis_experiments/skaworkflows_tests"
    #                  "/workflows/hpso01_time-3600_channels-256_tel-512.json")
    #     workflow.add_environment(env)
Esempio n. 11
0
"""

import pandas as pd
import seaborn as sns

from shadow.models.workflow import Workflow
from shadow.models.environment import Environment
from shadow.algorithms.heuristic import heft, fcfs

# df = pd.DataFrame(columns=["time", "channels", "algorithm", "diff"])
df = pd.DataFrame()
WORKFLOW = "routput/shadow_Continuum_ChannelSplit_10.json"
CLUSTER = "routput/system_spec_40_200-400_1.0"

wf_fcfs = Workflow(WORKFLOW)
env_fcfs = Environment(CLUSTER)
wf_fcfs.add_environment(env_fcfs)
soln = fcfs(wf_fcfs)
seq = -1

#
# for p in range(len(self.processors)):
#     comp = 0
#     for task in list(self.graph.nodes()):
#         comp = comp + self.comp_matrix[task.tid][p]
#     if (seq is -1) or (comp < seq):
#         seq = comp

for x in range(10, 100, 10):
    print("Scheduling {0} Channels".format(x))
    WORKFLOW = "routput/shadow_Continuum_ChannelSplit_{0}.json".format(x)
Esempio n. 12
0
	def setUp(self):
		self.wf = Workflow("{0}/{1}".format(current_dir, cfg.test_workflow_data['topcuoglu_graph']))
		self.env = Environment("{0}/{1}".format(current_dir, cfg.test_workflow_data['topcuoglu_graph_system']))
Esempio n. 13
0
 def setUp(self) -> None:
     print(os.listdir('.'))
     self.env = Environment(test_environment_data['environment_sys'])
     pass