Skip to content

Commit

Permalink
Merge changes to master (#1)
Browse files Browse the repository at this point in the history
* Try to merge

* fixed merge

---------

Co-authored-by: chaithyagr <[email protected]>
  • Loading branch information
chaithyagr and chaithyagr authored Nov 27, 2023
1 parent 7273f68 commit fe8abc5
Show file tree
Hide file tree
Showing 112 changed files with 3,129 additions and 3,873 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python_build_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Copy-Item -Path C:\msys64\mingw64\bin\libgomp-*.dll -Destination ([IO.Path]::Com
Copy-Item -Path C:\msys64\mingw64\bin\libwinpthread-*.dll -Destination ([IO.Path]::Combine($unpacked_wheel, 'finufft'))
Copy-Item -Path C:\msys64\mingw64\bin\libfftw3-*.dll -Destination ([IO.Path]::Combine($unpacked_wheel, 'finufft'))
Copy-Item -Path C:\msys64\mingw64\bin\libfftw3f-*.dll -Destination ([IO.Path]::Combine($unpacked_wheel, 'finufft'))
Copy-Item -Path C:\msys64\mingw64\bin\libfftw3_omp-*.dll -Destination ([IO.Path]::Combine($unpacked_wheel, 'finufft'))
Copy-Item -Path C:\msys64\mingw64\bin\libfftw3f_omp-*.dll -Destination ([IO.Path]::Combine($unpacked_wheel, 'finufft'))
New-Item -Path .\wheelhouse -ItemType Directory -Force
wheel.exe pack $unpacked_wheel -d .\wheelhouse
if (-not $?) {throw "Failed pack wheel"}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/python_test_win.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
python -m pip install finufft -f .\wheelhouse\
python -m pip install --pre finufft -f .\wheelhouse\
if (-not $?) {throw "Failed to pip install finufft"}
python python/finufft/test/run_accuracy_tests.py
if (-not $?) {throw "Tests failed"}
python python/finufft/examples/simple1d1.py
if (-not $?) {throw "Simple1d1 test failed"}
python -m pip install pytest
python -m pytest python/finufft/test
if (-not $?) {throw "Pytest suite failed"}
41 changes: 20 additions & 21 deletions .github/workflows/python_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: linux-wheels
path: python/wheelhouse/finufft*manylinux*.whl
path: python/finufft/wheelhouse/finufft*manylinux*.whl

MacOS:
runs-on: macos-latest
Expand All @@ -60,19 +60,6 @@ jobs:
# hack to make libquadmath link statically
sudo rm /usr/local/opt/gcc@11/lib/gcc/11/libquadmath.*dylib
- name: Cache macOS Python binaries
id: cache-python
uses: actions/cache@v3
with:
path: |
/Library/Frameworks/Python.framework/Versions/3.6
/Library/Frameworks/Python.framework/Versions/3.7
/Library/Frameworks/Python.framework/Versions/3.8
/Library/Frameworks/Python.framework/Versions/3.9
/Library/Frameworks/Python.framework/Versions/3.10
/Library/Frameworks/Python.framework/Versions/3.11
key: macos-python-3.6.8-macosx10.9-python3.7.9-macosx10.9-python3.8.3-macosx10.9-python3.9.7-macos11-python3.10.1-macos11-python3.11.0-macos11

# Download and install Python instead of using the setup_python
# as the python interpreters in the Github machines
# were compiled in 10.14, the wheels built with them
Expand Down Expand Up @@ -138,30 +125,42 @@ jobs:
PYTHON_BIN=/Library/Frameworks/Python.framework/Versions/3.11/bin/
$PYTHON_BIN/python3 -m pip install delocate
ls wheelhouse/finufft*.whl | xargs -n1 $PYTHON_BIN/delocate-wheel -w fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -m pytest test
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -m pytest test
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -m pytest test
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3 -m pytest test
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 -m pytest test
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install --pre finufft -f fixed_wheel/
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 test/run_accuracy_tests.py
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 examples/simple1d1.py
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pip install pytest
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m pytest test
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: macos-wheels
path: python/fixed_wheel/*.whl
path: python/finufft/fixed_wheel/*.whl

Windows:
runs-on: windows-latest
Expand Down
9 changes: 6 additions & 3 deletions .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# .readthedocs.yml
# "Read the Docs" doc-hosting website configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
#
# Barnett 10/5/20.

# Required (for this file format)
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build all formats
formats: all

Expand All @@ -16,6 +20,5 @@ sphinx:

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
11 changes: 8 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
List of features / changes made / release notes, in reverse chronological order.
If not stated, FINUFFT is assumed (up to v 1.3 CUFINUFFT indicated separately).

V 2.2.0 (not yet released... planning summer 2023):
V 2.3.0 (expected Dec 2023)

* finally thread-safety for all fftw cases, kill FFTW_PLAN_SAFE (PR 354)
* python interface edge cases (singleton dims, #395). Awaiting #367

V 2.2.0 (08/30/23) (untagged; aka 2.2.0.dev0, a name used to bump python pkg)

* MERGE OF CUFINUFFT (GPU CODE) INTO FINUFFT SOURCE TREE:
- combined cmake build system via FINUFFT_USE_CUDA flag
Expand All @@ -13,7 +18,7 @@ V 2.2.0 (not yet released... planning summer 2023):
- cufinufft repo will be obsoleted.
- coding leads on this: Robert Blackwell and Joakim Anden
* cmake build structure (thanks: Wenda Zhou, Marco Barbone, Libin Lu)
- Note: the plan is to make the makefiles/make.inc.* obsolete by 2023 end.
- Note: the plan is to make the makefiles/make.inc.* obsolete.
* interp (for type 2) accel by up to 60% in high-acc 2D/3D, by FMA/SIMD-friendly
rearranging of loops, by Martin Reinecke, PR #292.
* remove inv array in binsort; speeds up multithreaded case by up to 50%
Expand All @@ -25,7 +30,7 @@ V 2.2.0 (not yet released... planning summer 2023):
remains public, as should be (PR #233). Allows plan to have C++ constructs.
* fixed single-thread (OMP=OFF) build which failed due to fftw_defs.h/defs.h

CUFINUFFT v 1.3 (06/10/23)
CUFINUFFT v 1.3 (06/10/23) (Final legacy release outside FINUFFT repo)

* Move second half of onedim_fseries_kernel() to GPU (with a simple heuristic
basing on nf1 to switch between the CPU and the GPU version).
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.19)

project(finufft VERSION 2.1.0 LANGUAGES C CXX)
project(finufft VERSION 2.2.0 LANGUAGES C CXX)

set(GNU_LIKE_FRONTENDS AppleClang Clang GNU)
if(CMAKE_CXX_COMPILER_ID IN_LIST GNU_LIKE_FRONTENDS)
Expand All @@ -11,7 +11,12 @@ endif()

include(CTest)

set(FINUFFT_ARCH_FLAGS "-march=native" CACHE STRING "Compiler flags for specifying target architecture.")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc|ppc64|powerpc|powerpc64" OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc|ppc64"))
# PowerPC arch does not have -march flag.
set(FINUFFT_ARCH_FLAGS "-mtune=native" CACHE STRING "Compiler flags for specifying target architecture.")
else()
set(FINUFFT_ARCH_FLAGS "-march=native" CACHE STRING "Compiler flags for specifying target architecture.")
endif()
set(FINUFFT_FFTW_SUFFIX "OpenMP" CACHE STRING "Suffix for FFTW libraries (e.g. OpenMP, Threads etc.)")
set(FINUFFT_FFTW_LIBRARIES "DEFAULT" CACHE STRING "Specify a custom FFTW library")

Expand Down
19 changes: 19 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@
"FINUFFT_USE_OPENMP": "OFF"
}
},
{
"name": "icx",
"binaryDir": "build/icx",
"displayName": "Intel Compiler (llvm)",
"description": "Build with Intel Compiler",
"generator": "Ninja Multi-Config",
"cacheVariables": {
"CMAKE_C_COMPILER": "icx",
"CMAKE_CXX_COMPILER": "icpx",
"CMAKE_Fortran_COMPILER": "ifx",
"FINUFFT_ARCH_FLAGS": "-xHost",
"CMAKE_CXX_FLAGS": "-fp-model=strict"
}
},
{
"name": "icc",
"binaryDir": "build/icc",
Expand Down Expand Up @@ -109,6 +123,11 @@
"configurePreset": "icc",
"configuration": "RelWithDebInfo"
},
{
"name": "icx",
"configurePreset": "icx",
"configuration": "RelWithDebInfo"
},
{
"name": "matlab",
"configurePreset": "matlab",
Expand Down
35 changes: 29 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,53 @@ pipeline {
stage('main') {
agent {
dockerfile {
filename 'tools/cufinufft/docker/cuda11.0/Dockerfile-x86_64'
filename 'tools/cufinufft/docker/cuda11.2/Dockerfile-x86_64'
args '--gpus 2'
label 'v100'
}
}
environment {
HOME = "$WORKSPACE/build"
HOME = "$WORKSPACE"
PYBIN = "/opt/python/cp38-cp38/bin"
LIBRARY_PATH = "$WORKSPACE/build"
LD_LIBRARY_PATH = "$WORKSPACE/build"
}
steps {
sh '''#!/bin/bash -ex
nvidia-smi
'''
sh '''#!/bin/bash -ex
cp -r /io/build/test/cuda cuda_tests
cd cuda_tests
echo $HOME
'''
sh '''#!/bin/bash -ex
# v100 cuda arch
cuda_arch="70"
cmake -B build . -DFINUFFT_USE_CUDA=ON \
-DFINUFFT_USE_CPU=OFF \
-DFINUFFT_BUILD_TESTS=ON \
-DCMAKE_CUDA_ARCHITECTURES="$cuda_arch" \
-DBUILD_TESTING=ON
cd build
make -j4
'''
sh '''#!/bin/bash -ex
cd build/test/cuda
ctest --output-on-failure
'''
sh '${PYBIN}/python3 -m venv $HOME'
sh '''#!/bin/bash -ex
source $HOME/bin/activate
python3 -m pip install --upgrade pip
LIBRARY_PATH=/io/build python3 -m pip install -e python/cufinufft
python3 -m pip install --upgrade pycuda cupy-cuda112 numba
python3 -m pip install torch==1.7.1+cu110 -f https://download.pytorch.org/whl/torch_stable.html
python3 -m pip install -e python/cufinufft
python3 -m pip install pytest
python3 -m pytest
python -c "from numba import cuda; cuda.cudadrv.libs.test()"
python3 -m pytest --framework=pycuda python/cufinufft
python3 -m pytest --framework=numba python/cufinufft
python3 -m pytest --framework=cupy python/cufinufft
python3 -m pytest --framework=torch python/cufinufft
'''
}
}
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

Principal author **Alex H. Barnett**,
main co-developers Jeremy F. Magland,
Ludvig af Klinteberg, Yu-hsuan "Melody" Shih, Andrea Malleo, Libin Lu,
and Joakim Andén;
Ludvig af Klinteberg, Yu-hsuan "Melody" Shih, Libin Lu,
Joakim Andén, and Robert Blackwell;
see `docs/ackn.rst` for full list of contributors.
<img align="right" src="docs/logo.png" width="350">

<img align="right" src="docs/spreadpic.png" width="400"/>

This is a lightweight CPU library to compute the three standard types of nonuniform FFT to a specified precision, in one, two, or three dimensions. It is written in C++ with interfaces to C, Fortran, MATLAB/octave, Python, and (in a separate [repository](https://github.com/ludvigak/FINUFFT.jl)) Julia. It now contains the GPU CUDA library cuFINUFFT.
This is a lightweight CPU library to compute the three standard types of nonuniform FFT to a specified precision, in one, two, or three dimensions. It is written in C++ with interfaces to C, Fortran, MATLAB/octave, Python, and (in a separate [repository](https://github.com/ludvigak/FINUFFT.jl)) Julia. It now also integrates the GPU CUDA library cuFINUFFT (which currently does all but type 3).

Please see the [online documentation](http://finufft.readthedocs.io/en/latest/index.html) which can also be downloaded as a [PDF manual](https://finufft.readthedocs.io/_/downloads/en/latest/pdf/).
You will also want to see example codes in the directories
`examples`, `test`, `fortran`, `matlab/test`, and `python/test`.
If you cannot compile, or `pip install`, try our rather outdated [precompiled binaries](http://users.flatironinstitute.org/~ahb/codes/finufft-binaries).
You will also want to see CPU example codes in the directories `examples`, `test`, `fortran`, `matlab/test`, `matlab/examples`, `python/finufft/test`, etc, and GPU examples in `examples/cuda`, `test/cuda`, etc

If you cannot build via cMake, try the old makefile. Python users try `pip install finufft`. See the docs for details. See our GitHub Issues for tips.

If you prefer to read text files, the source to generate the above documentation is in human-readable (mostly .rst) files as follows:

Expand All @@ -29,22 +29,22 @@ If you prefer to read text files, the source to generate the above documentation
- `docs/c_gpu.rst` : documentation of C++/C function API for GPU library
- `docs/opts.rst` : optional parameters
- `docs/error.rst` : error codes
- `docs/trouble.rst` : troubleshooting
- `docs/trouble.rst` : troubleshooting advice
- `docs/tut.rst` and `docs/tutorial/*` : tutorial application examples
- `docs/fortran.rst` : usage examples from Fortran, documentation of interface
- `docs/matlab.rst` and `docs/matlabhelp.raw` : using the MATLAB/Octave interface
- `docs/python.rst` and `python/*/_interfaces.py` : using the Python interface
- `docs/python_gpu.rst` : Python interface to GPU library
- `docs/julia.rst` : using the Julia interface
- `docs/julia.rst` : options for Julia users
- `docs/devnotes.rst`: notes/guide for developers
- `docs/related.rst` : other recommended NUFFT packages
- `docs/users.rst` : users of FINUFFT and dependent packages
- `docs/users.rst` : some known users of FINUFFT, dependent packages
- `docs/ackn.rst` : authors and acknowledgments
- `docs/refs.rst` : journal article references (ours and others)
- `docs/refs.rst` : journal article references (both ours and others)


If you find (cu)FINUFFT useful in your work, please cite this repository and
the following. For FINUFFT (CPU library):
If you find (cu)FINUFFT useful in your work, please star this repository and
cite it and the following. For FINUFFT (CPU library):

A parallel non-uniform fast Fourier transform library based on an ``exponential of semicircle'' kernel.
A. H. Barnett, J. F. Magland, and L. af Klinteberg.
Expand Down
File renamed without changes.
Loading

0 comments on commit fe8abc5

Please sign in to comment.