17 #include "src_mathlib/mathlib.h"
23 extern CkVec <CProxy_FFTcache> UfftCacheProxy;
27 CmiNodeLock FFTcache::fftw_plan_lock;
30 void initFFTLock(
void) {
31 FFTcache::fftw_plan_lock = CmiCreateLock();
40 int _ngrida,
int _ngridb,
int _ngridc,
41 int _ngridaEext,
int _ngridbEext,
int _ngridcEext,
42 int _ees_eext_on,
int _ngridaNL,
int _ngridbNL,
int _ngridcNL,
43 int _ees_NL_on,
int _nlines_max,
int _nlines_max_rho,
44 int _nchareGState,
int _nchareRState,
45 int _nchareGNL,
int _nchareRNL,
46 int _nchareGRho,
int _nchareRRho,
int _nchareRRhoTot,
47 int _nchareGEext,
int _nchareREext,
int _nchareREextTot,
48 int *numGState,
int *numRXState,
int *numRYState,
int *numRYStateLower,
49 int *numGNL,
int *numRXNL,
int *numRYNL,
int *numRYNLLower,
50 int *numGRho,
int *numRXRho,
int *numRYRho ,
51 int *numGEext,
int *numRXEext,
int *numRYEext ,
52 int _fftopt,
int _nsplitR,
int _nsplitG,
53 int _rhoRsubPlanes,
UberCollection _thisInstance): thisInstance(_thisInstance){
56 if ( CmiMyRank() == 0 ) {
62 double *din;
double *dout;
73 ngridaEext = _ngridaEext;
74 ngridbEext = _ngridbEext;
75 ngridcEext = _ngridcEext;
76 ees_eext_on = _ees_eext_on;
81 ees_NL_on = _ees_NL_on;
83 int nlines_max = _nlines_max;
84 int nlines_max_rho = _nlines_max_rho;
88 nchareGState = _nchareGState;
89 nchareRState = _nchareRState;
90 nchareGNL = _nchareGNL;
91 nchareRNL = _nchareRNL;
92 nchareGRho = _nchareGRho;
93 nchareRRho = _nchareRRho;
94 nchareRRhoTot = _nchareRRhoTot;
95 nchareGEext = _nchareGEext;
96 nchareREext = _nchareREext;
97 nchareREextTot = _nchareREextTot;
98 rhoRsubPlanes = _rhoRsubPlanes;
117 if(iopt<0 || iopt>1){
118 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
119 CkPrintf(
"Bad fft option, dude! %d\n",iopt);
120 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
123 CmiLock(fftw_plan_lock);
128 int pGsize = nlines_max*ngridc;
129 int pGsizeHart = nlines_max_rho*ngridc;
130 int pGsizeNL = nlines_max*ngridcNL;
131 int pGsizeEext = nlines_max_rho*ngridcEext;
133 int pRsize = (ngrida/2+1)*ngridb;
134 int pRsizeNL = (ngridaNL/2+1)*ngridbNL;
135 if(!config.doublePack){
136 pRsize = 2*ngrida*ngridb;
137 pRsizeNL = 2*ngridaNL*ngridbNL;
141 pmax = (pmax > pRsize ) ? pmax : pRsize;
142 pmax = (pmax > pGsizeHart) ? pmax : pGsizeHart;
144 if(ees_eext_on==1){pmax = (pmax>pGsizeEext) ? pmax : pGsizeEext;}
145 if(ees_NL_on ==1){pmax = (pmax>pGsizeNL) ? pmax : pGsizeNL;}
146 if(ees_NL_on ==1){pmax = (pmax>pRsizeNL) ? pmax : pRsizeNL;}
149 tmpDataR =
reinterpret_cast<double*
> (tmpData);
157 nf_max = (ngrida > ngridb) ? ngrida : ngridb;
158 nf_max = (ngridc > nf_max) ? ngridc : nf_max;
159 nwork1 = 0; nwork2 = 0; nwork2T = 0;
161 int iadd = (int) (2.3*(
double)nf_max);
162 if(nf_max<=2048){iadd=0;}
165 nwork2T = nwork1 + (2*nf_max+256)*64;
167 if(config.doublePack){
175 initFFTholder (&fwdYPlanState, &iopt,&nwork1,&nwork2T,&scale,&plus,&ngridb,
176 &skipC,&unit,nchareRState,&nsplitR,numRYState);
177 initFFTholder (&bwdYPlanState, &iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridb,
178 &skipC,&unit,nchareRState,&nsplitR,numRYState);
179 if(!config.doublePack){
180 initFFTholder (&fwdYPlanStateLower, &iopt,&nwork1,&nwork2T,&scale,&plus,&ngridb,
181 &skipC,&unit,nchareRState,&nsplitR,numRYStateLower);
182 initFFTholder (&bwdYPlanStateLower, &iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridb,
183 &skipC,&unit,nchareRState,&nsplitR,numRYStateLower);
186 if(config.doublePack){
187 initCRFFTholder(&fwdXPlanState, &iopt,&nwork1,&nwork2,&scale,&plus,&ngrida,
188 &skipR,&skipC,nchareRState,&nsplitR,numRXState);
189 initRCFFTholder(&bwdXPlanState, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngrida,
190 &skipR,&skipC,nchareRState,&nsplitR,numRXState);
192 initFFTholder (&fwdXPlanStateK, &iopt,&nwork1,&nwork2,&scale,&plus,&ngrida,
193 &unit,&skipC,nchareRState,&nsplitR,numRXState);
194 initFFTholder (&bwdXPlanStateK, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngrida,
195 &unit,&skipC,nchareRState,&nsplitR,numRXState);
198 initFFTholder (&fwdZPlanState, &iopt,&nwork1,&nwork2,&scale,&plus,&ngridc,
199 &unit, &ngridc,nchareGState,&nsplitG,numGState);
200 initFFTholder (&bwdZPlanState, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngridc,
201 &unit, &ngridc,nchareGState,&nsplitG,numGState);
202 char wisstring[1024];
203 snprintf(wisstring,1024,
"fftwwisdom_%d.dat",CkNumPes());
215 FILE *wisdomFile=fopen(wisstring,
"r");
216 if(wisdomFile ==NULL && CkMyPe()==0){
217 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_warning_@@@@@@@@@@@@@@@@@@@@\n");
218 CkPrintf(
"Can't open wisdom file %s plan creation will take a little longer\n",wisstring);
219 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_warning_@@@@@@@@@@@@@@@@@@@@\n");
222 if(wisdomFile != NULL && fftw_import_wisdom_from_file(wisdomFile)==FFTW_SUCCESS){
224 if(CkMyPe()==0) CkPrintf(
"[%d] FFTCache loaded FFTW Wisdom %s\n",CkMyPe(),wisstring);
226 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
227 CkPrintf(
"Wisdom load failed on CkMyPe() %d !\n",CkMyPe());
228 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
232 size[0] = ngrida; size[1] = ngridb; size[2] = 1;
233 if(config.doublePack){
234 fwdXPlanState.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size, FFTW_COMPLEX_TO_REAL,
235 FFTW_MEASURE | FFTW_IN_PLACE|FFTW_USE_WISDOM);
236 bwdXPlanState.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size, FFTW_REAL_TO_COMPLEX,
237 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
239 fwdXPlanStateK.fftwPlan = fftw_create_plan(ngrida, FFTW_FORWARD,
240 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
241 bwdXPlanStateK.fftwPlan = fftw_create_plan(ngrida, FFTW_BACKWARD,
242 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
244 fwdYPlanState.fftwPlan = fftw_create_plan(ngridb, FFTW_FORWARD,
245 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
246 bwdYPlanState.fftwPlan = fftw_create_plan(ngridb, FFTW_BACKWARD,
247 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
248 if(!config.doublePack){
249 fwdYPlanStateLower.fftwPlan = fftw_create_plan(ngridb, FFTW_FORWARD,
250 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
251 bwdYPlanStateLower.fftwPlan = fftw_create_plan(ngridb, FFTW_BACKWARD,
252 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
254 fwdZPlanState.fftwPlan = fftw_create_plan(ngridc,FFTW_FORWARD,
255 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
256 bwdZPlanState.fftwPlan = fftw_create_plan(ngridc,FFTW_BACKWARD,
257 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
266 nf_max = (ngrida > ngridb) ? ngrida : ngridb;
267 nf_max = (ngridc > nf_max) ? ngridc : nf_max;
268 nwork1 = 0; nwork2 = 0; nwork2T = 0;
270 int iadd = (int) (2.3*(
double)nf_max);
271 if(nf_max<=2048){iadd=0;}
274 nwork2T = nwork1 + (2*nf_max+256)*64;
277 if(config.doublePack){
285 if(rhoRsubPlanes==1){
286 initFFTholder (&fwdYPlanRho, &iopt,&nwork1,&nwork2T,&scale,&plus,&ngridb,
287 &skipC,&unit,nchareRRhoTot,&nsplitR,numRYRho);
288 initFFTholder (&bwdYPlanRho, &iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridb,
289 &skipC,&unit,nchareRRhoTot,&nsplitR,numRYRho);
291 initFFTholder (&fwdYPlanRhoS,&iopt,&nwork1,&nwork2,&scale,&plus,&ngridb,
292 &unit, &ngridb,nchareRRhoTot,&nsplitR,numRYRho);
293 initFFTholder (&bwdYPlanRhoS,&iopt,&nwork1,&nwork2,&scale,&mnus,&ngridb,
294 &unit, &ngridb,nchareRRhoTot,&nsplitR,numRYRho);
296 initCRFFTholder(&fwdXPlanRho, &iopt,&nwork1,&nwork2,&scale,&plus,&ngrida,
297 &skipR,&skipC,nchareRRhoTot,&nsplitR,numRXRho);
298 initRCFFTholder(&bwdXPlanRho, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngrida,
299 &skipR,&skipC,nchareRRhoTot,&nsplitR,numRXRho);
300 initFFTholder (&fwdZPlanRho, &iopt,&nwork1,&nwork2,&scale,&plus,&ngridc,
301 &unit, &ngridc,nchareGRho,&nsplitG,numGRho);
302 initFFTholder (&bwdZPlanRho, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngridc,
303 &unit, &ngridc,nchareGRho,&nsplitG,numGRho);
305 initFFTholder (&fwdZPlanRhoHart,&iopt,&nwork1,&nwork2,&scale,&plus,&ngridc,
306 &unit, &ngridc,nchareGEext,&nsplitG,numGEext);
309 size[0] = ngrida; size[1] = ngridb; size[2] = 1;
310 fwdXPlanRho.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size, FFTW_COMPLEX_TO_REAL,
311 FFTW_MEASURE | FFTW_IN_PLACE|FFTW_USE_WISDOM);
312 bwdXPlanRho.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size, FFTW_REAL_TO_COMPLEX,
313 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
314 fwdYPlanRho.fftwPlan = fftw_create_plan(ngridb, FFTW_FORWARD,
315 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
316 bwdYPlanRho.fftwPlan = fftw_create_plan(ngridb, FFTW_BACKWARD,
317 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
318 fwdYPlanRhoS.fftwPlan = fftw_create_plan(ngridb, FFTW_FORWARD,
319 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
320 bwdYPlanRhoS.fftwPlan = fftw_create_plan(ngridb, FFTW_BACKWARD,
321 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
322 fwdZPlanRho.fftwPlan = fftw_create_plan(ngridc,FFTW_FORWARD,
323 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
324 bwdZPlanRho.fftwPlan = fftw_create_plan(ngridc,FFTW_BACKWARD,
325 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
326 fwdZPlanRhoHart.fftwPlan=fftw_create_plan(ngridc,FFTW_FORWARD,
327 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
336 nf_max = (ngridaNL> ngridbNL) ? ngridaNL : ngridbNL;
337 nf_max = (ngridcNL > nf_max ) ? ngridcNL : nf_max;
338 nwork1 = 0; nwork2 = 0; nwork2T = 0;
340 int iadd = (int) (2.3*(
double)nf_max);
341 if(nf_max<=2048){iadd=0;}
344 nwork2T = nwork1 + (2*nf_max+256)*64;
346 if(config.doublePack){
348 skipC = ngridaNL/2+1;
355 initFFTholder (&fwdYPlanNL,&iopt,&nwork1,&nwork2T,&scale,&plus,&ngridbNL,
356 &skipC,&unit,nchareRNL,&nsplitR,numRYNL);
357 initFFTholder (&bwdYPlanNL,&iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridbNL,
358 &skipC,&unit,nchareRNL,&nsplitR,numRYNL);
359 if(!config.doublePack){
360 initFFTholder (&fwdYPlanNLLower,&iopt,&nwork1,&nwork2T,&scale,&plus,&ngridbNL,
361 &skipC,&unit,nchareRNL,&nsplitR,numRYNLLower);
362 initFFTholder (&bwdYPlanNLLower, &iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridbNL,
363 &skipC,&unit,nchareRNL,&nsplitR,numRYNLLower);
366 if(config.doublePack){
367 initCRFFTholder(&fwdXPlanNL,&iopt,&nwork1,&nwork2,&scale,&plus,&ngridaNL,
368 &skipR,&skipC,nchareRNL,&nsplitR,numRXNL);
369 initRCFFTholder(&bwdXPlanNL,&iopt,&nwork1,&nwork2,&scale,&mnus,&ngridaNL,
370 &skipR,&skipC,nchareRNL,&nsplitR,numRXNL);
372 initFFTholder (&fwdXPlanNLK, &iopt,&nwork1,&nwork2,&scale,&plus,&ngridaNL,
373 &unit,&skipC,nchareRNL,&nsplitR,numRXNL);
374 initFFTholder (&bwdXPlanNLK, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngridaNL,
375 &unit,&skipC,nchareRNL,&nsplitR,numRXNL);
377 initFFTholder (&fwdZPlanNL,&iopt,&nwork1,&nwork2,&scale,&plus,&ngridcNL,
378 &unit, &ngridcNL,nchareGNL,&nsplitG,numGNL);
379 initFFTholder (&bwdZPlanNL,&iopt,&nwork1,&nwork2,&scale,&mnus,&ngridcNL,
380 &unit, &ngridcNL,nchareGNL,&nsplitG,numGNL);
383 if(iopt==0 && ees_NL_on){
384 size[0] = ngridaNL; size[1] = ngridbNL; size[2] = 1;
385 if(config.doublePack){
386 fwdXPlanNL.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size, FFTW_COMPLEX_TO_REAL,
387 FFTW_MEASURE | FFTW_IN_PLACE|FFTW_USE_WISDOM);
388 bwdXPlanNL.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size,FFTW_REAL_TO_COMPLEX,
389 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
391 fwdXPlanNLK.fftwPlan = fftw_create_plan(ngridaNL, FFTW_FORWARD,
392 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
393 bwdXPlanNLK.fftwPlan = fftw_create_plan(ngridaNL, FFTW_BACKWARD,
394 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
396 fwdYPlanNL.fftwPlan = fftw_create_plan(ngridbNL, FFTW_FORWARD,
397 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
398 bwdYPlanNL.fftwPlan = fftw_create_plan(ngridbNL, FFTW_BACKWARD,
399 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
400 if(!config.doublePack){
401 fwdYPlanNLLower.fftwPlan = fftw_create_plan(ngridbNL, FFTW_FORWARD,
402 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
403 bwdYPlanNLLower.fftwPlan = fftw_create_plan(ngridbNL, FFTW_BACKWARD,
404 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
406 fwdZPlanNL.fftwPlan = fftw_create_plan(ngridcNL,FFTW_FORWARD,
407 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
408 bwdZPlanNL.fftwPlan = fftw_create_plan(ngridcNL,FFTW_BACKWARD,
409 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
418 nf_max = (ngridaEext> ngridbEext) ? ngridaEext : ngridbEext;
419 nf_max = (ngridcEext > nf_max ) ? ngridcEext : nf_max;
420 nwork1 = 0; nwork2 = 0; nwork2T = 0;
422 int iadd = (int) (2.3*(
double)nf_max);
423 if(nf_max<=2048){iadd=0;}
426 nwork2T = nwork1 + (2*nf_max+256)*64;
428 skipR = ngridaEext+2;
429 skipC = ngridaEext/2+1;
432 if(rhoRsubPlanes==1){
433 initFFTholder (&fwdYPlanEext ,&iopt,&nwork1,&nwork2T,&scale,&plus,&ngridbEext,
434 &skipC,&unit,nchareREextTot,&nsplitR,numRYEext);
435 initFFTholder (&bwdYPlanEext ,&iopt,&nwork1,&nwork2T,&scale,&mnus,&ngridbEext,
436 &skipC,&unit,nchareREextTot,&nsplitR,numRYEext);
438 initFFTholder (&fwdYPlanEextS,&iopt,&nwork1,&nwork2,&scale,&plus,&ngridbEext,
439 &unit, &ngridbEext,nchareREextTot,&nsplitR,numRYEext);
440 initFFTholder (&bwdYPlanEextS,&iopt,&nwork1,&nwork2,&scale,&mnus,&ngridbEext,
441 &unit, &ngridbEext,nchareREextTot,&nsplitR,numRYEext);
443 initCRFFTholder(&fwdXPlanEext, &iopt,&nwork1,&nwork2,&scale,&plus,&ngridaEext,
444 &skipR,&skipC,nchareREextTot,&nsplitR,numRXEext);
445 initRCFFTholder(&bwdXPlanEext, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngridaEext,
446 &skipR,&skipC,nchareREextTot,&nsplitR,numRXEext);
447 initFFTholder (&fwdZPlanEext, &iopt,&nwork1,&nwork2,&scale,&plus,&ngridcEext,
448 &unit, &ngridcEext,nchareGEext,&nsplitG,numGEext);
449 initFFTholder (&bwdZPlanEext, &iopt,&nwork1,&nwork2,&scale,&mnus,&ngridcEext,
450 &unit, &ngridcEext,nchareGEext,&nsplitG,numGEext);
453 size[0] = ngridaEext; size[1] = ngridbEext; size[2] = 1;
454 fwdXPlanEext.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size,FFTW_COMPLEX_TO_REAL,
455 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
456 bwdXPlanEext.rfftwPlan = rfftwnd_create_plan(1, (
const int*)size,FFTW_REAL_TO_COMPLEX,
457 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
458 fwdYPlanEext.fftwPlan = fftw_create_plan(ngridbEext, FFTW_FORWARD,
459 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
460 bwdYPlanEext.fftwPlan = fftw_create_plan(ngridbEext, FFTW_BACKWARD,
461 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
462 fwdYPlanEextS.fftwPlan = fftw_create_plan(ngridbEext, FFTW_FORWARD,
463 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
464 bwdYPlanEextS.fftwPlan = fftw_create_plan(ngridbEext, FFTW_BACKWARD,
465 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
466 fwdZPlanEext.fftwPlan = fftw_create_plan(ngridcEext,FFTW_FORWARD,
467 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
468 bwdZPlanEext.fftwPlan = fftw_create_plan(ngridcEext,FFTW_BACKWARD,
469 FFTW_MEASURE | FFTW_IN_PLACE | FFTW_USE_WISDOM);
471 if(iopt==0 && CkMyPe()==0){
472 FILE *wisdomFile=fopen(wisstring,
"w");
473 if(wisdomFile ==NULL){
474 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
475 CkPrintf(
"Can't open wisdom file %s for writing\n",wisstring);
476 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
478 fftw_export_wisdom_to_file(wisdomFile);
479 CkPrintf(
"Wisdom %s written\n",wisstring);
483 CmiUnlock(fftw_plan_lock);
498 int numPoints,
int nfftz)
513 bzero(data,
sizeof(
complex)*numFull);
516 int nsub = (nfftz-runs[0].nz);
518 for (
int r = 0,l=0; r < numRuns; r+=2,l++) {
520 int joff1 = l*nfftz + runs[r].z + nsub;
521 for (
int i=0,j=joff1,k=koff; i<runs[r].length; i++,j++,k++) {
522 if(j<0 || j>nfftz*numRuns){printf(
"ecch!!! %d\n",j);CkExit();}
523 data[j] = packedData[k];
525 koff += runs[r].length;
528 int joff2 = l*nfftz + runs[r1].z;
529 for (
int i=0,j=joff2,k=koff; i<runs[r1].length; i++,j++,k++) {
530 if(j<0 || j>nfftz*numRuns){printf(
"ecch!!! %d\n",j);CkExit();}
531 data[j] = packedData[k];
533 koff += runs[r1].length;
536 int joff3 = joff2+runs[r1].length;
537 for(
int j=joff3;j<joff1;j++){data[j]=0.0;}
541 CkAssert(numPoints == koff);
555 int numPoints,
int nfftz)
569 int nsub = (nfftz-runs[0].nz);
570 for (
int r = 0,l=0; r < numRuns; r+=2,l++) {
572 int joff = l*nfftz + runs[r].z + nsub;
573 for (
int i=0,j=joff,k=koff; i<runs[r].length; i++,j++,k++) {
574 packedData[k] = data[j];
576 koff += runs[r].length;
579 joff = l*nfftz + runs[r1].z;
580 for (
int i=0,j=joff,k=koff; i<runs[r1].length; i++,j++,k++) {
581 packedData[k] = data[j];
583 koff += runs[r1].length;
586 CkAssert(numPoints == koff);
599 int numFull,
int numPoints,
601 int nfftz,
int index){
608 (fftw_complex *)data_in,
612 config.fftprogresssplit,
619 packGSpace(data_in,data_out,runs,numRuns,numFull,numPoints,nfftz);
633 int numFull,
int numPoints,
int numLines,
int numRuns,
638 expandGSpace(data_out,data_in,runs,numRuns,numFull,numPoints,nfftz);
646 (fftw_complex *)data_out,
650 config.fftprogresssplit,
665 int numFull,
int numPoints,
int numLines,
int numRuns,
670 expandGSpace(data_out,data_in,runs,numRuns,numFull,numPoints,nfftz);
678 (fftw_complex *)data_out,
682 config.fftprogresssplit,
697 int sizeX,
int sizeY,
int index){
702 if (config.doublePack){
711 config.fftprogresssplitReal,
715 if(bwdXPlanNL.option==0){
716 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
723 (fftw_complex *)dataC,
727 config.fftprogresssplitReal,
738 (fftw_complex *)dataC,
742 config.fftprogresssplitReal,
746 if(!config.doublePack){
747 int nplane_xm1 = nplane_x - 1;
748 int ioff = sizeX-nplane_x+1;
752 (fftw_complex *)(&dataC[ioff]),
756 config.fftprogresssplitReal,
772 int sizeX,
int sizeY,
int index){
778 if (config.doublePack){
787 (fftw_complex *)(dataC),
791 config.fftprogresssplitReal,
795 if(!config.doublePack){
796 int nplane_xm1 = nplane_x - 1;
797 int ioff = sizeX-nplane_x+1;
801 (fftw_complex *)(&dataC[ioff]),
805 config.fftprogresssplitReal,
811 if(config.doublePack){
812 if(fwdXPlanNL.option==0){
813 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
820 if(config.doublePack){
824 (fftw_complex *)dataC,
828 config.fftprogresssplitReal,
835 (fftw_complex *)dataC,
839 config.fftprogresssplitReal,
857 int nfftz,
int index){
864 (fftw_complex *)data,
868 config.fftprogresssplit,
875 getCacheMem(
"doEextFFTRtoG_Gchare");
876 packGSpace(data,tmpData,runs,numRuns,numFull,numPoints,nfftz);
877 CmiMemcpy(data,tmpData,
sizeof(
complex)*numPoints);
878 freeCacheMem(
"doEextFFTRtoG_Gchare");
891 int numFull,
int numPoints,
int numLines,
893 int nfftz,
int index){
897 expandGSpace(data_out,data_in,runs,numRuns,numFull,numPoints,nfftz);
905 (fftw_complex *)data_out,
909 config.fftprogresssplit,
924 int sizeX,
int sizeY,
int index){
935 config.fftprogresssplitReal,
939 int stride = sizeX/2+1;
941 if(bwdXPlanEext.option==0){
942 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
951 (fftw_complex *)dataC,
955 config.fftprogresssplitReal,
970 int sizeX,
int sizeY,
int index){
981 config.fftprogresssplitReal,
985 int stride = sizeX/2+1;
986 if(bwdXPlanEext.option==0){
987 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1002 int sizeX,
int sizeY,
int index){
1009 (fftw_complex *)dataC,
1013 config.fftprogresssplitReal,
1029 int sizeX,
int sizeY,
int index){
1034 int stride = sizeX/2+1;
1038 (fftw_complex *)(dataC),
1042 config.fftprogresssplitReal,
1047 if(fwdXPlanEext.option==0){
1048 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1057 (fftw_complex *)dataC,
1061 config.fftprogresssplitReal,
1076 int sizeX,
int sizeY,
int index){
1080 int stride = sizeX/2+1;
1081 if(fwdXPlanEext.option==0){
1082 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1088 (fftw_complex *)dataC,
1092 config.fftprogresssplitReal,
1107 int sizeX,
int sizeY,
int index){
1115 (fftw_complex *)(dataC),
1119 config.fftprogresssplitReal,
1136 int numFull,
int numPoints,
1138 int nfftz,
int index){
1145 (fftw_complex *)data_in,
1149 config.fftprogresssplit,
1156 packGSpace(data_in,data_out,runs,numRuns,numFull,numPoints,nfftz);
1170 int numFull,
int numPoints,
1172 int nfftz,
int index){
1178 expandGSpace(data_out,data_in,runs,numRuns,numFull,numPoints,nfftz);
1186 (fftw_complex *)data_out,
1190 config.fftprogresssplit,
1204 int sizeX,
int sizeY,
int index){
1211 if(config.doublePack){
1220 (fftw_complex *)(dataC),
1224 config.fftprogresssplitReal,
1228 if(!config.doublePack){
1229 int nplane_xm1 = nplane_x - 1;
1230 int ioff = sizeX-nplane_x+1;
1232 &fwdYPlanStateLower,
1234 (fftw_complex *)(&dataC[ioff]),
1238 config.fftprogresssplitReal,
1245 if(config.doublePack){
1246 if(fwdXPlanState.option==0){
1247 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1254 if(config.doublePack){
1258 (fftw_complex *)dataC,
1262 config.fftprogresssplitReal,
1269 (fftw_complex *)dataC,
1273 config.fftprogresssplitReal,
1289 int sizeX,
int sizeY,
int index){
1295 if(config.doublePack){
1304 config.fftprogresssplitReal,
1308 if(bwdXPlanState.option==0){
1309 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1316 (fftw_complex *)dataC,
1320 config.fftprogresssplitReal,
1331 (fftw_complex *)dataC,
1335 config.fftprogresssplitReal,
1339 if(!config.doublePack){
1340 int nplane_xm1 = nplane_x - 1;
1341 int ioff = sizeX - nplane_x + 1;
1343 &bwdYPlanStateLower,
1345 (fftw_complex *)(&dataC[ioff]),
1349 config.fftprogresssplitReal,
1366 int numFull,
int numPoints,
1368 int nfftz,
int iexpand,
int index){
1373 expandGSpace(data_out,data_in,runs,numRuns,numFull,numPoints,nfftz);
1382 (fftw_complex *)data_out,
1386 config.fftprogresssplit,
1402 int numFull,
int numPoints,
1404 int nfftz,
int ipack,
int index){
1411 (fftw_complex *)data_in,
1415 config.fftprogresssplit,
1423 packGSpace(data_in,data_out,runs,numRuns,numFull,numPoints,nfftz);
1438 int sizeX,
int sizeY,
int index)
1451 config.fftprogresssplitReal,
1455 int stride = sizeX/2+1;
1456 if(bwdXPlanRho.option==0){
1457 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1466 (fftw_complex *)dataC,
1470 config.fftprogresssplitReal,
1483 int sizeX,
int sizeY,
int index)
1496 config.fftprogresssplitReal,
1500 int stride = sizeX/2+1;
1501 if(bwdXPlanRho.option==0){
1502 for (
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1515 int sizeX,
int sizeY,
int index)
1524 (fftw_complex *)dataC,
1528 config.fftprogresssplitReal,
1542 int sizeX,
int sizeY,
int index){
1547 int stride = sizeX/2+1;
1551 (fftw_complex *)(dataC),
1555 config.fftprogresssplitReal,
1560 if(fwdXPlanRho.option==0){
1561 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1570 (fftw_complex *)dataC,
1574 config.fftprogresssplitReal,
1587 int sizeX,
int sizeY,
int index){
1595 (fftw_complex *)(dataC),
1599 config.fftprogresssplitReal,
1612 int sizeX,
int sizeY,
int index){
1616 int stride = sizeX/2+1;
1617 if(fwdXPlanRho.option==0){
1618 for(
int i=0;i<stride*sizeY;i++){dataC[i].im = -dataC[i].im;}
1624 (fftw_complex *)dataC,
1628 config.fftprogresssplitReal,
1646 fftw_complex *in,
int istride_in,
int idist_in,
1647 fftw_complex *out_in,
int ostride_in,
int odist_in,
int split,
1653 fftw_plan plan = fftplanholder->fftwPlan;
1654 int iopt = fftplanholder->option;
1655 int isign = fftplanholder->isign;
1656 int nfft = fftplanholder->nfft;
1657 int nwork1 = fftplanholder->nwork1;
1658 int nwork2 = fftplanholder->nwork2;
1659 double scale = fftplanholder->scale;
1660 double *work1r = NULL;
1661 double *work2r = NULL;
1662 double *work1s = fftplanholder->work1;
1663 double *work2s = fftplanholder->work2;
1666 int istride = istride_in;
1667 int idist = idist_in;
1668 int ostride = ostride_in;
1669 int odist = odist_in;
1670 fftw_complex *out = out_in;
1672 ostride = fftplanholder->ostride;
1673 odist = fftplanholder->odist;
1674 out = (out==NULL) ? in : out ;
1675 int kkk = fftplanholder->mapp[index];
1676 work1r = fftplanholder->essl_work[kkk].work1;
1677 work2r = fftplanholder->essl_work[kkk].work2;
1680 int thismany = split;
1681 int inleft = howmany;
1682 int numsplits = howmany/split;
1683 if(numsplits<=0){numsplits=1;}
1684 if(howmany>split && howmany%split!=0){numsplits++;}
1691 for(
int i=0;i<numsplits;i++){
1693 double *work1 = work1s;
double *work2 = work2s;
1694 if(inleft<split){thismany=inleft;work1=work1r,work2=work2r;}
1696 CkAssert((
unsigned int) &(in[inoff]) % 16 ==0);
1697 CkAssert((
unsigned int) &(out[outoff]) % 16 ==0);
1699 fftw_complex *dummy = (out==NULL) ? NULL : &(out[outoff]) ;
1712 case 1: dcftWrap(&zero,(
complex *)&(in[inoff]),&istride,&idist,
1713 (
complex *)dummy,&ostride,&odist,
1714 &nfft,&thismany,&isign,&scale,work1,&nwork1,work2, &nwork2);
1716 default : CkAbort(
"impossible fft iopt");
break;
1718 inoff += idist*(thismany);
1719 outoff += odist*(thismany);
1737 fftw_complex *in,
int istride_in,
int idist_in,
1738 fftw_real *out_in,
int ostride_in,
int odist_in,
int split,
int index)
1743 rfftwnd_plan plan = rfftplanholder->rfftwPlan;
1744 int iopt = rfftplanholder->option;
1745 int isign = rfftplanholder->isign;
1746 int nfft = rfftplanholder->nfft;
1747 int nwork1 = rfftplanholder->nwork1;
1748 int nwork2 = rfftplanholder->nwork2;
1749 double scale = rfftplanholder->scale;
1750 double *work1r = NULL;
1751 double *work2r = NULL;
1752 double *work1s = rfftplanholder->work1;
1753 double *work2s = rfftplanholder->work2;
1756 int istride = istride_in;
1757 int idist = idist_in;
1758 int ostride = ostride_in;
1759 int odist = odist_in;
1760 fftw_real *out = out_in;
1762 ostride = rfftplanholder->ostride;
1763 odist = rfftplanholder->odist;
1765 out =
reinterpret_cast<double*
> (in);
1767 int kkk = rfftplanholder->mapp[index];
1768 work1r = rfftplanholder->essl_work[kkk].work1;
1769 work2r = rfftplanholder->essl_work[kkk].work2;
1772 int thismany = split;
1773 int inleft = howmany;
1774 int numsplits = howmany/split;
1775 if(numsplits<=0){numsplits=1;}
1776 if(howmany>split && howmany%split!=0){numsplits++;}
1783 for(
int i=0;i<numsplits;i++){
1785 double *work1 = work1s;
double *work2 = work2s;
1786 if(inleft<split){thismany=inleft;work1=work1r,work2=work2r;}
1788 CkAssert((
unsigned int) &(in[inoff]) % 16 ==0);
1789 CkAssert((
unsigned int) &(out[outoff]) % 16 ==0);
1791 fftw_real *dummy = (out==NULL) ? NULL : &(out[outoff]);
1794 rfftwnd_complex_to_real(
1804 case 1: dcrftWrap(&zero,(
complex *)&(in[inoff]),&idist,(
double *)dummy,&odist,
1805 &nfft,&thismany,&isign,&scale,work1,&nwork1,work2,&nwork2);
break;
1806 default : CkAbort(
"impossible fft iopt");
break;
1808 inoff += idist*(thismany);
1809 outoff += odist*(thismany);
1828 fftw_real *in,
int istride_in,
int idist_in,
1829 fftw_complex *out_in,
int ostride_in,
int odist_in,
int split,
int index)
1834 rfftwnd_plan plan = rfftplanholder->rfftwPlan;
1835 int iopt = rfftplanholder->option;
1836 int isign = rfftplanholder->isign;
1837 int nfft = rfftplanholder->nfft;
1838 int nwork1 = rfftplanholder->nwork1;
1839 int nwork2 = rfftplanholder->nwork2;
1840 double scale = rfftplanholder->scale;
1841 double *work1r = NULL;
1842 double *work2r = NULL;
1843 double *work1s = rfftplanholder->work1;
1844 double *work2s = rfftplanholder->work2;
1847 int istride = istride_in;
1848 int idist = idist_in;
1849 int ostride = ostride_in;
1850 int odist = odist_in;
1851 fftw_complex *out = out_in;
1853 ostride = rfftplanholder->ostride;
1854 odist = rfftplanholder->odist;
1856 out =
reinterpret_cast<fftw_complex*
> (in);
1858 int kkk = rfftplanholder->mapp[index];
1859 work1r = rfftplanholder->essl_work[kkk].work1;
1860 work2r = rfftplanholder->essl_work[kkk].work2;
1863 int thismany = split;
1864 int inleft = howmany;
1865 int numsplits = howmany/split;
1866 if(numsplits<=0){numsplits=1;}
1867 if(howmany>split && howmany%split!=0){numsplits++;}
1873 for(
int i=0;i<numsplits;i++){
1875 double *work1 = work1s;
double *work2 = work2s;
1876 if(inleft<split){thismany=inleft;work1=work1r,work2=work2r;}
1878 CkAssert((
unsigned int) &(in[inoff]) % 16 ==0);
1879 CkAssert((
unsigned int) &(out[outoff]) % 16 ==0);
1881 fftw_complex *dummy = (out==NULL) ? NULL : &(out[outoff]);
1884 rfftwnd_real_to_complex(
1894 case 1: drcftWrap(&zero,(
double *)&(in[inoff]),&idist,(
complex *)dummy,&odist,
1895 &nfft,&thismany,&isign,&scale,work1,&nwork1,work2,&nwork2);
break;
1896 default : CkAbort(
"impossible fft iopt");
break;
1898 inoff += idist*(thismany);
1899 outoff += odist*(thismany);
1913 void initFFTholder(
FFTplanHolder *plan,
int *iopt,
int *nwork1,
int *nwork2,
double *scale,
1914 int *isign,
int *nfft,
int *stride,
int *skip,
int nchare,
int *nsplit,
1918 plan->option = iopt[0];
1919 plan->nwork1 = nwork1[0];
1920 plan->nwork2 = nwork2[0];
1921 plan->scale = scale[0];
1922 plan->isign = isign[0];
1923 plan->nfft = nfft[0];
1924 plan->ostride = stride[0];
1925 plan->odist = skip[0];
1928 plan->nsplit = nsplit[0];
1929 plan->nchare = nchare;
1935 int *index =
new int[nchare];
1936 int *mappI =
new int[nchare];
1937 int *mapp =
new int[nchare];
1938 make_essl_work_map(nchare,num,index,mappI,mapp,&nval,&nmax,nsplit[0]);
1942 for(
int i = 0; i<nval;i++){
1943 plan->essl_work[i].num = index[i];
1944 plan->essl_work[i].work1 = NULL;
1945 plan->essl_work[i].work2 = NULL;
1947 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
1948 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
1949 dcftWrap(&unit,x,stride,skip,x,stride,skip,nfft,&index[i],isign,scale,
1950 work1,nwork1,work2,nwork2);
1951 plan->essl_work[i].work1 = work1;
1952 plan->essl_work[i].work2 = work2;
1955 if(nsplit[0]<=nmax){
1956 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
1957 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
1958 dcftWrap(&unit,x,stride,skip,x,stride,skip,nfft,nsplit,isign,scale,
1959 work1,nwork1,work2,nwork2);
1960 plan->work1 = work1;
1961 plan->work2 = work2;
1975 void initRCFFTholder(
RFFTplanHolder *plan,
int *iopt,
int *nwork1,
int *nwork2,
double *scale,
1976 int *isign,
int *nfft,
int *skipR,
int *skipC,
int nchare,
int *nsplit,
1980 plan->option = iopt[0];
1981 plan->nwork1 = nwork1[0];
1982 plan->nwork2 = nwork2[0];
1983 plan->scale = scale[0];
1984 plan->isign = isign[0];
1985 plan->nfft = nfft[0];
1987 plan->odist = skipC[0];
1990 plan->nsplit = nsplit[0];
1991 plan->nchare = nchare;
1997 int *index =
new int[nchare];
1998 int *mappI =
new int[nchare];
1999 int *mapp =
new int[nchare];
2000 make_essl_work_map(nchare,num,index,mappI,mapp,&nval,&nmax,nsplit[0]);
2004 for(
int i = 0; i<nval;i++){
2005 plan->essl_work[i].num = index[i];
2006 plan->essl_work[i].work1 = NULL;
2007 plan->essl_work[i].work2 = NULL;
2009 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
2010 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
2011 drcftWrap(&unit,xr,skipR,xc,skipC,nfft,&index[i],isign,scale,work1,nwork1,work2,nwork2);
2012 plan->essl_work[i].work1 = work1;
2013 plan->essl_work[i].work2 = work2;
2016 if(nsplit[0]<=nmax){
2017 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
2018 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
2019 drcftWrap(&unit,xr,skipR,xc,skipC,nfft,nsplit,isign,scale,work1,nwork1,work2,nwork2);
2020 plan->work1 = work1;
2021 plan->work2 = work2;
2035 void initCRFFTholder(
RFFTplanHolder *plan,
int *iopt,
int *nwork1,
int *nwork2,
double *scale,
2036 int *isign,
int *nfft,
int *skipR,
int *skipC,
int nchare,
int *nsplit,
2040 plan->option = iopt[0];
2041 plan->nwork1 = nwork1[0];
2042 plan->nwork2 = nwork2[0];
2043 plan->scale = scale[0];
2044 plan->isign = isign[0];
2045 plan->nfft = nfft[0];
2047 plan->odist = skipR[0];
2050 plan->nsplit = nsplit[0];
2051 plan->nchare = nchare;
2057 int *index =
new int[nchare];
2058 int *mappI =
new int[nchare];
2059 int *mapp =
new int[nchare];
2060 make_essl_work_map(nchare,num,index,mappI,mapp,&nval,&nmax,nsplit[0]);
2064 for(
int i = 0; i<nval;i++){
2065 plan->essl_work[i].num = index[i];
2066 plan->essl_work[i].work1 = NULL;
2067 plan->essl_work[i].work2 = NULL;
2069 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
2070 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
2071 dcrftWrap(&unit,xc,skipC,xr,skipR,nfft,&index[i],isign,scale,work1,nwork1,work2,nwork2);
2072 plan->essl_work[i].work1 = work1;
2073 plan->essl_work[i].work2 = work2;
2076 if(nsplit[0]<=nmax){
2077 double *work1 = (
double*) fftw_malloc(nwork1[0]*
sizeof(
double));
2078 double *work2 = (
double*) fftw_malloc(nwork2[0]*
sizeof(
double));
2079 dcrftWrap(&unit,xc,skipC,xr,skipR,nfft,nsplit,isign,scale,work1,nwork1,work2,nwork2);
2080 plan->work1 = work1;
2081 plan->work2 = work2;
2094 void make_essl_work_map(
int nchare,
int *num,
int *index,
int *mappI,
int *mapp,
2095 int *nval_out,
int *nmax_out,
int nsplit){
2099 for(
int i=0;i<nchare;i++){
2100 nmax = (nmax > num[i] ? nmax : num[i]);
2102 index[i] = (num[i] % nsplit);
2105 sort_commence(nchare,index,mappI);
2109 for(
int i=1;i<nchare;i++){
2110 if(index[i]!=index[j]){j++; index[j]=index[i];}
void doNlFFTRtoG_Rchare(complex *, double *, int, int, int, int)
non-local : Rchare : data(x,y,z) -> data(gx,gy,z) : backward ////////////////////////////////////////...
void rfftwnd_complex_to_real_split(RFFTplanHolder *rfftplanholder, int howmany, fftw_complex *in, int istride_in, int idist_in, fftw_real *out_in, int ostride_in, int odist_in, int split, int index)
split up an fft call into multiple invocations with cmiprogress calls between them.
holds the UberIndex and the offset for proxies
void doStpFFTGtoR_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
StatePlane : Gchare : data(gx,gy,gz) -> data(gx,gy,z) : forward /////////////////////////////////////...
void doEextFFTGxToRx_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(gx,gy,z) -> data(x,y,z) : forward //////////////////////////////////////////////...
void rfftwnd_real_to_complex_split(RFFTplanHolder *rfftplanholder, int howmany, fftw_real *in, int istride_in, int idist_in, fftw_complex *out_in, int ostride_in, int odist_in, int split, int index)
split up an fft call into multiple invocations with cmiprogress calls between them.
void doStpFFTRtoG_Rchare(complex *, double *, int, int, int, int)
////////////////////////////////////////////////////////////////////////////= ///////////////////////...
void doStpFFTRtoG_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
StatePlane : Gchare : data(gx,gy,z) -> data(gx,gy,gz) : backward ////////////////////////////////////...
void doStpFFTGtoR_Rchare(complex *, double *, int, int, int, int)
void doEextFFTGtoR_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
Eext : Gchare : data(gx,gy,gz) -> data(gx,gy,z) : forward ///////////////////////////////////////////...
void doRhoFFTGtoR_Rchare(complex *, double *, int, int, int, int)
void fft_split(FFTplanHolder *fftplanholder, int howmany, fftw_complex *in, int istride_in, int idist_in, fftw_complex *out_in, int ostride_in, int odist_in, int split, int index)
split up an fft call into multiple invocations with cmiprogress calls between them.
= Holder classes for the plans : Allows many fft libaries to be used
void doEextFFTGtoR_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(gx,gy,z) -> data(x,y,z) : forward //////////////////////////////////////////////...
void doRhoFFTRxToGx_Rchare(complex *, double *, int, int, int, int)
void doEextFFTRtoG_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(x,y,z) -> data(gx,gy,z) : Backward /////////////////////////////////////////////...
void expandGSpace(complex *data, complex *packedData, RunDescriptor *runs, int numRuns, int numFull, int numPoints, int nfftz)
packed g-space of size numPoints is expanded to numFull =numRuns/2*nfftz ////////////////////////////...
Add type declarations for simulationConstants class (readonly vars) and once class for each type of o...
void doNlFFTRtoG_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
non-local : Gchare : data(gx,gy,z) -> data(gx,gy,gz) : backward /////////////////////////////////////...
void doRhoFFTGyToRy_Rchare(complex *, double *, int, int, int, int)
void doEextFFTRtoG_Gchare(complex *, int, int, int, int, RunDescriptor *, int, int)
Eext : Gchare : data(gx,gy,z) -> data(gx,gy,gz) : backward //////////////////////////////////////////...
void doNlFFTGtoR_Rchare(complex *, double *, int, int, int, int)
non-local : Rchare : data(gx,gy,z) -> data(x,y,z) : Forward /////////////////////////////////////////...
FFTcache(int _ngrida, int _ngridb, int _ngridc, int _ngridaEext, int _ngridbEext, int _ngridcEext, int _ees_eext_on, int _ngridaNL, int _ngridbNL, int _ngridcNL, int _ees_NL_on, int _nlines_max, int _nlines_max_rho, int _nchareGState, int _nchareRState, int _nchareGNL, int _nchareRNL, int _nchareGRho, int _nchareRRho, int _nchareRRhoTot, int _nchareGEext, int _nchareREext, int _nchareREextTot, int *numGState, int *numRXState, int *numRYState, int *numRYStateLower, int *numGNL, int *numRXNL, int *numRYNL, int *numRYNLLower, int *numGRho, int *numRXRho, int *numRYRho, int *numGEext, int *numRXEext, int *numRYEext, int _fftopt, int _nsplitR, int _nsplitG, int _rhoRsubPlanes, UberCollection _thisInstance)
= FFTcache - sets up a fftcache on each processor
void packGSpace(complex *data, complex *packedPlaneData, RunDescriptor *runs, int numRuns, int numFull, int numPoints, int nfftz)
packed g-space of size numPoints is expanded to numFull =numRuns/2*nfftz ////////////////////////////...
== Index logic for lines of constant x,y in gspace.
Some basic data structures and the array map classes are defined here.
void doRhoFFTRtoG_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int, int)
Rho Plane : Gchare : data(gx,gy,z) -> data(gx,gy,gz) : backward /////////////////////////////////////...
void doRhoFFTGtoR_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int, int)
rho Gchare : data(gx,gy,gz) -> data(gx,gy,z) : forward //////////////////////////////////////////////...
void doEextFFTRxToGx_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(x,y,z) -> data(gx,gy,z) : Backward /////////////////////////////////////////////...
void doEextFFTGyToRy_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(gx,gy,z) -> data(x,y,z) : forward //////////////////////////////////////////////...
void doRhoFFTGxToRx_Rchare(complex *, double *, int, int, int, int)
void doRhoFFTRtoG_Rchare(complex *, double *, int, int, int, int)
void doNlFFTGtoR_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
non-local : Gchare : data(gx,gy,gz) -> data(gx,gy,z) : forward //////////////////////////////////////...
void doEextFFTRyToGy_Rchare(complex *, double *, int, int, int, int)
Eext : Rchare : data(x,y,z) -> data(gx,gy,z) : Backward /////////////////////////////////////////////...
void doHartFFTGtoR_Gchare(complex *, complex *, int, int, int, int, RunDescriptor *, int, int)
Hartree : Gchare : data(gx,gy,gz) -> data(gx,gy,z) : forward ////////////////////////////////////////...
void doRhoFFTRyToGy_Rchare(complex *, double *, int, int, int, int)