AccFFT
Functions
accfft_common.cpp File Reference
#include <mpi.h>
#include <omp.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include "accfft_common.h"

Functions

void * accfft_alloc (ptrdiff_t size)
 
void accfft_free (void *ptr)
 
void accfft_create_comm (MPI_Comm in_comm, int *c_dims, MPI_Comm *c_comm)
 
int accfft_init ()
 
int accfft_init (int nthreads)
 
void accfft_cleanup ()
 

Detailed Description

common functions in AccFFT.

Function Documentation

void* accfft_alloc ( ptrdiff_t  size)

Allocates aligned memory to enable SIMD

Parameters
sizeAllocation size in Bytes
void accfft_cleanup ( )

Cleanup all CPU resources

void accfft_create_comm ( MPI_Comm  in_comm,
int *  c_dims,
MPI_Comm *  c_comm 
)

Creates a Cartesian communicator of size c_dims[0]xc_dims[1] from its input. If c_dims[0]xc_dims[1] would not match the size of in_comm, then the function prints an error and automatically sets c_dims to the correct values.

Parameters
in_commInput MPI communicator handle
c_dimsA 2D integer array, which sets the size of the Cartesian array to c_dims[0]xc_dims[1]
c_commA pointer to the Cartesian communicator which will be created
void accfft_free ( void *  ptr)

Free memory allocated by accfft_alloc

Parameters
ptrAddress of the memory to be freed.
int accfft_init ( )

Initialize AccFFT library.

Returns
0 if successful.
int accfft_init ( int  nthreads)

Initializes the library.

Parameters
nthreadsThe number of OpenMP threads to use for execution of local FFT.
Returns
0 if successful