Commit 38cda656 authored by Theo Steininger's avatar Theo Steininger

Added a check and modified tests for 1D mpi-ffts to deal with issues in FFTW:

https://github.com/fredRos/pyFFTW/issues/8
https://github.com/fredRos/pyFFTW/issues/9
parent 3a1a4975
......@@ -373,6 +373,10 @@ class MPIFFT(Transform):
original_shape = inp.shape
inp = inp.reshape(inp.shape[0], 1)
axes = (0, )
if original_shape[0]%2!=0:
raise AttributeError("MPI-FFTs of onedimensional arrays "
"with odd length are currently not supported due to a "
"bug in FFTW. Please use a grid with even length.")
if current_info is None:
transform_shape = list(inp.shape)
......
......@@ -63,7 +63,7 @@ class FFTOperatorTests(unittest.TestCase):
assert_equal(res[zc1 * (dim1 // 2), zc2 * (dim2 // 2)], 0.)
@expand(product(["numpy", "fftw", "fftw_mpi"],
[10, 11], [False, True], [False, True],
[12, ], [False, True], [False, True],
[0.1, 1, 3.7],
[np.float64, np.complex128, np.float32, np.complex64]))
def test_fft1D(self, module, dim1, zc1, zc2, d, itp):
......@@ -86,7 +86,7 @@ class FFTOperatorTests(unittest.TestCase):
rtol=tol, atol=tol)
@expand(product(["numpy", "fftw", "fftw_mpi"],
[10, 11], [9, 12], [False, True],
[12, 15], [9, 12], [False, True],
[False, True], [False, True], [False, True], [0.1, 1, 3.7],
[0.4, 1, 2.7],
[np.float64, np.complex128, np.float32, np.complex64]))
......
......@@ -39,4 +39,7 @@ class SpaceSerializationTests(unittest.TestCase):
repo.commit()
assert_equal(space, repo.get('space'))
assert_equal(field, repo.get('field'))
os.remove('test.h5')
try:
os.remove('test.h5')
except OSError:
pass
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