File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 5050z [:] = MPI .COMM_WORLD .Get_rank ()
5151g0 = z .get ((0 , slice (None ), 0 ))
5252z2 = z .redistribute (2 )
53- z = z2 .redistribute (darray = z )
53+ z = z2 .redistribute (out = z )
5454g1 = z .get ((0 , slice (None ), 0 ))
5555assert np .all (g0 == g1 )
5656s0 = MPI .COMM_WORLD .reduce (np .linalg .norm (z )** 2 )
6969if MPI .COMM_WORLD .Get_rank () == 0 :
7070 assert abs (s0 - s1 ) < 1e-12
7171
72- z1 = z0 .redistribute (darray = z1 )
73- z0 = z1 .redistribute (darray = z0 )
72+ z1 = z0 .redistribute (out = z1 )
73+ z0 = z1 .redistribute (out = z0 )
7474
7575N = (6 , 6 , 6 , 6 , 6 )
7676m0 = DistArray (N , dtype = float , alignment = 2 )
7777m0 [:] = MPI .COMM_WORLD .Get_rank ()
7878m1 = m0 .redistribute (4 )
79- m0 = m1 .redistribute (darray = m0 )
79+ m0 = m1 .redistribute (out = m0 )
8080s0 = MPI .COMM_WORLD .reduce (np .linalg .norm (m0 )** 2 )
8181s1 = MPI .COMM_WORLD .reduce (np .linalg .norm (m1 )** 2 )
8282if MPI .COMM_WORLD .Get_rank () == 0 :
Original file line number Diff line number Diff line change 11import functools
22import numpy as np
33from mpi4py import MPI
4- from mpi4py_fft import PFFT , DistArray
4+ from mpi4py_fft import PFFT , newDistArray
55from mpi4py_fft .fftw import dctn , idctn
66
77# Set global size of the computational box
1717
1818assert fft .axes == pfft .axes
1919
20- u = DistArray ( pfft = fft , forward_output = False )
20+ u = newDistArray ( fft , forward_output = False )
2121u [:] = np .random .random (u .shape ).astype (u .dtype )
2222
23- u_hat = DistArray ( pfft = fft , forward_output = True )
23+ u_hat = newDistArray ( fft , forward_output = True )
2424u_hat = fft .forward (u , u_hat )
2525uj = np .zeros_like (u )
2626uj = fft .backward (u_hat , uj )
2727assert np .allclose (uj , u )
2828
29- u_padded = DistArray ( pfft = pfft , forward_output = False )
29+ u_padded = newDistArray ( pfft , forward_output = False )
3030uc = u_hat .copy ()
3131u_padded = pfft .backward (u_hat , u_padded )
3232u_hat = pfft .forward (u_padded , u_hat )
You can’t perform that action at this time.
0 commit comments