本文整理汇总了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
示例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
示例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
示例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)