141 if (dataSrc_in != NULL && dataSrc_in == dataDst_in)
142 NAMD_bug(
"FFTCompute::init, only out-of-place FFTs supported");
144 int permutationDst = permutation;
149 if (dataSrc_in == NULL) {
155 if (dataSrcSize_in < getDataSizeRequired(permutation, pmeGrid,
jblock,
kblock))
156 NAMD_bug(
"FFTCompute::init, invalid dataSrcSize_in");
162 if (dataDst_in == NULL) {
168 if (dataDstSize_in < getDataSizeRequired(permutationDst, pmeGrid,
jblock,
kblock))
169 NAMD_bug(
"FFTCompute::init, invalid dataDstSize_in");
179 NAMD_bug(
"FFTCompute::init, error setting up data buffers");
182 if (pmePencilType == 3) {
185 NAMD_bug(
"FFTCompute::init, 3D FFT requires a single pencil");
186 int n[3] = {pmeGrid.
K1, pmeGrid.
K2, pmeGrid.
K3};
188 }
else if (pmePencilType == 1) {
189 int i0, i1, j0, j1, k0, k1;
191 int n[1] = {i1-i0+1};
192 int howmany = (j1-j0+1)*(k1-k0+1);
194 plan1DX(n, howmany, flags);
196 plan1DY(n, howmany, flags);
198 plan1DZ(n, howmany, flags);
200 NAMD_bug(
"FFTCompute::init, invalid permutation");
202 }
else if (pmePencilType == 2) {
204 int i0, i1, j0, j1, k0, k1;
206 int n[2] = {pmeGrid.
K1, pmeGrid.
K2};
207 int howmany = k1-k0+1;
208 plan2D(n, howmany, flags);
210 NAMD_bug(
"FFTCompute::init, invalid pmePencilType");
static void getPencilDim(const PmeGrid &pmeGrid, const int permutation, const int jblock, const int kblock, int &i0, int &i1, int &j0, int &j1, int &k0, int &k1)
void NAMD_bug(const char *err_msg)