Skip to content

Commit 731a889

Browse files
committed
Minor fixes to references and such
1 parent a7bf829 commit 731a889

File tree

5 files changed

+36
-44
lines changed

5 files changed

+36
-44
lines changed

docs/paper/paper.bib

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ @article{dalcin18
33
Mikael Mortensen and
44
David E. Keyes},
55
title = {Fast parallel multidimensional {FFT} using advanced {MPI}},
6-
journal = {{Journal of Parallel and Distributed Computing}},
7-
volume = {in press},
6+
journal = {{J. Parallel Distrib. Comput.}},
7+
volume = {128},
8+
pages = {137--150},
89
year = {2019},
9-
url = {http://arxiv.org/abs/1804.09536},
10-
eprint = {1804.09536}
10+
doi = {10.1016/j.jpdc.2019.02.006},
11+
url = {https://doi.org/10.1016/j.jpdc.2019.02.006}
1112
}
1213

1314
@article{mortensen_joss,
1415
author = {Mikael Mortensen},
1516
year = {2018},
16-
title = {Shenfun: High performance spectral Galerkin computing platform},
17-
journal = {Journal of Open Source Software},
17+
title = {{Shenfun: High performance spectral Galerkin computing platform}},
18+
journal = {J. Open Source Software},
1819
volume = {3},
1920
number = {31},
2021
pages = {1071},
@@ -26,8 +27,8 @@ @inproceedings{mortensen17
2627
booktitle = {MekIT'17 - Ninth national conference on Computational Mechanics},
2728
isbn = {978-84-947311-1-2},
2829
pages = {273--298},
29-
publisher = {International Center for Numerical Methods in Engineering (CIMNE)},
30-
title = {Shenfun - automating the spectral Galerkin method},
30+
publisher = {Int Center for Numerical Methods in Engineering (CIMNE)},
31+
title = {{Shenfun - automating the spectral Galerkin method}},
3132
editor = {Skallerud, Bjorn Helge and Andersson, Helge Ingolf},
3233
year = {2017}
3334
}
@@ -48,7 +49,7 @@ @article{strang94
4849
@article{mpi4py08,
4950
author = {Lisandro Dalcin and Rodrigo Paz and Mario Storti and Jorge D'Elia},
5051
title = {{MPI} for {P}ython: Performance improvements and {MPI}-2 extensions},
51-
journal = {Journal of Parallel and Distributed Computing},
52+
journal = {J. Parallel Distrib. Comput.},
5253
volume = {68},
5354
number = {5},
5455
pages = {655--662},
@@ -61,7 +62,7 @@ @article{mpi4py08
6162
@article{cython11,
6263
author = {Behnel, Stefan and Bradshaw, Robert and Citro, Craig and Dalcin, Lisandro and Seljebotn, Dag Sverre and Smith, Kurt},
6364
title = {Cython: The Best of Both Worlds},
64-
journal = {Computing in Science and Engg.},
65+
journal = {Comput. in Science and Engg.},
6566
volume = {13},
6667
number = {2},
6768
pages = {31--39},
@@ -84,7 +85,7 @@ @article{fftw05
8485

8586
@article{mortensen16,
8687
title = {{High performance Python for direct numerical simulations of turbulent flows}},
87-
journal = {{Computer Physics Communications}},
88+
journal = {{Comput. Phys. Comm.}},
8889
volume = {203},
8990
pages = {53--65},
9091
year = {2016},
@@ -106,7 +107,7 @@ @article{mortensen16b
106107
@article{ketcheson,
107108
title = {{More efficient time integration for Fourier pseudo-spectral DNS of incompressible turbulence}},
108109
author = {David Ketcheson and Mikael Mortensen and Matteo Parsani and Nathanael Schilling},
109-
journal = {{International Journal of Numerical Methods in Fluids}},
110+
journal = {{Int J Numer Meth Fluids}},
110111
volume = {in press},
111112
year = {2019},
112113
url = {https://arxiv.org/abs/1810.10197}

docs/source/global.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ reverse ``backward`` method of the :class:`.Transfer` objects::
350350

351351
A different approach is also possible with the high-level API::
352352

353-
a0.redistribute(darray=a1)
354-
a1.redistribute(darray=a2)
355-
a2.redistribute(darray=a3)
353+
a0.redistribute(out=a1)
354+
a1.redistribute(out=a2)
355+
a2.redistribute(out=a3)
356356

357357
which corresponds to the backward transfers. However, with the high-level
358358
API the transfer objects are created (and deleted on exit) during the call

mpi4py_fft/distarray.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from numbers import Number
2+
from numbers import Number, Integral
33
import numpy as np
44
from mpi4py import MPI
55
from .pencil import Pencil, Subcomm
@@ -24,12 +24,14 @@ class DistArray(np.ndarray):
2424
dtype : np.dtype, optional
2525
Type of array
2626
buffer : Numpy array, optional
27-
Array of correct shape
27+
Array of correct shape. The buffer owns the memory that is used for
28+
this array.
2829
alignment : None or int, optional
2930
Make sure array is aligned in this direction. Note that alignment does
3031
not take rank into consideration.
3132
rank : int, optional
32-
Rank of tensor (scalar is zero, vector one, matrix two)
33+
Rank of tensor (number of free indices, a scalar is zero, vector one,
34+
matrix two)
3335
3436
3537
For more information, see `numpy.ndarray <https://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html>`_
@@ -55,11 +57,12 @@ class DistArray(np.ndarray):
5557
"""
5658
def __new__(cls, global_shape, subcomm=None, val=None, dtype=np.float,
5759
buffer=None, alignment=None, rank=0):
58-
if len(global_shape[rank:]) < 2:
60+
if len(global_shape[rank:]) < 2: # 1D case
5961
obj = np.ndarray.__new__(cls, global_shape, dtype=dtype, buffer=buffer)
6062
if buffer is None and isinstance(val, Number):
6163
obj.fill(val)
6264
obj._rank = rank
65+
obj._p0 = None
6366
return obj
6467

6568
if isinstance(subcomm, Subcomm):
@@ -155,17 +158,20 @@ def __getitem__(self, i):
155158
if self.ndim == 1:
156159
return np.ndarray.__getitem__(self, i)
157160

158-
if isinstance(i, (int, slice)) and self.rank > 0:
161+
if isinstance(i, (Integral, slice)) and self.rank > 0:
159162
v0 = np.ndarray.__getitem__(self, i)
160163
v0._rank = self.rank - (self.ndim - v0.ndim)
161-
#if v0.ndim < self.ndim:
162-
# v0._rank -= 1
163164
return v0
164165

165-
if isinstance(i, tuple) and len(i) == 2 and self.rank == 2:
166+
if isinstance(i, (Integral, slice)) and self.rank == 0:
167+
return np.ndarray.__getitem__(self.v, i)
168+
169+
assert isinstance(i, tuple)
170+
if len(i) <= self.rank:
166171
v0 = np.ndarray.__getitem__(self, i)
167-
v0._rank = 0
172+
v0._rank = self.rank - (self.ndim - v0.ndim)
168173
return v0
174+
169175
return np.ndarray.__getitem__(self.v, i)
170176

171177
@property
@@ -445,7 +451,7 @@ def newDistArray(pfft, forward_output=True, val=0, rank=0, view=False):
445451
val : int or float, optional
446452
Value used to initialize array.
447453
rank: int, optional
448-
Scalar has rank 0, vector 1 and matrix 2
454+
Scalar has rank 0, vector 1 and matrix 2.
449455
view : bool, optional
450456
If True return view of the underlying Numpy array, i.e., return
451457
cls.view(np.ndarray). Note that the DistArray still will

mpi4py_fft/io/nc_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, ncname, domain=None, mode='a', clobber=True, **kw):
5353
self.f = Dataset(ncname, mode=mode, clobber=clobber, parallel=True,
5454
comm=comm, **kw)
5555
self.dims = None
56-
if not 'time' in self.f.variables:
56+
if 'time' not in self.f.variables:
5757
self.f.createDimension('time', None)
5858
self.f.createVariable('time', np.float, ('time'))
5959
self.close()

mpi4py_fft/mpifft.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class PFFT(object):
9191
- int -> Just one axis to transform over
9292
- sequence of ints -> e.g., (0, 1, 2) or (0, 2, 1)
9393
- sequence of sequence of ints -> e.g., ((0,), (1,)) or ((0,), (1, 2))
94-
For seq. of seq. of ints only the last inner sequence may be longer
95-
than 1. This corresponds to collapsing axes, where serial FFTs are
96-
performed for all collapsed axes in one single call
94+
For seq. of seq. of ints all but the last transformed sequence
95+
may be longer than 1. This corresponds to collapsing axes, where
96+
serial FFTs are performed for all collapsed axes in one single call
9797
dtype : np.dtype, optional
9898
Type of input array
9999
slab : bool, optional
@@ -361,21 +361,6 @@ def local_slice(self, forward_output=True):
361361
ip.subshape)]
362362
return tuple(s)
363363

364-
def local_shape(self, forward_output=False): #pragma: no cover
365-
"""The local (to each processor) shape of data
366-
367-
Parameters
368-
----------
369-
forward_output : bool, optional
370-
Return shape of output array (spectral space) if True, else return
371-
shape of input array (physical space)
372-
"""
373-
import warnings
374-
warnings.warn("local_shape() is deprecated; use shape().", FutureWarning)
375-
if forward_output is not True:
376-
return self.forward.input_pencil.subshape
377-
return self.backward.input_pencil.subshape
378-
379364
def global_shape(self, forward_output=False):
380365
"""Return global shape of associated tensors
381366

0 commit comments

Comments
 (0)