Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
74312e64
Commit
74312e64
authored
Jul 29, 2017
by
Theo Steininger
Browse files
Trying to adapt to the now stricter checks by pyfftw.
parent
7b2afe4d
Pipeline
#15658
passed with stages
in 12 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/operators/fft_operator/transformations/rg_transforms.py
View file @
74312e64
...
...
@@ -250,7 +250,12 @@ class MPIFFT(Transform):
p
=
info
.
plan
# Load the value into the plan
if
p
.
has_input
:
p
.
input_array
[
None
]
=
val
try
:
p
.
input_array
[
None
]
=
val
except
ValueError
:
raise
ValueError
(
"Failed to load data into input_array of "
"FFTW MPI-plan. Maybe the 1D slicing differs"
"from n-D slicing?"
)
# Execute the plan
p
()
...
...
@@ -363,21 +368,6 @@ class MPIFFT(Transform):
)
inp
=
local_val
[
slice_list
]
# This is in order to make FFTW behave properly when slicing input
# over MPI ranks when the input is 1-dimensional. The default
# behaviour is to optimize to take advantage of byte-alignment,
# which doesn't match the slicing strategy for multi-dimensional
# data.
original_shape
=
None
if
len
(
inp
.
shape
)
==
1
:
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
)
transform_shape
[
0
]
=
val
.
shape
[
0
]
...
...
@@ -402,10 +392,6 @@ class MPIFFT(Transform):
elif
slice_list
==
[
slice
(
None
,
None
)]:
temp_val
=
result
else
:
# Reverting to the original shape i.e. before the input was
# augmented with 1 to make FFTW behave properly.
if
original_shape
is
not
None
:
result
=
result
.
reshape
(
original_shape
)
temp_val
[
slice_list
]
=
result
return_val
.
set_local_data
(
data
=
temp_val
,
copy
=
False
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment