Commit 10e11a0a authored by Ultima's avatar Ultima
Browse files

Test Suite coverage now at 88%.

-> Many bugfixes and refactorings.
parent d31b3ce6
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
""" """
from __future__ import division from __future__ import division
from nifty import * # version 0.8.0 from nifty import * # version 0.8.0
about.warnings.off() about.warnings.on()
# some signal space; e.g., a two-dimensional regular grid # some signal space; e.g., a two-dimensional regular grid
x_space = rg_space([1280, 1280], datamodel = 'd2o') # define signal space x_space = rg_space([1280, 1280], datamodel = 'd2o') # define signal space
......
...@@ -24,7 +24,7 @@ class _COMM_WORLD(): ...@@ -24,7 +24,7 @@ class _COMM_WORLD():
def Get_size(self): def Get_size(self):
return self.size return self.size
def _scattergather_helper(self, sendbuf, recvbuf=None): def _scattergather_helper(self, sendbuf, recvbuf=None, **kwargs):
sendbuf = self._unwrapper(sendbuf) sendbuf = self._unwrapper(sendbuf)
recvbuf = self._unwrapper(recvbuf) recvbuf = self._unwrapper(recvbuf)
if recvbuf != None: if recvbuf != None:
...@@ -68,13 +68,16 @@ class _COMM_WORLD(): ...@@ -68,13 +68,16 @@ class _COMM_WORLD():
return self._scattergather_helper(*args, **kwargs) return self._scattergather_helper(*args, **kwargs)
def Allreduce(self, sendbuf, recvbuf, op, **kwargs): def Allreduce(self, sendbuf, recvbuf, op, **kwargs):
recvbuf[None] = op(sendbuf) recvbuf[:] = op(sendbuf)
return recvbuf return recvbuf
def allreduce(self, sendbuf, recvbuf, op, **kwargs): def allreduce(self, sendbuf, recvbuf, op, **kwargs):
recvbuf[None] = op(sendbuf) recvbuf[:] = op(sendbuf)
return recvbuf return recvbuf
def sendrecv(self, sendobj, **kwargs):
return sendobj
def _unwrapper(self, x): def _unwrapper(self, x):
if isinstance(x, list): if isinstance(x, list):
return x[0] return x[0]
......
...@@ -1221,10 +1221,10 @@ class point_space(space): ...@@ -1221,10 +1221,10 @@ class point_space(space):
"mean" : lambda y: getattr(y, 'mean')(), "mean" : lambda y: getattr(y, 'mean')(),
"std" : lambda y: getattr(y, 'std')(), "std" : lambda y: getattr(y, 'std')(),
"var" : lambda y: getattr(y, 'var')(), "var" : lambda y: getattr(y, 'var')(),
"argmin" : lambda y: getattr(y, 'argmin')(), "argmin" : lambda y: getattr(y, 'argmin_nonflat')(),
"argmin_flat" : lambda y: getattr(y, 'argmin_flat')(), "argmin_flat" : lambda y: getattr(y, 'argmin')(),
"argmax" : lambda y: getattr(y, 'argmax')(), "argmax" : lambda y: getattr(y, 'argmax_nonflat')(),
"argmax_flat" : lambda y: getattr(y, 'argmax_flat')(), "argmax_flat" : lambda y: getattr(y, 'argmax')(),
"conjugate" : lambda y: getattr(y, 'conjugate')(), "conjugate" : lambda y: getattr(y, 'conjugate')(),
"sum" : lambda y: getattr(y, 'sum')(), "sum" : lambda y: getattr(y, 'sum')(),
"prod" : lambda y: getattr(y, 'prod')(), "prod" : lambda y: getattr(y, 'prod')(),
......
This diff is collapsed.
...@@ -2539,7 +2539,7 @@ class projection_operator(operator): ...@@ -2539,7 +2539,7 @@ class projection_operator(operator):
## build indexing ## build indexing
self.ind = self.domain.unary_operation(self.assign, op='unique') self.ind = self.domain.unary_operation(self.assign, op='unique')
self.sym = True self.sym = True
self.uni = False self.uni = False
self.imp = True self.imp = True
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment