def getPieceProducer(): producer = Renascence.init(["./libAbstract_learning.xml"]) print producer p_producer = Renascence.PieceFunctionProducer(producer, ['./parallel.xml'], ['Map-Reduce.xml']) print p_producer sub_p_producer = Renascence.PieceFunctionProducerParallel( p_producer, 'server') return sub_p_producer
def main(): Renascence.setStreamPath("./") Renascence.setLibPath("./") producer = Renascence.init(["func.xml"]) p_producer = Renascence.PieceFunctionProducer(producer, ['parallel.xml'], ['Map-Reduce.xml']) print p_producer.listType() sub_p_producer = Renascence.PieceFunctionProducerParallel(p_producer, 'server') print "sub_p_producer created" pfunction = sub_p_producer.createFunction('C(S(x0))', 'TrBmp') inputPieces = sub_p_producer.createInput('deps/Renascence/res/pictures/', 'TrBmp', [5]) tempPiece = pfunction.run([inputPieces]) outputPieces = sub_p_producer.createOutput('output/pythonTestParallel') sub_p_producer.copyPiece(tempPiece, outputPieces)
def main(): Renascence.setStreamPath("./") Renascence.setLibPath("./") producer = Renascence.init(["func.xml"]) p_producer = Renascence.PieceFunctionProducer(producer, ['mgpfunc.xml'], ['Map-Reduce.xml']) print p_producer.listType() sub_p_producer = Renascence.PieceFunctionProducerParallel(p_producer, 'thread') pfunction = sub_p_producer.createFunction('C(S(x0))', 'TrBmp') inputPieces = sub_p_producer.createInput('res/pictures/', 'TrBmp', [5]) outputPieces = sub_p_producer.createOutput('output/pythonTestParallel') tempPiece = pfunction.run([inputPieces]) sub_p_producer.copyPiece(tempPiece, outputPieces) input1 = inputPieces.read('0') input1.save('output/pythonTestParallel/input.jpg') tempPiece.write(input1, '0') print input1