-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
835 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
develop: | ||
pip install -e . -vv --no-build-isolation --no-deps | ||
|
||
clean: | ||
rm -rf build | ||
|
||
test: | ||
mpirun -np 2 pytest --exitfirst -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Fluidfft plugin for parallel FFTs using PFFT | ||
|
||
This plugin provides a method for parallel FFTs using PFFT: | ||
`fft3d.mpi_with_pfft`. | ||
|
||
## Environment variables | ||
|
||
- `LIBRARY_PATH` | ||
- `CPATH` | ||
- `LD_LIBRARY_PATH` | ||
|
||
or | ||
|
||
- `PFFT_DIR` | ||
|
||
or | ||
|
||
- `PFFT_LIB_DIR` | ||
- `PFFT_INCLUDE_DIR` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
project( | ||
'fluidfft-pfft', | ||
'cpp', | ||
'cython', | ||
license: 'CeCILL', | ||
meson_version: '>= 1.1.0', | ||
default_options: [ | ||
'buildtype=release', | ||
'c_std=c99', | ||
'cpp_std=c++11', | ||
], | ||
) | ||
|
||
py_mod = import('python') | ||
py = py_mod.find_installation('python3', pure: false) | ||
py_dep = py.dependency() | ||
|
||
fftw_dep = dependency('fftw3', static: false) | ||
mpi_dep = dependency('mpi', language: 'cpp') | ||
|
||
incdir_numpy = run_command( | ||
'transonic-get-include', 'numpy', check: true | ||
).stdout().strip() | ||
inc_np = include_directories(incdir_numpy) | ||
np_dep = declare_dependency(include_directories: inc_np) | ||
|
||
compiler = meson.get_compiler('cpp') | ||
# fftw_mpi is not found on Ubuntu | ||
fftwmpi_dep = compiler.find_library('fftw_mpi', required: false) | ||
|
||
|
||
PFFT_DIR = run_command( | ||
py, '-c', 'import os; print(os.environ.get("PFFT_DIR", ""))', | ||
check: true | ||
).stdout().strip() | ||
message('PFFT_DIR=' + PFFT_DIR) | ||
|
||
PFFT_LIB_DIR = run_command( | ||
py, '-c', 'import os; print(os.environ.get("PFFT_LIB_DIR", ""))', | ||
check: true | ||
).stdout().strip() | ||
message('PFFT_LIB_DIR=' + PFFT_LIB_DIR) | ||
|
||
PFFT_INCLUDE_DIR = run_command( | ||
py, '-c', 'import os; print(os.environ.get("PFFT_INCLUDE_DIR", ""))', | ||
check: true | ||
).stdout().strip() | ||
message('PFFT_INCLUDE_DIR=' + PFFT_INCLUDE_DIR) | ||
|
||
# We need to do something with these values | ||
# see https://stackoverflow.com/a/61072768/1779806 | ||
|
||
# set LIBRARY_PATH to include the directory where is libpfft.so | ||
pfft_dep = compiler.find_library('pfft', required: true) | ||
link_args = ['-lpfft', '-lfftw3_mpi'] | ||
|
||
dependencies = [fftw_dep, mpi_dep, np_dep, fftwmpi_dep, pfft_dep] | ||
|
||
include_path_fluidfft_builder = run_command( | ||
'fluidfft-builder-print-include-dir', check: true | ||
).stdout().strip() | ||
|
||
include_path_cy = run_command( | ||
'fluidfft-builder-print-include-dir-cython', check: true | ||
).stdout().strip() | ||
add_project_arguments('-I', include_path_cy, language : 'cython') | ||
|
||
subdir('src/fluidfft_pfft') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[build-system] | ||
requires = [ | ||
"meson-python", "numpy", "fluidfft-builder>=0.0.1", "cython", "mpi4py", "transonic>=0.6.1" | ||
] | ||
build-backend = 'mesonpy' | ||
|
||
[project] | ||
name = "fluidfft-pfft" | ||
version = "0.0.1" | ||
description = "Fluidfft plugin for MPI FFTs using fftw" | ||
authors = [{name = "Pierre Augier", email = "pierre.augier@univ-grenoble-alpes.fr"}] | ||
license = {file = "LICENSE"} | ||
classifiers = ["License :: OSI Approved :: MIT License"] | ||
dependencies = ["fluidfft"] | ||
readme = "README.md" | ||
|
||
[project.urls] | ||
Home = "https://foss.heptapod.net/fluiddyn/fluidfft" | ||
|
||
[project.entry-points."fluidfft.plugins"] | ||
|
||
"fft3d.mpi_with_pfft" = "fluidfft_pfft.mpi_with_pfft" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
py.install_sources('__init__.py', subdir: 'fluidfft_pfft') | ||
|
||
pyx = custom_target( | ||
'mpi_with_pfft.pyx', | ||
output: 'mpi_with_pfft.pyx', | ||
command: ['fluidfft-builder-make-file', '@OUTPUT@', 'FFT3DMPIWithPFFT'], | ||
) | ||
|
||
pxd = custom_target( | ||
'fft3dmpi_with_pfft.pxd', | ||
output: 'fft3dmpi_with_pfft.pxd', | ||
command: ['fluidfft-builder-make-file', '@OUTPUT@', 'FFT3DMPIWithPFFT'], | ||
) | ||
|
||
py.extension_module( | ||
'mpi_with_pfft', | ||
pyx, | ||
pxd, | ||
'fft3dmpi_with_pfft.cpp', | ||
'fft3dmpi_with_pfft.h', | ||
include_path_fluidfft_builder / 'base_fft.cpp', | ||
include_path_fluidfft_builder / 'base_fft3d.cpp', | ||
include_path_fluidfft_builder / 'base_fftmpi.cpp', | ||
include_path_fluidfft_builder / 'base_fft3dmpi.cpp', | ||
dependencies: dependencies, | ||
override_options : ['cython_language=cpp'], | ||
include_directories: include_path_fluidfft_builder, | ||
link_args: link_args, | ||
install: true, | ||
subdir: 'fluidfft_pfft', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from unittest import TestCase | ||
|
||
from fluidfft.fft3d.testing import complete_test_class_3d | ||
|
||
|
||
class Tests(TestCase): | ||
pass | ||
|
||
|
||
complete_test_class_3d("fft3d.mpi_with_pfft", Tests) |