Пример #1
0
def wrap():
    ##Preparing
    ut = Utility()

    wf_name = 'Montage_25'
    dax1 = os.path.join(RESOURCES_PATH,  wf_name + '.xml')
    #dax2 = '..\\resources\\CyberShake_30.xml'

    wf_start_id_1 = "00"
    task_postfix_id_1 = "00"

    wf_start_id_2 = "10"
    task_postfix_id_2 = "10"

    deadline_1 = 1000
    deadline_2 = 3000

    pipeline_1 = ut.generateUrgentPipeline(dax1,
                                           wf_name,
                                           wf_start_id_1,
                                           task_postfix_id_1,
                                           deadline_1)

    ##pipeline_2 = ut.generateUrgentPipeline(dax2,
    ##                                       wf_start_id_2,
    ##                                       task_postfix_id_2,
    ##                                       deadline_2)
    common_pipeline = pipeline_1 ## + pipeline_2

    rgen = ResourceGenerator()
    resources = rgen.generate()
    transferMx = rgen.generateTransferMatrix(resources)

    estimator = ExperimentEstimator(transferMx, 20)

    planner = StaticHeftPlanner()
    planner.estimator = estimator
    planner.resource_manager = ExperimentResourceManager(resources)
    planner.workflows = common_pipeline

    schedule = planner.schedule()

    print("planner.global_count: " + str(planner.global_count))
Пример #2
0
    def _construct_environment(self, *args, **kwargs):
        wf_name = kwargs["wf_name"]
        nodes_conf = kwargs.get("nodes_conf", None)
        ideal_flops = kwargs.get("ideal_flops", 20)
        transfer_time = kwargs.get("transfer_time", 100)
        bandwidth = float(kwargs.get("data_intensive_coeff", 100))
        max_size = float(kwargs.get("max_size", 100))

        # dax1 = '../../resources/' + wf_name + '.xml'
        # wf = Utility.readWorkflow(dax1, wf_name)

        _wf = wf(wf_name)

        rgen = ResourceGenerator(min_res_count=1,
                                 max_res_count=1,
                                 min_node_count=4,
                                 max_node_count=4,
                                 min_flops=5,
                                 max_flops=10)
        resources = rgen.generate()
        transferMx = rgen.generateTransferMatrix(resources)

        if nodes_conf is None:
            bundle = Utility.get_default_bundle()
            resources = bundle.dedicated_resources
            transferMx = bundle.transfer_mx
            ideal_flops = bundle.ideal_flops
            ##TODO: end
        else:
            ## TODO: refactor it later.
            resources = ResourceGenerator.r(nodes_conf)
            transferMx = rgen.generateTransferMatrix(resources)
            ##
        estimator = TestEstimator(comp_time_cost=0, transf_time_cost=0, bandwidth=bandwidth, transferMx=None,
                                    ideal_flops=ideal_flops,
                                    transfer_time=transfer_time,
                                    max_size=max_size)
        resource_manager = ExperimentResourceManager(resources)
        return (_wf, resource_manager, estimator)
Пример #3
0
    def _construct_environment(self, *args, **kwargs):
        wf_name = kwargs["wf_name"]
        nodes_conf = kwargs.get("nodes_conf", None)
        ideal_flops = kwargs.get("ideal_flops", 20)
        transfer_time = kwargs.get("transfer_time", 100)

        # dax1 = '../../resources/' + wf_name + '.xml'
        # wf = Utility.readWorkflow(dax1, wf_name)

        _wf = wf(wf_name)

        rgen = ResourceGenerator(min_res_count=1,
                                 max_res_count=1,
                                 min_node_count=4,
                                 max_node_count=4,
                                 min_flops=5,
                                 max_flops=10)
        resources = rgen.generate()
        transferMx = rgen.generateTransferMatrix(resources)

        if nodes_conf is None:
            bundle = Utility.get_default_bundle()
            resources = bundle.dedicated_resources
            transferMx = bundle.transfer_mx
            ideal_flops = bundle.ideal_flops
            ##TODO: end
        else:
            ## TODO: refactor it later.
            resources = ResourceGenerator.r(nodes_conf)
            transferMx = rgen.generateTransferMatrix(resources)
            ##

        estimator = ExperimentEstimator(transferMx, ideal_flops, dict(),
                                        transfer_time)
        resource_manager = ExperimentResourceManager(resources)
        return (_wf, resource_manager, estimator)