Skip to content

Commit

Permalink
Update doc install
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Aug 19, 2024
1 parent 783fc14 commit e3ae536
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrap = 89
number = true
end_of_line = "lf"
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]
exclude_patterns = ["_build", "install/pfft-1.0.8-alpha/README.rst"]
exclude_patterns.extend(
[
f"install/{name}.md"
Expand Down
59 changes: 35 additions & 24 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

# Installation and advice

As already written in the overview, Fluidfft is organized as a main package
provided few Fluidfft Python classes using standard packages (Numpy, pyfftw,
Dask, etc.) and plugins which can use other methods, in particular based on C++
classes using more advanced libraries (as pfft and p3dfft).
As already written in the overview, Fluidfft is organized as a main package provided few
Fluidfft Python classes using standard packages (Numpy, pyfftw, Dask, etc.) and plugins
which can use other methods, in particular based on C++ classes using more advanced
libraries (as pfft and p3dfft).

In this page we focus on installing the base Fluidfft package for Fluidfft >=
0.4.0.
In this page we focus on installing the base Fluidfft package for Fluidfft >= 0.4.0.

First, ensure that you have a recent Python installed, since Fluidsim requires
Python >= 3.9. Some issues regarding the installation of Python and Python
packages are discussed in
First, ensure that you have a recent Python installed, since Fluidsim requires Python >=
3.9. Some issues regarding the installation of Python and Python packages are discussed
in
[the main documentation of the project](http://fluiddyn.readthedocs.org/en/latest/install.html).

## Installation with pip
Expand All @@ -29,7 +28,21 @@ Fluidfft can be installed without compilation with `pip`:

```sh
pip install pip -U
pip install fluidsim
pip install fluidfft
```

However, fluidfft [works with plugins](./plugins.md), which have to be installed
additionally, for example using fluidfft optional dependencies. Installing [pyfftw] does
not require compilation:

```sh
pip install "fluidfft[pyfftw]"
```

whereas installing other plugins will trigger local compilation.

```sh
pip install "fluidfft[fftw,mpi-with-fftw,fftwmpi]"
```

## Installation with conda
Expand All @@ -40,17 +53,14 @@ conda install fluidfft

### Remark on Numpy installed with conda

In anaconda (or miniconda), Numpy installed with `conda install numpy` can be
built and linked with MKL (an Intel library). This can be a real plus for
performance since MKL replaces fftw functions by (usually) faster ones but it
has a drawback for fft using the library fftw3_mpi (an implementation of
parallel fft using 1D decomposition by fftw). MKL implements some fftw
functions but not all the functions defined in fftw3_mpi. Since the libraries
are loaded dynamically, if numpy is imported before the fftw_mpi libraries,
this can lead to very bad issues (segmentation fault, only if numpy is imported
before the class!). For security, we prefer to automatically disable the
building of the fft classes using fftw3_mpi when it is detected that numpy uses
the MKL library where some fftw symbols are defined.
In anaconda (or miniconda), Numpy installed with `conda install numpy` can be built and
linked with MKL (an Intel library). This can be a real plus for performance since MKL
replaces fftw functions by (usually) faster ones but it has a drawback for fft using the
library fftw3_mpi (an implementation of parallel fft using 1D decomposition by fftw). MKL
implements some fftw functions but not all the functions defined in fftw3_mpi. Since the
libraries are loaded dynamically, if numpy is imported before the fftw_mpi libraries,
this can lead to very bad issues (segmentation fault, only if numpy is imported before
the class!).

To install with anaconda numpy linked with openblas:

Expand All @@ -61,6 +71,7 @@ conda install "blas[build=*openblas]" numpy

## Environment variables

Fluidfft is sensible at runtime to the environment variable
`TRANSONIC_BACKEND`. The Transonic backend is "pythran" by default, but it can
also be set to "python" or "numba".
Fluidfft is sensible at runtime to the environment variable `TRANSONIC_BACKEND`. The
Transonic backend is "pythran" by default, but it can also be set to "python" or "numba".

[pyfftw]: https://github.com/pyFFTW/pyFFTW/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pyfftw = ["pyfftw >= 0.10.4"]
dask = ["dask"]
mpi = ["mpi4py"]
fftw = ["fluidfft-fftw"]
mpi_with_fftw = ["fluidfft-mpi_with_fftw"]
mpi-with-fftw = ["fluidfft-mpi_with_fftw"]
fftwmpi = ["fluidfft-fftwmpi"]
pfft = ["fluidfft-pfft"]
p3dfft = ["fluidfft-p3dfft"]
Expand Down

0 comments on commit e3ae536

Please sign in to comment.