Commit 710814d8 authored by Ashwin Vishnu's avatar Ashwin Vishnu
Browse files

Rename perf -> pyperf, updated mpi4py-fft API

parent c02b1e8a9ca0
Pipeline #11863 passed with stage
in 4 minutes and 4 seconds
TIMEIT:=python -m perf timeit --fast -s TIMEIT:=python -m pyperf timeit --fast -s
# TIMEIT:=python -m perf timeit -q -s # TIMEIT:=python -m perf timeit -q -s
NPROC:=2 NPROC:=2
......
import sys import sys
import numpy as np import numpy as np
import perf import pyperf
from mpi4py import MPI 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): def init2d(N=1024, slab=True):
...@@ -10,17 +11,19 @@ def init2d(N=1024, slab=True): ...@@ -10,17 +11,19 @@ def init2d(N=1024, slab=True):
def init3d(N=128, 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): def create_arrayX(o):
u = Function(o, False) u = newDistArray(o, False)
u[:] = np.random.random(u.shape).astype(u.dtype) u[:] = np.random.random(u.shape).astype(u.dtype)
return u return u
def create_arrayK(o): 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) u_hat[:] = np.random.random(u_hat.shape).astype(u_hat.dtype)
return u_hat return u_hat
...@@ -31,4 +34,3 @@ def fft(o, u, u_hat): ...@@ -31,4 +34,3 @@ def fft(o, u, u_hat):
def ifft(o, u, u_hat): def ifft(o, u, u_hat):
o.backward(u_hat, u) o.backward(u_hat, u)
...@@ -42,7 +42,7 @@ class FFT3DMPIWithMPI4PYFFT(BaseFFTMPI): ...@@ -42,7 +42,7 @@ class FFT3DMPIWithMPI4PYFFT(BaseFFTMPI):
slab=self._slab, slab=self._slab,
# warning: segfault with the mpi4py_fft backend # warning: segfault with the mpi4py_fft backend
# see bench/debug_mpi4py-fft/README.md # see bench/debug_mpi4py-fft/README.md
backend="pyfftw", backend="numpy",
) )
self.shapeX = self.get_shapeX_loc() self.shapeX = self.get_shapeX_loc()
......
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