本文整理汇总了Python中dispel4py.workflow_graph.WorkflowGraph.connect方法的典型用法代码示例。如果您正苦于以下问题:Python WorkflowGraph.connect方法的具体用法?Python WorkflowGraph.connect怎么用?Python WorkflowGraph.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dispel4py.workflow_graph.WorkflowGraph
的用法示例。
在下文中一共展示了WorkflowGraph.connect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testIterative
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testIterative():
graph = WorkflowGraph()
prod = TestProducer()
cons = TestIterative()
graph.connect(prod, "output", cons, "input")
results = simple_process.process_and_return(graph, {prod: 25})
tools.eq_({cons.id: {"output": list(range(1, 26))}}, results)
示例2: testConsumer
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testConsumer():
graph = WorkflowGraph()
prod = TestProducer()
cons = PrintDataConsumer()
graph.connect(prod, "output", cons, "input")
results = simple_process.process_and_return(graph, {prod: 10})
tools.eq_({}, results)
示例3: testContinuousReduce
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testContinuousReduce():
prod = NumberProducer()
test = TestPE()
graph = WorkflowGraph()
graph.connect(prod, 'output', test, 'input')
results = simple_process.process_and_return(graph, {prod: 5})
tools.eq_({test.id: {'output': [[0] for i in range(5)]}}, results)
示例4: main
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def main():
if len(sys.argv) < 5:
print "Incorrect arguments provided. Proper format: python tupleCounter.py <inputFile> <numRepeats> <outputFile> <numCores>"
sys.exit()
inputFilename = sys.argv[1]
numRepeats = int(sys.argv[2])
outputFile = sys.argv[3]
numCores = int(sys.argv[4])
producer = TupleProducer(inputFilename, numRepeats)
makeDicts = MakeDict()
collector = CollectCounts(outputFile)
graph = WorkflowGraph()
graph.connect(producer, 'output', makeDicts, 'input')
graph.connect(makeDicts, 'output', collector, 'input')
from dispel4py.new.multi_process import process as multi_process
import argparse
args = argparse.Namespace
args.num = numCores
args.simple = False
multi_process(graph, {producer: 1}, args)
示例5: graph_sum
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def graph_sum():
prod = NumberProducer(1000)
prod.name = 'NumberProducer'
s = parallelSum()
graph = WorkflowGraph()
graph.connect(prod, 'output', s, 'input')
return graph
示例6: esgf_workflow
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def esgf_workflow(source, worker, monitor=None, headers=None):
graph = WorkflowGraph()
# TODO: configure limit
esgsearch = EsgSearch(
url=wps_url(),
search_url=source.get('url', 'https://esgf-data.dkrz.de/esg-search'),
constraints=source.get('constraints', source.get('facets')), # facets for backward compatibility
query=source.get('query'),
limit=source.get('limit', 100),
search_type='File',
distrib=source.get('distrib'),
replica=source.get('replica'),
latest=source.get('latest'),
temporal=source.get('temporal'),
start=source.get('start'),
end=source.get('end'))
esgsearch.set_monitor(monitor, 0, 10)
download = Download(url=wps_url(), headers=headers)
download.set_monitor(monitor, 10, 50)
doit = GenericWPS(headers=headers, **worker)
doit.set_monitor(monitor, 50, 100)
graph.connect(esgsearch, esgsearch.OUTPUT_NAME,
download, download.INPUT_NAME)
graph.connect(download, download.OUTPUT_NAME, doit, doit.INPUT_NAME)
result = simple_process.process(graph, inputs={esgsearch: [{}]})
status_location = result.get((doit.id, doit.STATUS_LOCATION_NAME))[0]
status = result.get((doit.id, doit.STATUS_NAME))[0]
return dict(worker=dict(status_location=status_location, status=status))
示例7: testWriter
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testWriter():
graph = WorkflowGraph()
prod = TestProducer()
cons1 = TestOneInOneOutWriter()
graph.connect(prod, "output", cons1, "input")
results = simple_process.process_and_return(graph, {prod: 5})
tools.eq_({cons1.id: {"output": list(range(1, 6))}}, results)
示例8: test_types
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def test_types():
graph = WorkflowGraph()
prod = TestProducer()
cons = TestOneInOneOut()
graph.connect(prod, "output", cons, "input")
graph.propagate_types()
tools.eq_(prod.outputconnections["output"]["type"], cons.inputconnections["input"]["type"])
示例9: testWordCount
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testWordCount():
prod = RandomWordProducer()
filt = RandomFilter()
count = WordCounter()
graph = WorkflowGraph()
graph.connect(prod, "output", filt, "input")
graph.connect(filt, "output", count, "input")
simple_process.process(graph, inputs={prod: 100})
示例10: testOnetoAll
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testOnetoAll():
graph = WorkflowGraph()
prod = t.TestProducer()
cons = t.TestOneInOneOut()
cons.numprocesses = 2
cons.inputconnections['input']['grouping'] = 'all'
graph.connect(prod, 'output', cons, 'input')
return graph
示例11: parallelAvg
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def parallelAvg(index=0):
composite = WorkflowGraph()
parAvg = AverageParallelPE(index)
reduceAvg = AverageReducePE()
composite.connect(parAvg, parAvg.OUTPUT_NAME, reduceAvg, reduceAvg.INPUT_NAME)
composite.inputmappings = { 'input' : (parAvg, parAvg.INPUT_NAME) }
composite.outputmappings = { 'output' : (reduceAvg, reduceAvg.OUTPUT_NAME) }
return composite
示例12: parallel_aggregate
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def parallel_aggregate(instPE, reducePE):
composite = WorkflowGraph()
reducePE.inputconnections[AggregatePE.INPUT_NAME]['grouping'] = 'global'
reducePE.numprocesses = 1
composite.connect(instPE, AggregatePE.OUTPUT_NAME, reducePE, AggregatePE.INPUT_NAME)
composite.inputmappings = { 'input' : (instPE, AggregatePE.INPUT_NAME) }
composite.outputmappings = { 'output' : (reducePE, AggregatePE.OUTPUT_NAME) }
return composite
示例13: testTee
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testTee():
graph = WorkflowGraph()
prod = TestProducer()
cons1 = TestOneInOneOut()
cons2 = TestOneInOneOut()
graph.connect(prod, 'output', cons1, 'input')
graph.connect(prod, 'output', cons2, 'input')
multiprocess(graph, 3, [{}, {}, {}])
示例14: graph_min_max
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def graph_min_max():
prod = NumberProducer(1000)
mi = parallelMin()
ma = parallelMax()
graph = WorkflowGraph()
graph.connect(prod, 'output', mi, 'input')
graph.connect(prod, 'output', ma, 'input')
return graph
示例15: testWriter
# 需要导入模块: from dispel4py.workflow_graph import WorkflowGraph [as 别名]
# 或者: from dispel4py.workflow_graph.WorkflowGraph import connect [as 别名]
def testWriter():
graph = WorkflowGraph()
prod = TestProducer()
prev = prod
cons1 = TestOneInOneOutWriter()
graph.connect(prod, 'output', cons1, 'input')
results = simple_process.process_and_return(graph, {prod: [{}, {}, {}, {}, {}]})
tools.eq_({ cons1.id : {'output': [1, 2, 3, 4, 5]} }, results)