Skip to content

Commit 9e415d7

Browse files
committed
Merge branch 'master' of bitbucket.org:mpi4py/mpi4py-fft
2 parents 4d0624a + 9b09967 commit 9e415d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mpi4py_fft/fftw/fftw_xfftn.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ cdef class FFT:
149149
knd[i] = kind[i]
150150
self._plan = fftw_planxfftn(ndims, sz_in, _in, sz_out, _out, naxes,
151151
axs, knd, allflags)
152+
if self._plan == NULL:
153+
raise RuntimeError("Failure creating FFTW plan")
152154
free(sz_in)
153155
free(sz_out)
154156
free(axs)
@@ -169,6 +171,7 @@ cdef class FFT:
169171
return self._output_array
170172

171173
def print_plan(self):
174+
assert self._plan != NULL
172175
fftw_print_plan(<fftw_plan>self._plan)
173176

174177
def update_arrays(self, input_array, output_array):
@@ -235,6 +238,7 @@ cdef class FFT:
235238
"""Apply plan with explicit (and safe) update of work arrays"""
236239
if input_array is not None:
237240
self._input_array[...] = input_array
241+
assert self._plan != NULL
238242
with nogil:
239243
fftw_execute(<fftw_plan>self._plan)
240244
if normalize:
@@ -283,6 +287,7 @@ cdef class FFT:
283287

284288
_in = <void *>np.PyArray_DATA(input_array)
285289
_out = <void *>np.PyArray_DATA(output_array)
290+
assert self._plan != NULL
286291
with nogil:
287292
apply_plan(<fftw_plan>self._plan, _in, _out)
288293
if normalize:

0 commit comments

Comments
 (0)