|
Highly Efficient FFT for Exascale: HeFFTe v2.3
|
HeFFTe provides a set of Python wrappers that use the C interface but provide object-oriented API mimicking C++. Thus, the C++ documentation remains relevant.
The Python wrappers require the following modules:
In addition, using the CUDA backend requires:
The ROCm bindings using numba.hsa are still under development.
The heFFTe Python bindings are enabled with:
The PYTHON_EXECUTABLE is used for testing purposes only, the ctypes interface allows for multiple Python versions to use the same heFFTe installation.
The module files will be installed in two locations:
The site-packages is the standard location for Python modules where X and Y represent the Python version. The location in share allows for a more version-independent access to the modules.
Using the heFFTe Python module requires that at least one location is accessible to the interpreter by either setting environment variable:
or by adding the path to your sys.path
HeFFTe requires at least two modules:
In addition, either numpy or numba.cuda modules are required to work with the CPU or GPU backends.
The Python equivalanets to the heffte::fft3d and heffte::fft3d_r2c are created with:
While the methods have signature similar to Python constructors, the fft3d and fft3d_r2c are factory methods that create objects of type heffte_fft_plan which in turn wraps around a heFFTe plan from the C interface.
The backend_tag is a runtime variable and takes one of the values:
The corresponding backend has to be also enabled in CMake and C++.
The inbox and outbox are instances of:
The Python box3d class offers only the constructor that uses as inputs objects convertible to numpy.ndarray with three entries. The rest of the C++ box3d API is not available under Python.
The comm variable is an MPI communicator from the mpi4py module.
The fft3d objects provide the same methods for size_inbox(), size_outbox(), and size_workspace().
The FFT transforms are performed with the forward() and backward() methods:
The inarray and outarray are instances of either numpy.ndarray or DeviceNDArray from the numba.cuda module. The sizes and types must match those in the calls to the C++ interface, see the documentation of heffte::fft3d.
The scaling variable is one of the constants: