##// END OF EJS Templates
allow map / parallel function for single-engine views
MinRK -
Show More
@@ -182,6 +182,9 b' class ParallelFunction(RemoteFunction):'
182 # 'all' is lazily evaluated at execution time, which is now:
182 # 'all' is lazily evaluated at execution time, which is now:
183 if targets == 'all':
183 if targets == 'all':
184 targets = client._build_targets(targets)[1]
184 targets = client._build_targets(targets)[1]
185 elif isinstance(targets, int):
186 # single-engine view, targets must be iterable
187 targets = [targets]
185 nparts = len(targets)
188 nparts = len(targets)
186
189
187 msg_ids = []
190 msg_ids = []
@@ -534,4 +534,10 b' class TestView(ClusterTestCase):'
534 echo = lambda x:x
534 echo = lambda x:x
535 self.assertRaisesRemote(NameError, v.apply_sync, echo, r)
535 self.assertRaisesRemote(NameError, v.apply_sync, echo, r)
536
536
537 def test_single_engine_map(self):
538 e0 = self.client[self.client.ids[0]]
539 r = range(5)
540 check = [ -1*i for i in r ]
541 result = e0.map_sync(lambda x: -1*x, r)
542 self.assertEquals(result, check)
537
543
General Comments 0
You need to be logged in to leave comments. Login now