Commit a59d90da authored by Jait Dixit's avatar Jait Dixit
Browse files

Fix issue #61

parent 72fa347b
...@@ -7,7 +7,7 @@ from nifty import LineEnergy ...@@ -7,7 +7,7 @@ from nifty import LineEnergy
class LineSearch(object, Loggable): class LineSearch(object, Loggable):
""" """
Class for finding a step size. Class for finding a step size.
""" """
__metaclass__ = abc.ABCMeta __metaclass__ = abc.ABCMeta
......
...@@ -248,17 +248,15 @@ class FFTW(Transform): ...@@ -248,17 +248,15 @@ class FFTW(Transform):
# val must be numpy array or d2o with slicing distributor # val must be numpy array or d2o with slicing distributor
### ###
local_offset_Q = False
try: try:
local_val = val.get_local_data(copy=False) local_val = val.get_local_data(copy=False)
if axes is None or 0 in axes:
local_offset_Q = val.distributor.local_shape[0] % 2
except(AttributeError): except(AttributeError):
local_val = val local_val = val
current_info = self._get_transform_info(self.domain, current_info = self._get_transform_info(self.domain,
self.codomain, self.codomain,
local_shape=local_val.shape, local_shape=local_val.shape,
local_offset_Q=local_offset_Q, local_offset_Q=False,
is_local=True, is_local=True,
**kwargs) **kwargs)
...@@ -309,14 +307,10 @@ class FFTW(Transform): ...@@ -309,14 +307,10 @@ class FFTW(Transform):
def _mpi_transform(self, val, axes, **kwargs): def _mpi_transform(self, val, axes, **kwargs):
if axes is None or 0 in axes: local_offset_list = np.cumsum(
local_offset_list = np.cumsum( np.concatenate([[0, ], val.distributor.all_local_slices[:, 2]])
np.concatenate([[0, ], val.distributor.all_local_slices[:, 2]]) )
) local_offset_Q = bool(local_offset_list[val.distributor.comm.rank] % 2)
local_offset_Q = bool(
local_offset_list[val.distributor.comm.rank] % 2)
else:
local_offset_Q = False
return_val = val.copy_empty(global_shape=val.shape, return_val = val.copy_empty(global_shape=val.shape,
dtype=self.codomain.dtype) dtype=self.codomain.dtype)
......
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