@@ -18,7 +18,7 @@ the following code snippet::
1818
1919 import numpy as np
2020 from mpi4py import MPI
21- from mpi4py_fft import PFFT, newDarray
21+ from mpi4py_fft import PFFT, newDistArray
2222 N = np.array([128, 128, 128], dtype=int)
2323 fft = PFFT(MPI.COMM_WORLD, N, axes=(0, 1, 2), dtype=np.float, slab=True)
2424
@@ -47,7 +47,7 @@ With data aligned in axis 0, we can perform the final transform
4747Assume now that all the code in this section is stored to a file named
4848``pfft_example.py ``, and add to the above code::
4949
50- u = newDarray (fft, False)
50+ u = newDistArray (fft, False)
5151 u[:] = np.random.random(u.shape).astype(u.dtype)
5252 u_hat = fft.forward(u)
5353 uj = np.zeros_like(u)
@@ -63,8 +63,8 @@ should raise no exception, and the output should be::
6363
6464This shows that the first index has been shared between the two processors
6565equally. The array ``u `` thus corresponds to :math: `u_{j_0 /P,j_1 ,j_2 }`. Note
66- that the :func: `.newDarray ` function returns a :class: `.DistributedArray `
67- object, which in turn is a subclassed Numpy ndarray. The :func: `.newDarray `
66+ that the :func: `.newDistArray ` function returns a :class: `.DistArray `
67+ object, which in turn is a subclassed Numpy ndarray. The :func: `.newDistArray `
6868function uses ``fft `` to determine the size and type of the created distributed
6969array, i.e., (64, 128, 128) and ``np.float `` for both processors.
7070The ``False `` argument indicates that the shape
@@ -80,7 +80,7 @@ The output array will be distributed in axis 1, so the output array
8080shape should be (128, 64, 65) on each processor. We check this by adding
8181the following code and rerunning::
8282
83- u_hat = newDarray (fft, True)
83+ u_hat = newDistArray (fft, True)
8484 print(MPI.COMM_WORLD.Get_rank(), u_hat.shape)
8585
8686leading to an additional print of::
@@ -147,7 +147,7 @@ with real-to-complex transforms like this::
147147 idct = functools.partial(idctn, type=3)
148148 transforms = {(0,): (rfftn, irfftn), (1, 2): (dct, idct)}
149149 r2c = PFFT(MPI.COMM_WORLD, N, axes=((0,), (1, 2)), transforms=transforms)
150- u = newDarray (r2c, False)
150+ u = newDistArray (r2c, False)
151151 u[:] = np.random.random(u.shape).astype(u.dtype)
152152 u_hat = r2c.forward(u)
153153 uj = np.zeros_like(u)
@@ -170,7 +170,7 @@ A parallel transform object can be created and tested as::
170170 fft = PFFT(MPI.COMM_WORLD, N, ((0,), (1, 2), (3, 4)), slab=True,
171171 transforms={(1, 2): (dctn, idctn), (3, 4): (dstn, idstn)})
172172
173- A = newDarray (fft, False)
173+ A = newDistArray (fft, False)
174174 A[:] = np.random.random(A.shape)
175175 C = fftw.aligned_like(A)
176176 B = fft.forward(A)
@@ -190,11 +190,11 @@ in the PFFT calling::
190190
191191 import numpy as np
192192 from mpi4py import MPI
193- from mpi4py_fft import PFFT, newDarray
193+ from mpi4py_fft import PFFT, newDistArray
194194
195195 N = np.array([128, 128, 128], dtype=int)
196196 fft = PFFT(MPI.COMM_WORLD, N, axes=(0, 1, 2), dtype=np.float)
197- u = newDarray (fft, False)
197+ u = newDistArray (fft, False)
198198 u[:] = np.random.random(u.shape).astype(u.dtype)
199199 u_hat = fft.forward(u)
200200 uj = np.zeros_like(u)
@@ -327,22 +327,22 @@ With mpi4py-fft we can compute this convolution using the ``padding`` keyword
327327of the :class: `.PFFT ` class::
328328
329329 import numpy as np
330- from mpi4py_fft import PFFT, newDarray
330+ from mpi4py_fft import PFFT, newDistArray
331331 from mpi4py import MPI
332332
333333 comm = MPI.COMM_WORLD
334334 N = (128, 128) # Global shape in physical space
335335 fft = PFFT(comm, N, padding=[1.5, 1.5], dtype=np.complex)
336336
337337 # Create arrays in normal spectral space
338- a_hat = newDarray (fft, True)
339- b_hat = newDarray (fft, True)
338+ a_hat = newDistArray (fft, True)
339+ b_hat = newDistArray (fft, True)
340340 a_hat[:] = np.random.random(a_hat.shape) + np.random.random(a_hat.shape)*1j
341341 b_hat[:] = np.random.random(a_hat.shape) + np.random.random(a_hat.shape)*1j
342342
343343 # Transform to real space with padding
344- a = newDarray (fft, False)
345- b = newDarray (fft, False)
344+ a = newDistArray (fft, False)
345+ b = newDistArray (fft, False)
346346 assert a.shape == (192//comm.Get_size(), 192)
347347 a = fft.backward(a_hat, a)
348348 b = fft.backward(b_hat, b)
0 commit comments