GridFloat

Note

These functions are only available if single precision support is enabled, in which case the marco SPFFT_SINGLE_PRECISION is defined in config.h.

Typedefs

typedef void *SpfftFloatGrid

Grid handle.

Functions

SPFFT_EXPORT SpfftError spfft_float_grid_create(SpfftFloatGrid * grid, int maxDimX, int maxDimY, int maxDimZ, int maxNumLocalZColumns, SpfftProcessingUnitType processingUnit, int maxNumThreads)

Constructor for a single precision local grid.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [out] grid: Handle to grid.

  • [in] maxDimX: Maximum dimension in x.

  • [in] maxDimY: Maximum dimension in y.

  • [in] maxDimZ: Maximum dimension in z.

  • [in] maxNumLocalZColumns: Maximum number of z-columns in frequency domain.

  • [in] processingUnit: The processing unit type to prepare for. Can be SPFFT_PU_HOST or SPFFT_PU_GPU or SPFFT_PU_HOST | SPFFT_PU_GPU.

  • [in] maxNumThreads: The maximum number of threads, transforms created with this grid are allowed to use. If smaller than 1, the OpenMP default value is used.

SPFFT_EXPORT SpfftError spfft_float_grid_create_distributed(SpfftFloatGrid * grid, int maxDimX, int maxDimY, int maxDimZ, int maxNumLocalZColumns, int maxLocalZLength, SpfftProcessingUnitType processingUnit, int maxNumThreads, MPI_Comm comm, SpfftExchangeType exchangeType)

Constructor for a single precision distributed grid.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [out] grid: Handle to grid.

  • [in] maxDimX: Maximum dimension in x.

  • [in] maxDimY: Maximum dimension in y.

  • [in] maxDimZ: Maximum dimension in z.

  • [in] maxNumLocalZColumns: Maximum number of z-columns in frequency domain of the local MPI rank.

  • [in] maxLocalZLength: Maximum length in z in space domain for the local MPI rank.

  • [in] processingUnit: The processing unit type to prepare for. Can be SPFFT_PU_HOST or SPFFT_PU_GPU or SPFFT_PU_HOST | SPFFT_PU_GPU.

  • [in] maxNumThreads: The maximum number of threads, transforms created with this grid are allowed to use. If smaller than 1, the OpenMP default value is used.

  • [in] comm: The MPI communicator to use. Will be duplicated for internal use.

  • [in] exchangeType: The type of MPI exchange to use. Possible values are SPFFT_EXCH_DEFAULT, SPFFT_EXCH_BUFFERED, SPFFT_EXCH_COMPACT_BUFFERED and SPFFT_EXCH_UNBUFFERED.

SPFFT_EXPORT SpfftError spfft_float_grid_destroy(SpfftFloatGrid grid)

Destroy a grid.

A grid can be safely destroyed independet from any related transforms. The internal memory is released, once all associated transforms are destroyed as well (through internal reference counting).

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

SPFFT_EXPORT SpfftError spfft_float_grid_max_dim_x(SpfftFloatGrid grid, int * dimX)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] dimX: Maximum dimension in x.

SPFFT_EXPORT SpfftError spfft_float_grid_max_dim_y(SpfftFloatGrid grid, int * dimY)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] dimY: Maximum dimension in y.

SPFFT_EXPORT SpfftError spfft_float_grid_max_dim_z(SpfftFloatGrid grid, int * dimZ)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] dimZ: Maximum dimension in z.

SPFFT_EXPORT SpfftError spfft_float_grid_max_num_local_z_columns(SpfftFloatGrid grid, int * maxNumLocalZColumns)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] maxNumLocalZColumns: Maximum number of z-columns in frequency domain of the local MPI rank.

SPFFT_EXPORT SpfftError spfft_float_grid_max_local_z_length(SpfftFloatGrid grid, int * maxLocalZLength)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] maxLocalZLength: Maximum length in z in space domain of the local MPI rank. rank.

SPFFT_EXPORT SpfftError spfft_float_grid_processing_unit(SpfftFloatGrid grid, SpfftProcessingUnitType * processingUnit)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] processingUnit: The processing unit, the grid has prepared for. Can be SPFFT_PU_HOST or SPFFT_PU_GPU or SPFFT_PU_HOST | SPFFT_PU_GPU.

SPFFT_EXPORT SpfftError spfft_float_grid_device_id(SpfftFloatGrid grid, int * deviceId)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] deviceId: The GPU device id used. Returns always 0, if no GPU support is enabled.

SPFFT_EXPORT SpfftError spfft_float_grid_num_threads(SpfftFloatGrid grid, int * numThreads)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] numThreads: The exact number of threads used by transforms created from this grid. May be less than the maximum given to the constructor. Always 1, if not compiled with OpenMP support.

SPFFT_EXPORT SpfftError spfft_float_grid_communicator(SpfftFloatGrid grid, MPI_Comm * comm)

Access a grid parameter.

Return

Error code or SPFFT_SUCCESS.

Parameters
  • [in] grid: Handle to grid.

  • [out] comm: The internal MPI communicator.