Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fluiddyn
fluidfft
Commits
5409db7934c5
Commit
710814d8
authored
Oct 19, 2020
by
Ashwin Vishnu
Browse files
Rename perf -> pyperf, updated mpi4py-fft API
parent
c02b1e8a9ca0
Pipeline
#11863
passed with stage
in 4 minutes and 4 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
bench/compare_mpi4py_fft/Makefile
View file @
5409db79
TIMEIT
:=
python
-m
perf timeit
--fast
-s
TIMEIT
:=
python
-m
py
perf timeit
--fast
-s
# TIMEIT:=python -m perf timeit -q -s
NPROC
:=
2
...
...
bench/compare_mpi4py_fft/bench.py
View file @
5409db79
import
sys
import
numpy
as
np
import
perf
import
py
perf
from
mpi4py
import
MPI
from
mpi4py_fft.mpifft
import
PFFT
,
Function
from
mpi4py_fft.mpifft
import
PFFT
from
mpi4py_fft.distarray
import
newDistArray
def
init2d
(
N
=
1024
,
slab
=
True
):
...
...
@@ -10,17 +11,19 @@ def init2d(N=1024, slab=True):
def
init3d
(
N
=
128
,
slab
=
True
):
return
PFFT
(
MPI
.
COMM_WORLD
,
(
N
,
N
,
N
),
slab
=
slab
,
axes
=
(
0
,
1
,
2
),
dtype
=
np
.
float
)
return
PFFT
(
MPI
.
COMM_WORLD
,
(
N
,
N
,
N
),
slab
=
slab
,
axes
=
(
0
,
1
,
2
),
dtype
=
np
.
float
)
def
create_arrayX
(
o
):
u
=
Function
(
o
,
False
)
u
=
newDistArray
(
o
,
False
)
u
[:]
=
np
.
random
.
random
(
u
.
shape
).
astype
(
u
.
dtype
)
return
u
def
create_arrayK
(
o
):
u_hat
=
Function
(
o
,
True
)
u_hat
=
newDistArray
(
o
,
True
)
u_hat
[:]
=
np
.
random
.
random
(
u_hat
.
shape
).
astype
(
u_hat
.
dtype
)
return
u_hat
...
...
@@ -31,4 +34,3 @@ def fft(o, u, u_hat):
def
ifft
(
o
,
u
,
u_hat
):
o
.
backward
(
u_hat
,
u
)
fluidfft/fft3d/mpi_with_mpi4pyfft.py
View file @
5409db79
...
...
@@ -42,7 +42,7 @@ class FFT3DMPIWithMPI4PYFFT(BaseFFTMPI):
slab
=
self
.
_slab
,
# warning: segfault with the mpi4py_fft backend
# see bench/debug_mpi4py-fft/README.md
backend
=
"
pyfftw
"
,
backend
=
"
numpy
"
,
)
self
.
shapeX
=
self
.
get_shapeX_loc
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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