Example #1
0
 def setUp(self):
     config = pywren.wrenconfig.default()
     self.aws_region = config['account']['aws_region']
     self.wrenexec = pywren.remote_executor()
import pywren

if __name__ == "__main__":

    lambda_exec = pywren.lambda_executor()
    remote_exec = pywren.remote_executor()

    def increment(x):
        return x + 1

    x = [1, 2, 3, 4]
    futures = lambda_exec.map(increment, x)

    def reduce_func(x):
        return sum(x)

    reduce_future = remote_exec.reduce(reduce_func, futures)
    print reduce_future.result()
Example #3
0
 def setUp(self):
     self.lambda_exec = pywren.lambda_executor()
     self.remote_exec = pywren.remote_executor()
Example #4
0
 def setUp(self):
     self.wrenexec = pywren.remote_executor()