37 #include "src_piny_physics_v1.0/include/class_defs/CP_OPERATIONS/class_cplocal.h"
38 #include "src_piny_physics_v1.0/include/class_defs/CP_OPERATIONS/class_cpxcfnctls.h"
43 extern CkVec <CProxy_CP_Rho_RealSpacePlane> UrhoRealProxy;
44 extern CkVec <CProxy_CP_Rho_GHartExt> UrhoGHartExtProxy;
45 extern CkVec <CProxy_CP_State_GSpacePlane> UgSpacePlaneProxy;
46 extern CkVec <CProxy_GSpaceDriver> UgSpaceDriverProxy;
48 extern ComlibInstanceHandle commGInstance0;
49 extern ComlibInstanceHandle commGInstance1;
50 extern ComlibInstanceHandle commGInstance2;
51 extern ComlibInstanceHandle commGInstance3;
52 extern ComlibInstanceHandle commGByrdInstance;
53 extern CProxy_ComlibManager mgrProxy;
55 extern CkVec <CProxy_CP_Rho_GSpacePlane> UrhoGProxy;
56 extern CkVec <CProxy_FFTcache> UfftCacheProxy;
65 CP_Rho_GSpacePlane::CP_Rho_GSpacePlane(
int sizeX,
67 int numRealSpaceDensity,
70 thisInstance(_instance)
74 #ifdef _CP_DEBUG_RHOG_VERBOSE_
75 CkPrintf(
"[%d %d] Rho GS constructor\n",thisIndex.x,thisIndex.y);
81 cp_grad_corr_on = sim->cp_grad_corr_on;
83 iplane_ind = thisIndex.x;
84 rhoRsubplanes = config.rhoRsubplanes;
91 for(
int i=1;i<=3;i++){countWhiteByrd[i]=0;}
95 recvCountFromRRho = 0;
96 for(
int i=0;i<rhoRsubplanes;i++){
97 if(sim->nline_send_rho_y[thisIndex.x][i]>0){recvCountFromRRho++;}
99 recvCountFromRRho*=sizeZ;
101 recvCountFromRRho=sizeZ;
110 CkVec <RunDescriptor> *sortedRunDescriptors = sim->RhosortedRunDescriptors;
112 rho_gs.sizeX = sizeX;
113 rho_gs.sizeY = sim->sizeY;
114 rho_gs.sizeZ = sim->sizeZ;
118 rho_gs.numRuns = sortedRunDescriptors[x].size();
119 rho_gs.numLines = sortedRunDescriptors[x].size()/2;
120 rho_gs.numFull = (rho_gs.numLines)*rho_gs.sizeZ;
121 rho_gs.size = rho_gs.numFull;
123 rho_gs.numPoints = 0;
124 for (
int r = 0; r < rho_gs.numRuns; r++) {
125 rho_gs.numPoints += sortedRunDescriptors[x][r].length;
126 rho_gs.runs[r] = sortedRunDescriptors[x][r];
132 rho_gs.nPacked = nPacked;
137 int numFull = rho_gs.numFull;
144 rho_gs.packedVks = NULL;
145 rho_gs.packedRho = NULL;
150 rhoGHelpers = config.rhoGHelpers;
151 int num_line_tot = rho_gs.numLines;
152 numSplit =
new int [rhoGHelpers];
153 istrtSplit =
new int [rhoGHelpers];
154 iendSplit =
new int [rhoGHelpers];
158 for(
int i=0;i<rhoGHelpers;i++){
160 int istrt_line,iend_line,num_line;
161 getSplitDecomp(&istrt_line,&iend_line,&num_line,num_line_tot,rhoGHelpers,i);
164 for (
int r=(2*istrt_line);r<(2*iend_line);r++){
165 num_pts += sortedRunDescriptors[x][r].length;
168 istrtSplit[i] = istrt_pts;
169 numSplit[i] = num_pts;
170 iendSplit[i] = istrt_pts+num_pts;
172 istrt_pts += num_pts;
177 if(config.lbdensity){
180 setMigratable(
false);
195 if(sim->ees_nloc_on==1 && config.launchNLeesFromRho==2){
199 CkAssert(config.UberJmax<=1);
201 if(config.nchareRhoG<config.nchareG)
204 int gperrho=config.nchareG/config.nchareRhoG;
205 int grem= config.nchareG%config.nchareRhoG;
206 int startplane=thisIndex.x*gperrho;
207 int endplane=startplane;
209 endplane=startplane+gperrho;
211 if(grem>0 && thisIndex.x<grem)
213 CkArrayIndexMax *elems=
new CkArrayIndexMax[config.nstates*(gperrho+grem)];
216 for(
int plane=startplane;plane<=endplane;plane++)
217 for(
int state =0; state<config.nstates;state++)
219 CkArrayIndex2D idx2d(state,plane);
220 elems[ecount++]=idx2d;
223 int plane=config.nchareRhoG+thisIndex.x;
224 for(
int state =0; state<config.nstates;state++)
226 CkArrayIndex2D idx2d(state,plane);
227 elems[ecount++]=idx2d;
231 nlsectproxy = CProxySection_GSpaceDriver::ckNew(UgSpaceDriverProxy[thisInstance.proxyOffset].ckGetArrayID(),elems,ecount);
236 nlsectproxy = CProxySection_GSpaceDriver::ckNew(UgSpaceDriverProxy[thisInstance.proxyOffset].ckGetArrayID(),
237 0, config.nstates-1, 1,startplane, endplane, 1);
243 if(thisIndex.x<config.nchareG){
244 nlsectproxy = CProxySection_GSpaceDriver::ckNew(UgSpaceDriverProxy[thisInstance.proxyOffset].ckGetArrayID(),
245 0, config.nstates-1, 1,thisIndex.x, thisIndex.x, 1);
252 rhoRealProxy0_com = UrhoRealProxy[thisInstance.proxyOffset];
253 rhoRealProxy1_com = UrhoRealProxy[thisInstance.proxyOffset];
254 rhoRealProxy2_com = UrhoRealProxy[thisInstance.proxyOffset];
255 rhoRealProxy3_com = UrhoRealProxy[thisInstance.proxyOffset];
256 rhoRealProxyByrd_com = UrhoRealProxy[thisInstance.proxyOffset];
259 if(config.useGIns0RhoRP)
260 ComlibAssociateProxy(commGInstance0,rhoRealProxy0_com);
261 if(config.useGIns1RhoRP)
262 ComlibAssociateProxy(commGInstance1,rhoRealProxy1_com);
263 if(config.useGIns2RhoRP)
264 ComlibAssociateProxy(commGInstance2,rhoRealProxy2_com);
265 if(config.useGIns3RhoRP)
266 ComlibAssociateProxy(commGInstance3,rhoRealProxy3_com);
267 if(config.useGByrdInsRhoRBP)
268 ComlibAssociateProxy(commGByrdInstance,rhoRealProxyByrd_com);
277 CP_Rho_GSpacePlane::~CP_Rho_GSpacePlane(){
281 delete [] istrtSplit;
282 if(iendSplit != NULL)
290 void CP_Rho_GSpacePlane::pup(PUP::er &p){
291 ArrayElement2D::pup(p);
295 PUParray(p,countWhiteByrd,4);
301 numSplit =
new int[rhoGHelpers];
302 istrtSplit =
new int[rhoGHelpers];
303 iendSplit =
new int[rhoGHelpers];
305 PUParray(p,numSplit,rhoGHelpers);
306 PUParray(p,istrtSplit,rhoGHelpers);
307 PUParray(p,iendSplit,rhoGHelpers);
310 rhoRealProxy0_com = UrhoRealProxy[thisInstance.proxyOffset];
311 rhoRealProxy1_com = UrhoRealProxy[thisInstance.proxyOffset];
312 rhoRealProxy2_com = UrhoRealProxy[thisInstance.proxyOffset];
313 rhoRealProxy3_com = UrhoRealProxy[thisInstance.proxyOffset];
314 rhoRealProxyByrd_com = UrhoRealProxy[thisInstance.proxyOffset];
317 if(config.useGIns0RhoRP)
318 ComlibAssociateProxy(commGInstance0,rhoRealProxy0_com);
319 if(config.useGIns1RhoRP)
320 ComlibAssociateProxy(commGInstance1,rhoRealProxy1_com);
321 if(config.useGIns2RhoRP)
322 ComlibAssociateProxy(commGInstance2,rhoRealProxy2_com);
323 if(config.useGIns3RhoRP)
324 ComlibAssociateProxy(commGInstance3,rhoRealProxy3_com);
325 if(config.useGByrdInsRhoRBP)
326 ComlibAssociateProxy(commGByrdInstance,rhoRealProxyByrd_com);
347 #ifdef _CP_DEBUG_RHOG_VERBOSE_
348 CkPrintf(
"RGS [%d %d] receives message size %d offset %d numlines %d\n",
349 thisIndex.x,thisIndex.y,msg->size,msg->offset,rho_gs.numLines);
354 int size = msg->size;
355 int offset = msg->offset;
356 int isub = msg->offsetGx;
357 complex *partlyIFFTd = msg->data;
360 int ix = thisIndex.x;
361 int sizeZ = rho_gs.sizeZ;
362 int numLines = rho_gs.numLines;
366 int **nline_send = sim->nline_send_rho_y;
367 index_pack = sim->index_tran_pack_rho_y;
368 numLines = nline_send[ix][isub];
375 for(
int i=0;i<msg->size ;i++){
376 CkAssert(isnan(msg->data[i].re)==0);
377 CkAssert(isnan(msg->data[i].im)==0);
381 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
382 CkPrintf(
"size %d != numLines %d\n",size,numLines);
383 CkPrintf(
"RGS [%d %d] receives message size %d offset %d numlines %d\n",
384 thisIndex.x,thisIndex.y,msg->size,msg->offset,rho_gs.numLines);
385 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
392 complex *chunk = rho_gs.divRhoX;
394 if(rhoRsubplanes==1){
395 for(
int i=0,j=offset; i< size; i++,j+=sizeZ){chunk[j] = partlyIFFTd[i];}
397 for(
int i=0; i< size; i++){
398 chunk[(offset+index_pack[ix][isub][i])] = partlyIFFTd[i];
404 if(count==0){count_stuff=0;}
411 if(count== recvCountFromRRho){
412 if(count_stuff!=rho_gs.numLines*sizeZ){
413 CkPrintf(
"Not enough stuff %d %d on %d\n",count_stuff,rho_gs.numLines,thisIndex.x);
417 #ifndef _DEBUG_INT_TRANS_FWD
418 thisProxy(thisIndex.x,thisIndex.y).doRhoFFT();
421 sprintf(name,
"partFFTGxGyZT%d.out.%d",rhoRsubplanes,thisIndex.x);
422 FILE *fp = fopen(name,
"w");
423 numLines = rho_gs.numLines;
424 for(
int ix =0;ix<numLines;ix++){
425 for(
int iy =0;iy<sizeZ;iy++){
426 int i = ix*sizeZ + iy;
427 fprintf(fp,
"%d %d : %g %g\n",iy,ix,chunk[i].re,chunk[i].im);
448 #ifdef _CP_DEBUG_RHOG_VERBOSE_
449 CkPrintf(
"Data has arrive in rhogs : peforming FFT %d %d\n",
450 thisIndex.x,thisIndex.y);
458 #if CMK_TRACE_ENABLED
459 double StartTime=CmiWallTimer();
461 FFTcache *fftcache = UfftCacheProxy[thisInstance.proxyOffset].ckLocalBranch();
462 fftcache->getCacheMem(
"CP_Rho_GSpacePlane::acceptRhoData");
463 complex *data_out = fftcache->tmpData;
464 complex *data_in = rho_gs.divRhoX;
466 rho_gs.numFull,rho_gs.numPoints,
467 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
468 rho_gs.sizeZ,1,iplane_ind);
469 #if CMK_TRACE_ENABLED
470 traceUserBracketEvent(BwFFTRtoG_, StartTime, CmiWallTimer());
476 #ifdef _CP_DEBUG_RHOG_RHOG_
477 char myFileName[100];
478 sprintf(myFileName,
"Rho_Gspace_%d%d.out", thisIndex.x,thisIndex.y);
479 FILE *fp = fopen(myFileName,
"w");
480 for (
int i = 0; i < rho_gs.numPoints; i++){
481 fprintf(fp,
" %d %d %d : %g %g\n",
482 rho_gs.k_x[i],rho_gs.k_y[i],rho_gs.k_z[i],
483 rho_gs.packedRho[i].re,rho_gs.packedRho[i].im);
494 #ifndef _CP_DEBUG_HARTEEXT_OFF_ // hartree is cooking
495 int nchareHartAtmT=config.nchareHartAtmT;
496 for(
int i=0;i<rhoGHelpers;i++){
497 for(
int j=0;j<nchareHartAtmT;j++){
499 msg->size = numSplit[i];
500 msg->senderIndex = thisIndex.x;
501 CmiMemcpy(msg->data,&data_out[istrtSplit[i]],numSplit[i]*
sizeof(
complex));
503 if(config.prioFFTMsg){
504 CkSetQueueing(msg, CK_QUEUEING_IFIFO);
505 *(
int*)CkPriorityPtr(msg) = config.rhorpriority + thisIndex.x+ thisIndex.y;
508 int index = thisIndex.x*rhoGHelpers + i;
509 UrhoGHartExtProxy[thisInstance.proxyOffset](index,j).acceptData(msg);
516 #ifdef _CP_DEBUG_HARTEEXT_OFF_ //hartree is sitting this one out
517 if(thisIndex.x==0 && thisIndex.y==0){
518 CkPrintf(
"EHART = OFF FOR DEBUGGING\n");
519 CkPrintf(
"EExt = OFF FOR DEBUGGING\n");
520 CkPrintf(
"EWALD_recip = OFF FOR DEBUGGING\n");
527 #if CMK_TRACE_ENABLED
528 StartTime=CmiWallTimer();
530 if(cp_grad_corr_on!=0){
533 fftcache->freeCacheMem(
"CP_Rho_GSpacePlane::acceptRhoData");
535 #if CMK_TRACE_ENABLED
536 traceUserBracketEvent(divRhoVksGspace_, StartTime, CmiWallTimer());
564 if(sim->ees_nloc_on==1 && config.launchNLeesFromRho==2){
574 if(thisIndex.x<config.nchareG){
575 nlsectproxy.startNonLocalEes(myTime);
596 FFTcache *fftcache = UfftCacheProxy[thisInstance.proxyOffset].ckLocalBranch();
597 complex *packedRho = fftcache->tmpData;
598 complex *divRhoX = rho_gs.divRhoX;
599 complex *divRhoY = rho_gs.divRhoY;
600 complex *divRhoZ = rho_gs.divRhoZ;
606 CPXCFNCTS::CP_fetch_hmati(&hmati,&tpi);
608 fftcache->freeCacheMem(
"CP_Rho_GSpacePlane::divRhoVksGspace");
614 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
615 rho_gs.sizeZ,0,iplane_ind);
622 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
623 rho_gs.sizeZ,0,iplane_ind);
630 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
631 rho_gs.sizeZ,0,iplane_ind);
650 #ifdef _CP_DEBUG_RHOG_VERBOSE_
651 CkPrintf(
"Communicating data from RhoG to RhoR : %d %d %d\n",
652 thisIndex.x,thisIndex.y,iopt);
659 int sizeZ = rho_gs.sizeZ;
660 int ix = thisIndex.x;
661 int numLines = rho_gs.numLines;
665 nline_send = sim->nline_send_rho_y;
666 index_pack = sim->index_tran_pack_rho_y;
671 case 1 : ffttempdata = rho_gs.divRhoX;
break;
672 case 2 : ffttempdata = rho_gs.divRhoY;
break;
673 case 3 : ffttempdata = rho_gs.divRhoZ;
break;
674 case 4 : ffttempdata = rho_gs.divRhoX;
break;
675 default: CkAbort(
"impossible iopt");
break;
682 if(rhoRsubplanes==1){
685 case 1 :
if(config.useGIns1RhoRP) commGInstance1.beginIteration();
break;
686 case 2 :
if(config.useGIns2RhoRP) commGInstance2.beginIteration();
break;
687 case 3 :
if(config.useGIns3RhoRP) commGInstance3.beginIteration();
break;
688 case 4 :
if(config.useGByrdInsRhoRBP) commGByrdInstance.beginIteration();
break;
690 case 1 :
if(config.useGIns1RhoRP) ComlibBegin(rhoRealProxy1_com,0);
break;
691 case 2 :
if(config.useGIns2RhoRP) ComlibBegin(rhoRealProxy2_com,0);
break;
692 case 3 :
if(config.useGIns3RhoRP) ComlibBegin(rhoRealProxy3_com,0);
break;
693 case 4 :
if(config.useGByrdInsRhoRBP) ComlibBegin(rhoRealProxyByrd_com,0);
break;
695 default: CkAbort(
"impossible iopt");
break;
704 for(
int z=0;z<sizeZ;z++) {
705 for(
int s=0;s<rhoRsubplanes;s++){
707 if(rhoRsubplanes>1){numLines = nline_send[ix][s];}
710 msg->size = numLines;
711 msg->senderIndex = thisIndex.x;
714 if(config.prioFFTMsg){
715 CkSetQueueing(msg, CK_QUEUEING_IFIFO);
716 *(
int*)CkPriorityPtr(msg) = config.rhorpriority + thisIndex.x+ thisIndex.y;
721 if(rhoRsubplanes==1){
722 for (
int i=0,j=z; i<numLines; i++,j+=sizeZ){data[i] = ffttempdata[j];}
724 for(
int i=0; i< numLines; i++){
725 data[i] = ffttempdata[(z+index_pack[ix][s][i])];
729 if(rhoRsubplanes==1){
731 case 1 : rhoRealProxy1_com(z,0).acceptGradRhoVks(msg);
break;
732 case 2 : rhoRealProxy2_com(z,0).acceptGradRhoVks(msg);
break;
733 case 3 : rhoRealProxy3_com(z,0).acceptGradRhoVks(msg);
break;
734 case 4 : rhoRealProxyByrd_com(z,0).acceptWhiteByrd(msg);
break;
735 default: CkAbort(
"impossible iopt");
break;
739 case 1 : UrhoRealProxy[thisInstance.proxyOffset](z,s).acceptGradRhoVks(msg);
break;
740 case 2 : UrhoRealProxy[thisInstance.proxyOffset](z,s).acceptGradRhoVks(msg);
break;
741 case 3 : UrhoRealProxy[thisInstance.proxyOffset](z,s).acceptGradRhoVks(msg);
break;
742 case 4 : UrhoRealProxy[thisInstance.proxyOffset](z,s).
acceptWhiteByrd(msg);
break;
743 default: CkAbort(
"impossible iopt");
break;
754 if(rhoRsubplanes==1){
757 case 1 :
if(config.useGIns1RhoRP) commGInstance1.endIteration();
break;
758 case 2 :
if(config.useGIns2RhoRP) commGInstance2.endIteration();
break;
759 case 3 :
if(config.useGIns3RhoRP) commGInstance3.endIteration();
break;
760 case 4 :
if(config.useGByrdInsRhoRBP) commGByrdInstance.endIteration();
break;
762 case 1 :
if(config.useGIns1RhoRP) ComlibEnd(rhoRealProxy1_com,0);
break;
763 case 2 :
if(config.useGIns2RhoRP) ComlibEnd(rhoRealProxy2_com,0);
break;
764 case 3 :
if(config.useGIns3RhoRP) ComlibEnd(rhoRealProxy3_com,0);
break;
765 case 4 :
if(config.useGByrdInsRhoRBP) ComlibEnd(rhoRealProxyByrd_com,0);
break;
767 default: CkAbort(
"impossible iopt");
break;
784 #ifdef _CP_DEBUG_RHOG_VERBOSE_
785 CkPrintf(
"Communicating data from RhoG to RhoR : %d %d\n",
786 thisIndex.x,thisIndex.y);
793 int sizeZ = rho_gs.sizeZ;
794 int ix = thisIndex.x;
795 int numLines = rho_gs.numLines;
799 nline_send = sim->nline_send_rho_y;
800 index_pack = sim->index_tran_pack_rho_y;
803 complex *ffttempdataX = rho_gs.divRhoX;
804 complex *ffttempdataY = rho_gs.divRhoY;
805 complex *ffttempdataZ = rho_gs.divRhoZ;
810 for(
int z=0;z<sizeZ;z++) {
811 for(
int s=0;s<rhoRsubplanes;s++){
813 if(rhoRsubplanes>1){numLines = nline_send[ix][s];}
816 msg->size = numLines;
817 msg->senderIndex = thisIndex.x;
820 if(config.prioFFTMsg){
821 CkSetQueueing(msg, CK_QUEUEING_IFIFO);
822 *(
int*)CkPriorityPtr(msg) = config.rhorpriority + thisIndex.x+ thisIndex.y;
827 if(rhoRsubplanes==1){
828 for (
int i=0,j=z; i<3*numLines; i+=3,j+=sizeZ){
829 data[i] = ffttempdataX[j];
830 data[i+1] = ffttempdataY[j];
831 data[i+2] = ffttempdataZ[j];
834 for(
int i=0,ii=0; ii< numLines; i+=3,ii++){
835 int j = (z+index_pack[ix][s][ii]);
836 data[i] = ffttempdataX[j];
837 data[i+1] = ffttempdataY[j];
838 data[i+2] = ffttempdataZ[j];
841 UrhoRealProxy[thisInstance.proxyOffset](z,s).acceptGradRhoVksAll(msg);
867 #ifdef _CP_DEBUG_RHOG_VERBOSE_
868 CkPrintf(
"RGS [%d %d] receives white-byrd message size %d offset %d numlines %d\n",
869 thisIndex.x,thisIndex.y,msg->size,msg->offset,rho_gs.numLines);
874 int iopt = msg->iopt;
875 int size = msg->size;
876 int offset = msg->offset;
877 int isub = msg->offsetGx;
878 complex *partlyIFFTd = msg->data;
881 int ix = thisIndex.x;
882 int sizeZ = rho_gs.sizeZ;
883 int numLines = rho_gs.numLines;
886 int **nline_send = sim->nline_send_rho_y;
887 index_pack = sim->index_tran_pack_rho_y;
888 numLines = nline_send[ix][isub];
895 for(
int i=0;i<msg->size ;i++){
896 CkAssert(isnan(msg->data[i].re)==0);
897 CkAssert(isnan(msg->data[i].im)==0);
901 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
902 CkPrintf(
"size %d != numLines %d\n",size,numLines);
903 CkPrintf(
"RGS [%d %d] receives message size %d offset %d numlines %d opt %d\n",
904 thisIndex.x,thisIndex.y,size,offset,numLines,iopt);
905 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
914 case 1 : chunk = rho_gs.divRhoX;
break;
915 case 2 : chunk = rho_gs.divRhoY;
break;
916 case 3 : chunk = rho_gs.divRhoZ;
break;
917 default: CkAbort(
"impossible iopt");
break;
920 if(rhoRsubplanes==1){
921 for(
int i=0,j=offset; i< size; i++,j+=sizeZ){chunk[j] = partlyIFFTd[i];}
923 for(
int i=0; i< size; i++){
924 chunk[(offset+index_pack[ix][isub][i])] = partlyIFFTd[i];
933 countWhiteByrd[iopt]++;
934 if(countWhiteByrd[iopt]==recvCountFromRRho){
935 countWhiteByrd[iopt]=0;
938 #if CMK_TRACE_ENABLED
939 double StartTime=CmiWallTimer();
941 FFTcache *fftcache = UfftCacheProxy[thisInstance.proxyOffset].ckLocalBranch();
943 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
944 rho_gs.sizeZ,0,iplane_ind);
945 #if CMK_TRACE_ENABLED
946 traceUserBracketEvent(BwFFTRtoG_, StartTime, CmiWallTimer());
954 if(doneWhiteByrd==3){
980 #ifdef _CP_DEBUG_RHOG_VERBOSE_
981 CkPrintf(
"RGS [%d %d] receives white-byrd message size %d offset %d numlines %d\n",
982 thisIndex.x,thisIndex.y,msg->size,msg->offset,rho_gs.numLines);
987 int iopt = msg->iopt;
988 int size = msg->size;
989 int offset = msg->offset;
990 int isub = msg->offsetGx;
991 complex *partlyIFFTd = msg->data;
994 int ix = thisIndex.x;
995 int sizeZ = rho_gs.sizeZ;
996 int numLines = rho_gs.numLines;
1000 int **nline_send = sim->nline_send_rho_y;
1001 index_pack = sim->index_tran_pack_rho_y;
1002 numLines = nline_send[ix][isub];
1009 for(
int i=0;i<3*(msg->size) ;i++){
1010 CkAssert(isnan(msg->data[i].re)==0);
1011 CkAssert(isnan(msg->data[i].im)==0);
1016 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
1017 CkPrintf(
"size %d != numLines %d\n",size,numLines);
1018 CkPrintf(
"RGS [%d %d] receives message size %d offset %d numlines %d opt %d\n",
1019 thisIndex.x,thisIndex.y,size,offset,numLines,iopt);
1020 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@\n");
1027 complex *chunkX = rho_gs.divRhoX;
1028 complex *chunkY = rho_gs.divRhoY;
1029 complex *chunkZ = rho_gs.divRhoZ;
1031 if(rhoRsubplanes==1){
1032 for(
int i=0,j=offset; i< 3*size; i+=3,j+=sizeZ){
1033 chunkX[j] = partlyIFFTd[i];
1034 chunkY[j] = partlyIFFTd[i+1];
1035 chunkZ[j] = partlyIFFTd[i+2];
1038 for(
int i=0,ii=0; ii< size; i+=3,ii++){
1039 int j=offset+index_pack[ix][isub][ii];
1040 chunkX[j] = partlyIFFTd[i];
1041 chunkY[j] = partlyIFFTd[i+1];
1042 chunkZ[j] = partlyIFFTd[i+2];
1051 countWhiteByrd[1]++;
1052 if(countWhiteByrd[1]==recvCountFromRRho){
1053 countWhiteByrd[1]=0;
1056 #if CMK_TRACE_ENABLED
1057 double StartTime=CmiWallTimer();
1059 FFTcache *fftcache = UfftCacheProxy[thisInstance.proxyOffset].ckLocalBranch();
1061 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
1062 rho_gs.sizeZ,0,iplane_ind);
1064 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
1065 rho_gs.sizeZ,0,iplane_ind);
1067 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
1068 rho_gs.sizeZ,0,iplane_ind);
1069 #if CMK_TRACE_ENABLED
1070 traceUserBracketEvent(BwFFTRtoG_, StartTime, CmiWallTimer());
1077 if(doneWhiteByrd==3){
1095 #if CMK_TRACE_ENABLED
1096 double StartTime=CmiWallTimer();
1099 int ioptSendWhite = 4;
1105 CPXCFNCTS::CP_fetch_hmati(&hmati,&tpi);
1111 FFTcache *fftcache = UfftCacheProxy[thisInstance.proxyOffset].ckLocalBranch();
1112 complex *white = rho_gs.divRhoX;
1114 rho_gs.numLines,rho_gs.numRuns,rho_gs.runs,
1115 rho_gs.sizeZ,0,iplane_ind);
1120 #if CMK_TRACE_ENABLED
1121 traceUserBracketEvent(ByrdanddoFwFFTGtoR_, StartTime, CmiWallTimer());
1134 void CP_Rho_GSpacePlane::ResumeFromSync(){
1164 int nchareG = sim->nchareRhoG;
1165 if(countDebug==nchareG){
1167 CkPrintf(
"I am in the exitfordebuging rhoG puppy. Bye-bye\n");
holds the UberIndex and the offset for proxies
void divRhoVksGspace()
invoke fft subroutine : doFwFFT() unpack do an FFT 1D along z rho(gx,gy,gz) parallelized in full z-li...
Add type declarations for simulationConstants class (readonly vars) and once class for each type of o...
void createWhiteByrd(double *, double)
= packed g-space of size numPoints is expanded to numFull =numRuns/2*nfftz
void acceptWhiteByrdAll(RhoGSFFTMsg *msg)
RhoReal sends rho(gx,gy,z) here such that it is now decomposed with lines of constant gx...
== Index logic for lines of constant x,y in gspace.
Some basic data structures and the array map classes are defined here.
void divRhoGdot(double *, double, complex *)
= packed g-space of size numPoints is expanded to numFull =numRuns/2*nfftz
void getSplitDecomp(int *, int *, int *, int, int, int)
Initialization Function /////////////////////////////////////////////////////////////////////////// /...
void launchNlG()
The density is here : Launch ees NL.
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 acceptRhoData(RhoGSFFTMsg *msg)
RhoReal sends rho(gx,gy,z) here such that it is now decomposed with lines of constant gx...
void doRhoFFT()
Complete the FFT to give use Rho(gx,gy,gz) //////////////////////////////////////////////////////////...
void init()
post constructor initialization /////////////////////////////////////////////////////////////////////...
void exitForDebugging()
Glenn's RhoReal exit.