当前位置: 首页>>代码示例>>Python>>正文


Python WorkflowGraph.partitions方法代码示例

本文整理汇总了Python中dispel4py.workflow_graph.WorkflowGraph.partitions方法的典型用法代码示例。如果您正苦于以下问题:Python WorkflowGraph.partitions方法的具体用法?Python WorkflowGraph.partitions怎么用?Python WorkflowGraph.partitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dispel4py.workflow_graph.WorkflowGraph的用法示例。


在下文中一共展示了WorkflowGraph.partitions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testGrouping

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import partitions [as 别名]
def testGrouping():
    '''
    Creates the test graph.
    '''
    words = t.RandomWordProducer()
    cons1 = t.TestOneInOneOut()
    cons2 = t.TestOneInOneOut()
    cons3 = t.TestOneInOneOut()
    count = t.WordCounter()
    graph = WorkflowGraph()
    graph.connect(words, 'output', cons1, 'input')
    graph.connect(cons1, 'output', cons2, 'input')
    graph.connect(cons2, 'output', cons3, 'input')
    graph.connect(cons3, 'output', count, 'input')

    graph.partitions = [ [words], [cons1, cons2, cons3], [count] ]
    return graph
开发者ID:Ravanon,项目名称:dispel4py,代码行数:19,代码来源:group_by.py

示例2: testParallelPipeline

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import partitions [as 别名]
def testParallelPipeline():
    """
    Creates the parallel pipeline graph with partitioning information.

    :rtype: the created graph
    """
    graph = WorkflowGraph()
    prod = t.TestProducer()
    cons1 = t.TestOneInOneOut()
    cons2 = t.TestOneInOneOut()
    cons3 = t.TestOneInOneOut()

    graph.connect(prod, "output", cons1, "input")
    graph.connect(cons1, "output", cons2, "input")
    graph.connect(cons1, "output", cons3, "input")

    graph.partitions = [[prod, cons1, cons2], [cons3]]

    return graph
开发者ID:anqilu,项目名称:dispel4py,代码行数:21,代码来源:partition_parallel_pipeline.py

示例3: testParallelPipeline

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import partitions [as 别名]
def testParallelPipeline():
    '''
    Creates the parallel pipeline graph with partitioning information.
    
    :rtype: the created graph
    '''
    graph = WorkflowGraph()
    prod = t.TestProducer()
    prev = prod
    cons1 = t.TestOneInOneOut()
    cons2 = t.TestOneInOneOut()
    cons3 = t.TestOneInOneOut()

    graph.connect(prod, 'output', cons1, 'input')
    graph.connect(cons1, 'output', cons2, 'input')
    graph.connect(cons1, 'output', cons3, 'input')

    graph.partitions = [ [prod, cons1, cons2], [cons3] ]

    return graph
开发者ID:andrejsim,项目名称:dispel4py,代码行数:22,代码来源:partition_parallel_pipeline.py

示例4: TestProducer

# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import partitions [as 别名]
import processor
from dispel4py.workflow_graph import WorkflowGraph
from dispel4py.examples.graph_testing.testing_PEs import TestProducer, TestOneInOneOut


prod = TestProducer()
cons1 = TestOneInOneOut()
cons2 = TestOneInOneOut()
    
graph = WorkflowGraph()
graph.connect(prod, 'output', cons1, 'input')
graph.connect(cons1, 'output', cons2, 'input')

graph.partitions= [ [prod], [cons1, cons2]]

ubergraph = processor.create_partitioned(graph)
processes, inputmappings, outputmappings = processor.assign_and_connect(ubergraph, 2)
print processes
print inputmappings
print outputmappings

import multi_process

inputs= { prod : [{}] }
mapped_inputs=processor.map_inputs_to_partitions(ubergraph, inputs)
print 'MAPPED INPUTS: %s' % mapped_inputs
multi_process.process(ubergraph, 2, inputs = mapped_inputs)
开发者ID:KNMI,项目名称:wps_workflow,代码行数:29,代码来源:partitioned_test.py


注:本文中的dispel4py.workflow_graph.WorkflowGraph.partitions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。