#include <mpi.h>
#include <omp.h>
#include <iostream>
#include <cmath>
#include <math.h>
#include <string.h>
#include <accfft.h>
#include <../src/operators.txx>
#include <pnetcdf.h>
#include <cstdlib>
#include <string>
|
void | accfft_grad (double *A_x, double *A_y, double *A_z, double *A, accfft_plan *plan, std::bitset< 3 > *pXYZ, double *timer) |
|
void | accfft_laplace (double *LA, double *A, accfft_plan *plan, double *timer) |
|
void | accfft_divergence (double *divA, double *A_x, double *A_y, double *A_z, accfft_plan *plan, double *timer) |
|
void | accfft_biharmonic (double *BA, double *A, accfft_plan *plan, double *timer) |
|
void | accfft_inv_laplace (double *invLA, double *A, accfft_plan *plan, double *timer) |
|
void | accfft_inv_biharmonic (double *invBA, double *A, accfft_plan *plan, double *timer) |
|
void | read_pnetcdf (const std::string &filename, MPI_Offset starts[3], MPI_Offset counts[3], int gsizes[3], double *localData) |
|
void | write_pnetcdf (const std::string &filename, MPI_Offset starts[3], MPI_Offset counts[3], int gsizes[3], double *localData) |
|
CPU functions of AccFFT operators
void accfft_biharmonic |
( |
double * |
BA, |
|
|
double * |
A, |
|
|
accfft_plan * |
plan, |
|
|
double * |
timer |
|
) |
| |
Computes double precision biharmonic of its input real data A, and writes the output into LA.
- Parameters
-
BA | |
plan | FFT plan created by accfft_plan_dft_3d_r2c. Must be an outplace plan, otherwise the function will return without computing the gradient. |
timer | See Timing AccFFT for more details. |
void accfft_divergence |
( |
double * |
divA, |
|
|
double * |
A_x, |
|
|
double * |
A_y, |
|
|
double * |
A_z, |
|
|
accfft_plan * |
plan, |
|
|
double * |
timer |
|
) |
| |
void accfft_grad |
( |
double * |
A_x, |
|
|
double * |
A_y, |
|
|
double * |
A_z, |
|
|
double * |
A, |
|
|
accfft_plan * |
plan, |
|
|
std::bitset< 3 > * |
pXYZ, |
|
|
double * |
timer |
|
) |
| |
void accfft_inv_biharmonic |
( |
double * |
invBA, |
|
|
double * |
A, |
|
|
accfft_plan * |
plan, |
|
|
double * |
timer |
|
) |
| |
Computes double precision inverse biharmonic of its input real data A, and writes the output into invBA.
- Parameters
-
invBA | |
plan | FFT plan created by accfft_plan_dft_3d_r2c. Must be an outplace plan, otherwise the function will return without computing the gradient. |
timer | See Timing AccFFT for more details. |
void accfft_inv_laplace |
( |
double * |
invLA, |
|
|
double * |
A, |
|
|
accfft_plan * |
plan, |
|
|
double * |
timer |
|
) |
| |
Computes double precision inverse Laplacian of its input real data A, and writes the output into invLA.
- Parameters
-
invLA | |
plan | FFT plan created by accfft_plan_dft_3d_r2c. Must be an outplace plan, otherwise the function will return without computing the gradient. |
timer | See Timing AccFFT for more details. |
void accfft_laplace |
( |
double * |
LA, |
|
|
double * |
A, |
|
|
accfft_plan * |
plan, |
|
|
double * |
timer |
|
) |
| |
Computes double precision Laplacian of its input real data A, and writes the output into LA.
- Parameters
-
LA | |
plan | FFT plan created by accfft_plan_dft_3d_r2c. Must be an outplace plan, otherwise the function will return without computing the gradient. |
timer | See Timing AccFFT for more details. |
void read_pnetcdf |
( |
const std::string & |
filename, |
|
|
MPI_Offset |
starts[3], |
|
|
MPI_Offset |
counts[3], |
|
|
int |
gsizes[3], |
|
|
double * |
localData |
|
) |
| |
Read a parallel-nedcdf file.
We assume here that localData is a scalar.
Pnetcdf uses row-major format (same as FFTW).
- Parameters
-
[in] | filename | : PnetCDF filename |
[in] | starts | : offset to where to start reading data |
[in] | counts | : number of elements read (3D sub-domain inside global) |
[in] | gsizes | : global sizes |
[out] | localData | : actual data buffer (size : nx*ny*nz*sizeof(double)) |
localData must have been allocated prior to calling this routine.
void write_pnetcdf |
( |
const std::string & |
filename, |
|
|
MPI_Offset |
starts[3], |
|
|
MPI_Offset |
counts[3], |
|
|
int |
gsizes[3], |
|
|
double * |
localData |
|
) |
| |
Write a parallel-nedcdf file.
We assume here that localData is a scalar.
Pnetcdf uses row-major format (same as FFTW).
- Parameters
-
[in] | filename | : PnetCDF filename |
[in] | starts | : offset to where to start reading data |
[in] | counts | : number of elements read (3D sub-domain inside global) |
[in] | gsizes | : global sizes |
[in] | localData | : actual data buffer (size : nx*ny*nz*sizeof(double)) |