125 #include "InstanceController.h"
126 #include "ENL_EKE_Collector.h"
127 #include "pcCreationManager.h"
134 #include "cp_state_ctrl/CP_State_ParticlePlane.h"
136 #include "structure_factor/StructFactorCache.h"
137 #include "structure_factor/StructureFactor.h"
138 #include "paircalc/pcMapConfig.h"
141 #include "PIBeadAtoms.h"
143 #include "src_piny_physics_v1.0/include/class_defs/Interface_ctrl.h"
144 #include "src_piny_physics_v1.0/include/class_defs/PINY_INIT/PhysicsParamTrans.h"
145 #include "src_piny_physics_v1.0/include/class_defs/PINY_INIT/PhysicsAtomPosInit.h"
147 #include "MeshStreamingStrategy.h"
148 #include "MultiRingMulticast.h"
149 #include "OneTimeMulticastStrategy.h"
150 #include "TopoManager.h"
154 #include "PhysScratchCache.h"
162 std::vector <std::string> TimeKeeperNames;
173 extern void initFFTLock(
void);
184 extern MDINTEGRATE readonly_mdintegrate;
185 extern MDATOMS readonly_mdatoms;
186 extern MDINTER readonly_mdinter;
187 extern MDINTRA readonly_mdintra;
188 extern GENERAL_DATA readonly_general_data;
189 extern CP readonly_cp;
207 bool Ortho_use_local_cb;
213 #include "commlibhandles.h"
217 CkReduction::reducerType complexVectorAdderType;
221 #ifndef OPENATOM_REVISION
222 #define OPENATOM_REVISION Unknown
224 #define _QUOTEIT(x) #x
225 #define INQUOTES(x) _QUOTEIT(x)
239 main::main(CkArgMsg *msg) {
248 CkAbort(
"Usage: cpaimd.x cpaimd_config pinysystem.input");
250 CkPrintf(
"Executing OpenAtom: BINARY - %s\n", msg->argv[0]);
251 CkPrintf(
"Binary produced from source-tree at commit: %s\n",
OpenAtomRevision);
254 CkPrintf(
"Starting Cpaimd-Charm-Driver Setup Phase\n");
256 CkPrintf(
" Cpaimd-Charm-Driver running on %d processors. \n", CkNumPes());
257 CkPrintf(
" Reading Physics input from %s\n",msg->argv[2]);
258 CkPrintf(
" Reading Driver input from %s\n",msg->argv[1]);
260 PRINT_LINE_DASH; CkPrintf(
"\n");
265 #ifdef _CP_DEBUG_NON_LOCAL_ONLY_
266 #ifdef _CP_DEBUG_SFNL_OFF_
267 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
268 CkPrintf(
"You can't test non-local by itself and turn it off\n");
269 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
274 #ifdef _CP_DEBUG_NON_LOCAL_ONLY_
275 #ifndef _CP_DEBUG_VKS_OFF_
276 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
277 CkPrintf(
"You can't test non-local by itself with vks on\n");
278 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
283 #ifdef _CP_DEBUG_VKS_ONLY_
284 #ifdef _CP_DEBUG_VKS_OFF_
285 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
286 CkPrintf(
"You can't test vks by itself and turn it off\n");
287 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
292 #ifdef _CP_DEBUG_VKS_ONLY_
293 #ifndef _CP_DEBUG_SFNL_OFF_
294 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
295 CkPrintf(
"You can't test vks by itself with SNFL on\n");
296 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
301 #ifdef _CP_DEBUG_NON_LOCAL_VKS_ONLY_
302 #ifdef _CP_DEBUG_SFNL_OFF_
303 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
304 CkPrintf(
"You can't test vks and SNFL only without sfnl \n");
305 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
308 #ifdef _CP_DEBUG_VKS_OFF_
309 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
310 CkPrintf(
"You can't test vks and SNFL only without vks \n");
311 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
331 CkCallback piny_callback (CkCallback::ignore);
332 Interface_ctrl piny_interface (msg->argv[2],piny_callback);
335 PhysicsParamTransfer::ParaInfoInit(sim);
337 int ibinary_opt = sim->ibinary_opt;
338 int natm_nl = sim->natm_nl;
339 int ees_eext_opt = sim->ees_eext_on;
340 int nchareRhoRHart = sim->ngrid_eext_c;
341 int fftopt = sim->fftopt;
342 int natm_typ = sim->natm_typ;
355 CkPrintf(
"Cpaimd-Charm-Driver input started \n");
356 PRINT_LINE_DASH; CkPrintf(
"\n");
357 Timer=CmiWallTimer();
358 double phase1start=
Timer;
361 config.readConfig(msg->argv[1],sim->nstates,sim->sizeX,sim->sizeY,sim->sizeZ,
362 sim->ntime,ibinary_opt,natm_nl,fftopt,numPes,natm_typ,
363 ees_eext_opt,sim->gen_wave,sim->ncoef, sim->cp_min_opt, sim->ngrid_eext_c,
364 sim->doublepack,sim->pi_beads,sim->nkpoint,sim->ntemper,sim->nspin);
370 numPes=config.torusDimNX * config.torusDimNY * config.torusDimNZ * config.torusDimNT;
371 CkPrintf(
"numpes set to %d by faketorus\n",numPes);
373 else if (CkNumPes() != config.numPes)
375 numPes=config.numPes;
376 CkPrintf(
"numpes set to %d by config file\n",numPes);
378 CkPrintf(
"for numInstances %d numPes %d numPesPerInstance is %d \n",config.numInstances, config.numPes, config.numPesPerInstance);
379 mapOffsets=
new inttriple[config.numInstances];
380 int numSfGrps = config.numSfGrps;
381 int doublePack = config.doublePack;
382 nchareG = config.nchareG;
383 sim->nchareG = nchareG;
385 nstates = config.nstates;
388 double newtime= CmiWallTimer();
391 CkPrintf(
"Cpaimd-Charm-Driver input completed in %g\n",newtime-
Timer);
392 PRINT_LINE_STAR; CkPrintf(
"\n");
399 TimeKeeperProxy = CProxy_TimeKeeper::ckNew();
402 mCastGrpId = CProxy_CkMulticastMgr::ckNew(config.numMulticastMsgs);
410 Ortho_use_local_cb =
true;
416 sim->numSfGrps = numSfGrps;
418 PhysicsParamTransfer::get_Sfgrp_max(natm_nl,config.numSfGrps,
420 sim->natm_nl_grp_max = natm_nl_grp_max;
424 PhysicsParamTransfer::control_new_mapping_function(sim,doublePack);
428 #include "initializeUber.C"
430 pScratchProxy = CProxy_PhysScratchCache::ckNew();
433 mainProxy=thishandle;
435 instControllerProxy= CProxy_InstanceController::ckNew(config.numInstances);
436 instControllerProxy.doneInserting();
439 temperControllerProxy= CProxy_TemperController::ckNew(1);
440 temperControllerProxy.doneInserting();
443 CkArrayOptions enlopts(config.UberKmax);
444 ENLEKECollectorProxy= CProxy_ENL_EKE_Collector::ckNew(config.UberImax*config.UberJmax*config.UberMmax, config.UberKmax, enlopts);
445 ENLEKECollectorProxy.doneInserting();
457 CkPrintf(
"Initializing TopoManager\n");
458 if(config.fakeTorus) {
459 CkPrintf(
"Initializing TopoManager with fakeTorus\n");
460 topoMgr =
new TopoManager(config.torusDimNX, config.torusDimNY,
461 config.torusDimNZ, config.torusDimNT);
464 topoMgr =
new TopoManager();
466 CkPrintf(
" Torus %d x %d x %d nodes %d x %d x %d VN %d DimNT %d .........\n",
467 topoMgr->getDimX(), topoMgr->getDimY(), topoMgr->getDimZ(),
468 topoMgr->getDimNX(), topoMgr->getDimNY(), topoMgr->getDimNZ(),
469 topoMgr->hasMultipleProcsPerNode(), topoMgr->getDimNT());
470 if(config.torusMap==1) {
471 PRINT_LINE_STAR; CkPrintf(
"\n");
472 CkPrintf(
" Topology Sensitive Mapping being done for RSMap, GSMap, ....\n");
473 CkPrintf(
" ......., PairCalc, RhoR, RhoG and RhoGHart .........\n\n");
474 PRINT_LINE_STAR; CkPrintf(
"\n");
477 int l=config.Gstates_per_pe;
480 pm = config.numPesPerInstance / pl;
482 CkPrintf(
"Choose a larger Gstates_per_pe than %d such that { (no. of processors [%d] / no. of Instances [%d]) / (no. of states [%d] / Gstates_per_pe [%d]) } is > 0 \n",
483 l, config.numPes, config.numInstances, nstates, l);
486 m = config.nchareG / pm;
489 if(planes_per_pe <= 0) {
490 CkPrintf(
"Choose a smaller Gstates_per_pe than %d such that { (no. of processors [%d] / no. of Instances [%d]) / (no. of states [%d] / Gstates_per_pe [%d]) } is > 0 and config.nchareG [%d] / pm [%d] {where pm = config.numPesPerInstance [%d]/ pl [%d] } > 0\n",
491 l, config.numPes, config.numInstances, nstates, l, config.nchareG, pm, config.numPesPerInstance, pl);
496 CkPrintf(
"Initializing PeList\n");
502 if(!config.loadMapFiles && config.useCuboidMap)
504 if( config.numPesPerInstance % config.nchareG != 0)
506 CkPrintf(
"To use CuboidMap nchareG %d should be chosen as a factor of numprocs %d / numInstances %d = %d\n",config.nchareG, config.numPes, config.numInstances, config.numPesPerInstance);
509 int procsPerPlane = config.numPesPerInstance / nchareG;
511 if(config.torusMap == 1) {
512 boxSize = procsPerPlane;
516 int dimNX, dimNY, dimNZ, dimNT;
517 int longDim = -1, maxD;
519 dimNX = topoMgr->getDimNX();
520 dimNY = topoMgr->getDimNY();
521 dimNZ = topoMgr->getDimNZ();
522 dimNT = topoMgr->getDimNT();
523 int x1 = dimNX, y1 = dimNY, z1 = dimNZ;
528 if (dimNY > maxD) { maxD = dimNY; longDim = 2; }
529 if (dimNZ > maxD) { maxD = dimNZ; longDim = 3; }
531 for(
int i=0; i<config.numInstances; i++) {
534 x = i*(maxD/config.numInstances); y = 0; z = 0;
535 x1 = dimNX / config.numInstances;
538 x = 0; y = i*(maxD/config.numInstances); z = 0;
539 y1 = dimNY / config.numInstances;
542 x = 0; y = 0; z = i*(maxD/config.numInstances);
543 z1 = dimNZ / config.numInstances;
549 CkPrintf(
" Box per Instance: nodes %d x %d x %d .........\n", x1, y1, z1);
550 if(
findCuboid(bx, by, bz, order, x1, y1, z1, topoMgr->getDimNT(), boxSize, topoMgr->hasMultipleProcsPerNode()))
552 CkPrintf(
"Using %d, %d, %d dimensions for box %d mapping order %d\n", bx, by, bz, boxSize, order);
553 gfoo =
new PeList(bx, by, bz, order, x1, y1, z1, dimNT);
554 peList4PCmapping =
new PeListFactory(bx,by,bz,order,x1,y1,z1,dimNT);
559 CkPrintf(
"no box for %d\n", boxSize);
560 config.useCuboidMap = 0;
561 gfoo =
new PeList(config.numPes);
568 x=numInst*config.numPesPerInstance;
571 gfoo =
new PeList(config.numPes);
576 gfoo =
new PeList(config.numPes);
579 if(!config.loadMapFiles && config.useCuboidMapRS)
582 rfoo =
new PeList(config.numPes);
588 newtime = CmiWallTimer();
589 CkPrintf(
"Pelist initialized in %g with %d elements\n", newtime-
Timer, availGlobG->count());
595 Per Instance startup BEGIN
618 CkPrintf(
"NumInstances %d: Beads %d * Kpoints %d * Tempers %d * Spin %d\n",config.numInstances, config.UberImax, config.UberJmax, config.UberKmax,config.UberMmax);
619 for(
int integral=0; integral< config.UberImax; integral++)
621 for(
int kpoint=0; kpoint< config.UberJmax; kpoint++)
623 for(
int temper=0; temper< config.UberKmax; temper++)
625 for(
int spin=0; spin< config.UberMmax; spin++) {
627 CkVec <int> peUsedBySF;
628 CkVec <int> peUsedByNLZ;
629 CkVec <int> planeUsedByNLZ;
631 UberIndex thisInstanceIndex(integral, kpoint, temper, spin);
633 UberAlles.push_back(thisInstance);
643 if(config.UberImax>1)
648 init_state_chares(natm_nl,natm_nl_grp_max,numSfGrps,doublePack,sim, thisInstance);
653 orthostartup(&orthoCfg, &cfgSymmPC, &cfgAsymmPC, sim, peList4PCmapping);
658 int *usedProc=
new int[config.numPesPerInstance];
659 memset(usedProc, 0,
sizeof(
int)*config.numPesPerInstance);
660 int charperpe = nstates/(config.numPesPerInstance);
661 if(nstates % config.numPesPerInstance != 0) charperpe++;
662 if(charperpe<1) charperpe=1;
663 for(
int state=0; state<nstates; state++) {
664 int plane = nchareG-1;
667 int thisstateplaneproc = GSImaptable[thisInstance.getPO()].get(state,plane) % config.numPesPerInstance;
668 if(usedProc[thisstateplaneproc]>charperpe) {
671 if(!used || plane==0) {
672 peUsedByNLZ.push_back(thisstateplaneproc);
673 planeUsedByNLZ.push_back(plane);
674 usedProc[thisstateplaneproc]++;
680 peUsedByNLZ.quickSort();
682 UpeUsedByNLZ.push_back(peUsedByNLZ);
683 UplaneUsedByNLZ.push_back(planeUsedByNLZ);
691 CmiNetworkProgressAfter(1);
695 init_eesNL_chares( natm_nl, natm_nl_grp_max, doublePack, excludePes, sim, thisInstance);
696 CmiNetworkProgressAfter(1);
703 UatomsComputeProxy[thisInstance.getPO()].init();
707 if(config.numInstances>1)
708 CkPrintf(
"WARNING!!! Commlib does not work for multiple instances\n");
712 TimeKeeperProxy.init();
727 newtime=CmiWallTimer();
729 CkPrintf(
"Cpaimd-Charm-Driver setup phase completed in %g \n",newtime-phase1start);
730 PRINT_LINE_STAR; CkPrintf(
"\n");
732 PRINT_LINE_DASH;CkPrintf(
"\n");
733 CkPrintf(
"user mem %d\n",CmiMemoryUsage());
747 if (config.useCommlib) {
748 if(config.usePairEtoM){
766 PRINTF(
"Building Commlib strategies\n");
767 PRINT_LINE_DASH;printf(
"\n");
770 int rhoGhelpers = config.rhoGHelpers;
771 int numRhoGHart = rhoGhelpers*numRhoG;
772 int nchareHartAtmT = config.nchareHartAtmT;
775 if (config.useCommlib) {
787 CkArrayIndexMax *rhoGElements=NULL;
788 CkArrayIndexMax *rhoRealElements = NULL;
789 if(config.useRInsRhoGP)
791 CkPrintf(
"Making real_strategy with :");
792 CkPrintf(
"src numReal %d dest numRhoG %d and numHartG %d numHartR %d\n",
793 numReal,numRhoG,numRhoGHart,numRhoRhart);
796 rhoGElements =
new CkArrayIndexMax[numRhoG];
797 for (i = 0; i < numRhoG; i++) {
799 CkArrayIndex1D idx1d(i);
800 rhoGElements[i] = idx1d;
803 rhoRealElements =
new CkArrayIndexMax[numReal];
804 for(i = 0; i < numReal; i++) {
806 CkArrayIndex1D idx1d(i);
807 rhoRealElements[i] = idx1d;
810 CharmStrategy *real_strat;
812 Strategy *real_strat;
814 real_strat=
new EachToManyMulticastStrategy
815 (USE_DIRECT, UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(),
816 numReal, rhoRealElements, numRhoG, rhoGElements);
817 commRealInstance= ComlibRegister(real_strat);
818 delete [] rhoGElements;
819 delete [] rhoRealElements;
823 if(config.useRInsIGXRhoGP)
825 rhoGElements =
new CkArrayIndexMax[numRhoG];
826 for (i = 0; i < numRhoG; i++) {
827 rhoGElements[i] = CkArrayIndex1D(i);
830 rhoRealElements =
new CkArrayIndexMax[numReal];
831 for(i = 0; i < numReal; i++) {
832 rhoRealElements[i] = CkArrayIndex1D(i);
835 CharmStrategy *real_strat_igx;
837 Strategy *real_strat_igx;
839 real_strat_igx=
new EachToManyMulticastStrategy
840 (USE_DIRECT, UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(),
841 numReal, rhoRealElements, numRhoG,rhoGElements);
842 commRealIGXInstance= ComlibRegister(real_strat_igx);
843 delete [] rhoGElements;
844 delete [] rhoRealElements;
846 if(config.useRInsIGYRhoGP)
850 rhoGElements =
new CkArrayIndexMax[numRhoG];
851 for (i = 0; i < numRhoG; i++) {
852 rhoGElements[i] = CkArrayIndex1D(i);
855 rhoRealElements =
new CkArrayIndexMax[numReal];
856 for(i = 0; i < numReal; i++) {
857 rhoRealElements[i] = CkArrayIndex1D(i);
860 CharmStrategy *real_strat_igy;
862 Strategy *real_strat_igy;
864 real_strat_igy=
new EachToManyMulticastStrategy
865 (USE_DIRECT, UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(),
866 numReal, rhoRealElements, numRhoG,rhoGElements);
867 commRealIGYInstance= ComlibRegister(real_strat_igy);
869 delete [] rhoGElements;
870 delete [] rhoRealElements;
874 if(config.useRInsIGZRhoGP)
876 rhoGElements =
new CkArrayIndexMax[numRhoG];
877 for (i = 0; i < numRhoG; i++) {
878 rhoGElements[i] = CkArrayIndex1D(i);
881 rhoRealElements =
new CkArrayIndexMax[numReal];
882 for(i = 0; i < numReal; i++) {
883 rhoRealElements[i] = CkArrayIndex1D(i);
886 CharmStrategy *real_strat_igz;
888 Strategy *real_strat_igz;
890 real_strat_igz=
new EachToManyMulticastStrategy
891 (USE_DIRECT, UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(),
892 numReal, rhoRealElements, numRhoG,rhoGElements);
893 commRealIGZInstance= ComlibRegister(real_strat_igz);
894 delete [] rhoGElements;
895 delete [] rhoRealElements;
899 if(config.useGHartInsRhoRP)
901 rhoGElements =
new CkArrayIndexMax[numRhoGHart*nchareHartAtmT];
902 for (j= 0; j < nchareHartAtmT; j++) {
903 for (i = 0; i < numRhoGHart; i++) {
904 rhoGElements[i+j*numRhoGHart] = CkArrayIndex1D(i+j*numRhoGHart);
907 rhoRealElements =
new CkArrayIndexMax[numReal];
908 for(i = 0; i < numReal; i++) {
909 rhoRealElements[i] = CkArrayIndex1D(i);
912 CharmStrategy *gstrathart =
new EachToManyMulticastStrategy
914 Strategy *gstrathart =
new EachToManyMulticastStrategy
917 (USE_DIRECT, UrhoGHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
918 numRhoGHart, rhoGElements, numReal, rhoRealElements);
919 commGHartInstance = ComlibRegister(gstrathart);
920 delete [] rhoGElements;
921 delete [] rhoRealElements;
925 if(config.useGIns0RhoRP)
928 rhoGElements =
new CkArrayIndexMax[numRhoG];
929 for (i = 0; i < numRhoG; i++) {
930 rhoGElements[i] = CkArrayIndex1D(i);
933 rhoRealElements =
new CkArrayIndexMax[numReal];
934 for(i = 0; i < numReal; i++) {
935 rhoRealElements[i] = CkArrayIndex1D(i);
938 CharmStrategy *gstrat0;
942 gstrat0 =
new EachToManyMulticastStrategy
943 (USE_DIRECT, UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
944 numRhoG, rhoGElements, numReal, rhoRealElements);
945 commGInstance0 = ComlibRegister(gstrat0);
946 delete [] rhoGElements;
947 delete [] rhoRealElements;
951 if(config.useGIns1RhoRP)
953 rhoGElements =
new CkArrayIndexMax[numRhoG];
954 for (i = 0; i < numRhoG; i++) {
955 rhoGElements[i] = CkArrayIndex1D(i);
958 rhoRealElements =
new CkArrayIndexMax[numReal];
959 for(i = 0; i < numReal; i++) {
960 rhoRealElements[i] = CkArrayIndex1D(i);
963 CharmStrategy *gstrat1;
968 gstrat1 =
new EachToManyMulticastStrategy
969 (USE_DIRECT, UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
970 numRhoG, rhoGElements, numReal, rhoRealElements);
971 commGInstance1 = ComlibRegister(gstrat1);
972 delete [] rhoGElements;
973 delete [] rhoRealElements;
977 if(config.useGIns2RhoRP)
979 rhoGElements =
new CkArrayIndexMax[numRhoG];
980 for (i = 0; i < numRhoG; i++) {
981 rhoGElements[i] = CkArrayIndex1D(i);
984 rhoRealElements =
new CkArrayIndexMax[numReal];
985 for(i = 0; i < numReal; i++) {
986 rhoRealElements[i] = CkArrayIndex1D(i);
989 CharmStrategy *gstrat2;
994 gstrat2 =
new EachToManyMulticastStrategy
995 (USE_DIRECT, UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
996 numRhoG, rhoGElements, numReal, rhoRealElements);
997 commGInstance2 = ComlibRegister(gstrat2);
998 delete [] rhoGElements;
999 delete [] rhoRealElements;
1003 if(config.useGIns3RhoRP)
1005 rhoGElements =
new CkArrayIndexMax[numRhoG];
1006 for (i = 0; i < numRhoG; i++) {
1007 rhoGElements[i] = CkArrayIndex1D(i);
1010 rhoRealElements =
new CkArrayIndexMax[numReal];
1011 for(i = 0; i < numReal; i++) {
1012 rhoRealElements[i] = CkArrayIndex1D(i);
1015 CharmStrategy *gstrat3;
1020 gstrat3 =
new EachToManyMulticastStrategy
1021 (USE_DIRECT, UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
1022 numRhoG, rhoGElements, numReal, rhoRealElements);
1023 commGInstance3 = ComlibRegister(gstrat3);
1024 delete [] rhoGElements;
1025 delete [] rhoRealElements;
1029 if(config.useGByrdInsRhoRBP)
1031 rhoGElements =
new CkArrayIndexMax[numRhoG];
1032 for (i = 0; i < numRhoG; i++) {
1033 rhoGElements[i] = CkArrayIndex1D(i);
1036 rhoRealElements =
new CkArrayIndexMax[numReal];
1037 for(i = 0; i < numReal; i++) {
1038 rhoRealElements[i] = CkArrayIndex1D(i);
1041 CharmStrategy *gstratByrd;
1043 Strategy *gstratByrd;
1046 gstratByrd =
new EachToManyMulticastStrategy
1047 (USE_DIRECT, UrhoGProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRealProxy[thisInstance.proxyOffset].ckGetArrayID(),
1048 numRhoG, rhoGElements, numReal, rhoRealElements);
1049 commGByrdInstance = ComlibRegister(gstratByrd);
1050 delete [] rhoGElements;
1051 delete [] rhoRealElements;
1055 if(config.useGHartInsRHart &&
false)
1057 rhoGElements =
new CkArrayIndexMax[numRhoGHart];
1058 for (i = 0; i < numRhoGHart; i++) {
1059 rhoGElements[i] = CkArrayIndex1D(i);
1062 rhoRealElements =
new CkArrayIndexMax[numRhoRhart];
1063 for(i = 0; i < numRhoRhart; i++) {
1064 rhoRealElements[i] = CkArrayIndex3D(i,0,0);
1067 CharmStrategy *gstratEext0;
1069 Strategy *gstratEext0;
1072 gstratEext0 =
new EachToManyMulticastStrategy
1073 (USE_DIRECT, UrhoGHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(),
1074 numRhoGHart, rhoGElements, numRhoRhart, rhoRealElements);
1076 commGHartRHartIns0 = ComlibRegister(gstratEext0);
1080 if(config.useGHartInsRHart &&
false)
1082 rhoGElements =
new CkArrayIndexMax[numRhoGHart];
1083 for (i = 0; i < numRhoGHart; i++) {
1084 rhoGElements[i] = CkArrayIndex1D(i);
1087 rhoRealElements =
new CkArrayIndexMax[numRhoRhart];
1088 for(i = 0; i < numRhoRhart; i++) {
1089 rhoRealElements[i] = CkArrayIndex1D(i);
1092 CharmStrategy *gstratEext1;
1094 Strategy *gstratEext1;
1097 gstratEext1 =
new EachToManyMulticastStrategy
1098 (USE_DIRECT, UrhoGHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoRHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(),
1099 numRhoGHart, rhoGElements, numRhoRhart, rhoRealElements);
1101 commGHartRHartIns1 = ComlibRegister(gstratEext1);
1105 if(config.useRHartInsGHart &&
false){
1106 rhoGElements =
new CkArrayIndexMax[numRhoGHart];
1107 for (i = 0; i < numRhoGHart; i++) {
1108 rhoGElements[i] = CkArrayIndex1D(i);
1111 rhoRealElements =
new CkArrayIndexMax[numRhoRhart];
1112 for(i = 0; i < numRhoRhart; i++) {
1113 rhoRealElements[i] = CkArrayIndex1D(i);
1116 CharmStrategy *real_strat_eext;
1118 Strategy *real_strat_eext;
1121 real_strat_eext =
new EachToManyMulticastStrategy
1122 (USE_DIRECT, UrhoRHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(), UrhoGHartExtProxy[thisInstance.proxyOffset].ckGetArrayID(),
1123 numRhoRhart, rhoRealElements, numRhoGHart,rhoGElements);
1124 commRHartGHartIns = ComlibRegister(real_strat_eext);
1135 if (config.useCommlibMulticast) {
1137 DirectMulticastStrategy *dstrat =
new DirectMulticastStrategy
1138 (UrealSpacePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1140 RingMulticastStrategy *rstrat =
new RingMulticastStrategy
1141 (UrealSpacePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1143 RingMulticastStrategy *r1strat =
new RingMulticastStrategy
1144 (UparticlePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1146 MultiRingMulticast *mr1strat =
new MultiRingMulticast
1147 (UparticlePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1149 DirectMulticastStrategy *ppdstrat =
new DirectMulticastStrategy
1150 (UrealParticlePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1152 RingMulticastStrategy *pprstrat =
new RingMulticastStrategy
1153 (UrealParticlePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1154 MultiRingMulticast *ppmr1strat =
new MultiRingMulticast
1155 (UrealParticlePlaneProxy[thisInstance.proxyOffset].ckGetArrayID(),1);
1157 DirectMulticastStrategy *dstrat =
new DirectMulticastStrategy();
1159 OneTimeMulticastStrategy *rstrat =
new OneTimeMulticastStrategy();
1161 RingMulticastStrategy *r1strat =
new RingMulticastStrategy();
1163 RingMulticastStrategy *mr1strat =
new RingMulticastStrategy();
1165 DirectMulticastStrategy *ppdstrat =
new DirectMulticastStrategy();
1167 RingMulticastStrategy *pprstrat =
new RingMulticastStrategy();
1168 RingMulticastStrategy *ppmr1strat =
new RingMulticastStrategy();
1171 mcastInstance.reserve(config.UberJmax);
1173 if(CkNumNodes()>64){
1174 for (
int kp = 0; kp < config.UberJmax; kp++){
1175 mcastInstance.push_back(ComlibRegister(dstrat));
1177 mcastInstancePP=ComlibRegister(mr1strat);
1178 mcastInstanceRPP=ComlibRegister(ppdstrat);
1179 mcastInstancemRPP=ComlibRegister(ppmr1strat);
1181 for (
int kp = 0; kp < config.UberJmax; kp++){
1182 mcastInstance.push_back(ComlibRegister(rstrat));
1184 mcastInstancePP=ComlibRegister(r1strat);
1185 mcastInstanceRPP=ComlibRegister(pprstrat);
1186 mcastInstancemRPP=ComlibRegister(ppmr1strat);
1206 if(thisInstance.idxU.x>0)
1210 CkPrintf(
"Constructing PIMD Bead proxies for non zero instances\n");
1212 zeroBeadInstance.idxU.x=0;
1213 int proxyOffset=zeroBeadInstance.setPO();
1214 UPIBeadAtomsProxy.push_back(UPIBeadAtomsProxy[proxyOffset]);
1218 int natm = sim->natm_tot;
1219 CkPrintf(
"Constructing PIMD Bead array\n");
1220 CkArrayOptions opts(natm);
1221 UPIBeadAtomsProxy.push_back( CProxy_PIBeadAtoms::ckNew(thisInstance,config.UberImax,natm,opts));
1248 int ngrida = sim->sizeX;
1249 int ngridb = sim->sizeY;
1250 int ngridc = sim->sizeZ;
1252 int ngridaNl = sim->ngrid_nloc_a;
1253 int ngridbNl = sim->ngrid_nloc_b;
1254 int ngridcNl = sim->ngrid_nloc_c;
1255 int ees_nonlocal_on = sim->ees_nloc_on;
1257 int ngridaEext = sim->ngrid_eext_a;
1258 int ngridbEext = sim->ngrid_eext_b;
1259 int ngridcEext = sim->ngrid_eext_c;
1260 int ees_eext_on = sim->ees_eext_on;
1262 int nchareG = sim->nchareG;
1263 int nchareR = sim->sizeZ;
1264 int nchareRPP = ngridcNl;
1266 int numIterNL = sim->nlIters;
1268 int nchareRhoG = sim->nchareRhoG;
1269 int rhoGHelpers = config.rhoGHelpers;
1270 int nchareGHart = rhoGHelpers*nchareRhoG;
1271 int nchareRHart = ngridcEext;
1273 int Rstates_per_pe = config.Rstates_per_pe;
1274 int Gstates_per_pe = config.Gstates_per_pe;
1275 int sGrainSize = config.sGrainSize;
1276 int numChunks = config.numChunks;
1277 int nkpoint = sim->nkpoint;
1288 UsfCacheProxy.push_back( CProxy_StructFactCache::ckNew(numSfGrps,natm_nl,natm_nl_grp_max, thisInstance));
1289 if(firstInstance) CkPrintf(
"created sfcache proxy\n");
1290 UsfCompProxy.push_back(CProxy_StructureFactor::ckNew());
1291 if(firstInstance) CkPrintf(
"created sfcomp proxy\n");
1293 if(thisInstance.idxU.y>0 || thisInstance.idxU.s >0)
1300 zeroKpointInstance.idxU.y=0;
1301 int proxyOffset=zeroKpointInstance.setPO();
1308 UeesCacheProxy.push_back(UeesCacheProxy[proxyOffset]);
1312 UeesCacheProxy.push_back(CProxy_eesCache::ckNew(nchareRPP,nchareG,nchareRHart,nchareGHart,
1313 nstates,nchareRhoG, nkpoint, thisInstance));
1316 if(firstInstance) CkPrintf(
"created eescache proxy\n");
1318 int nchareRRhoTot = nchareR*(config.rhoRsubplanes);
1319 int nchareRHartTot = nchareRHart*(config.rhoRsubplanes);
1321 int *numGState = sim->nlines_per_chareG;
1322 int *numGNL = sim->nlines_per_chareG;
1323 int *numGRho = sim->nlines_per_chareRhoG;
1324 int *numGEext = sim->nlines_per_chareRhoGEext;
1328 int *numRXState =
new int [nchareR];
1329 int *numRYState =
new int [nchareR];
1330 int *numRYStateLower =
new int [nchareR];
1331 int *numRXNL =
new int [nchareRPP];
1332 int *numRYNL =
new int [nchareRPP];
1333 int *numRYNLLower =
new int [nchareRPP];
1334 int nplane_x_use = sim->nplane_x;
1335 if(!config.doublePack){nplane_x_use = (nplane_x_use+1)/2;}
1336 for(
int i=0;i<nchareR;i++){
1337 numRXState[i] = sim->sizeY;
1338 numRYState[i] = nplane_x_use;
1339 numRYStateLower[i] = nplane_x_use - 1;
1341 for(
int i=0;i<nchareRPP;i++){
1342 numRXNL[i] = ngridbNl;
1343 numRYNL[i] = nplane_x_use;
1344 numRYNLLower[i] = nplane_x_use - 1;
1346 int *numRXRho =
new int [nchareRRhoTot];
1347 int *numRYRho =
new int [nchareRRhoTot];
1348 int *numRXEext =
new int [nchareRHartTot];
1349 int *numRYEext =
new int [nchareRHartTot];
1350 int *numSubGx = sim->numSubGx;
1352 sim->nplane_rho_x,sim->sizeY,ngridbEext,
1353 numRXRho,numRYRho,numRXEext,numRYEext,numSubGx);
1354 UfftCacheProxy.push_back(CProxy_FFTcache::ckNew(
1355 sim->sizeX,sim->sizeY,sim->sizeZ,
1356 ngridaEext,ngridbEext,ngridcEext,ees_eext_on,
1357 ngridaNl, ngridbNl, ngridcNl, ees_nonlocal_on,
1358 sim->nlines_max, sim->nlines_max_rho,
1359 config.nchareG,nchareR,
1360 config.nchareG,nchareRPP,
1361 nchareRhoG, nchareR, nchareRRhoTot,
1362 nchareGHart, nchareRHart,nchareRHartTot,
1363 numGState, numRXState, numRYState,numRYStateLower,
1364 numGNL, numRXNL, numRYNL, numRYNLLower,
1365 numGRho, numRXRho, numRYRho,
1366 numGEext, numRXEext, numRYEext,
1367 config.fftopt,config.fftprogresssplitReal,config.fftprogresssplit,
1368 config.rhoRsubplanes, thisInstance));
1369 CkPrintf(
"created fftcache proxy\n");
1370 delete [] numRXState;
1371 delete [] numRYState;
1372 delete [] numRYStateLower;
1375 delete [] numRYNLLower;
1378 delete [] numRXEext;
1379 delete [] numRYEext;
1383 UfftCacheProxy.push_back(UfftCacheProxy[0]);
1393 PRINTF(
"Building G-space (%d %d) and R-space (%d %d/%d) state Chares\n",
1394 nstates, nchareG, nstates, nchareR, nchareRPP);
1395 PRINT_LINE_DASH;printf(
"\n");
1396 availGlobG->reset();
1397 double newtime=CmiWallTimer();
1398 int x=mapOffsets[numInst].getx();
1399 int y=mapOffsets[numInst].gety();
1400 int z=mapOffsets[numInst].getz();
1404 if (firstInstance) {
1405 GSImaptable[numInst].buildMap(nstates, nchareG);
1407 if(config.loadMapFiles) {
1409 size[0] = nstates; size[1] = nchareG;
1410 MapFile *mf =
new MapFile(
"GSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1412 success = mf->loadMap(
"GSMap", &GSImaptable[0]);
1414 success = mf->loadMap(
"GSMap", &GSmaptable);
1421 nchareG, nstates, Gstates_per_pe, config.useCuboidMap, numInst, x, y, z);
1424 CkPrintf(
"GSMap created in %g\n", newtime-Timer);
1426 if((CkNumPes()==1) && (config.fakeTorus!=1))
1427 GSImaptable[numInst]=GSImaptable[0];
1429 GSImaptable[numInst].translate(&GSImaptable[0], x,y,z, config.torusMap==1);
1435 CProxy_GSMap gsMap = CProxy_GSMap::ckNew(thisInstance);
1440 CkArrayOptions gSpaceOpts(nstates,nchareG);
1441 std::string forwardname(
"GSpaceForward");
1442 std::ostringstream fwdstrm;
1443 fwdstrm << forwardname <<
"." << thisInstance.idxU.x <<
"." << thisInstance.idxU.y <<
"." << thisInstance.idxU.z;
1444 int gforward=keeperRegister(fwdstrm.str());
1445 std::string backwardname(
"GSpaceBackward");
1446 std::ostringstream bwdstrm;
1447 bwdstrm << backwardname <<
"." << thisInstance.idxU.x <<
"." << thisInstance.idxU.y <<
"." << thisInstance.idxU.z;
1448 int gbackward=keeperRegister(bwdstrm.str());
1449 gSpaceOpts.setMap(gsMap);
1450 gSpaceOpts.setAnytimeMigration(
false);
1451 gSpaceOpts.setStaticInsertion(
true);
1452 UgSpacePlaneProxy.push_back(CProxy_CP_State_GSpacePlane::ckNew(sizeX, 1, 1, sGrainSize, gforward, gbackward, thisInstance, gSpaceOpts));
1453 UgSpacePlaneProxy[thisInstance.proxyOffset].doneInserting();
1458 CkArrayOptions gspDriverOpts(nstates,nchareG);
1459 gspDriverOpts.setAnytimeMigration(
false);
1460 gspDriverOpts.setStaticInsertion(
true);
1462 gspDriverOpts.bindTo(UgSpacePlaneProxy[thisInstance.proxyOffset]);
1463 UgSpaceDriverProxy.push_back( CProxy_GSpaceDriver::ckNew(thisInstance,gspDriverOpts) );
1464 UgSpaceDriverProxy[thisInstance.proxyOffset].doneInserting();
1471 CkArrayOptions particleOpts(nstates,nchareG);
1472 particleOpts.setAnytimeMigration(
false);
1473 particleOpts.setStaticInsertion(
true);
1474 particleOpts.setMap(gsMap);
1475 particleOpts.bindTo(UgSpacePlaneProxy[thisInstance.proxyOffset]);
1476 UparticlePlaneProxy.push_back(CProxy_CP_State_ParticlePlane::ckNew(
1477 nchareG, sim->sizeY, sim->sizeZ,ngridaNl,ngridbNl,ngridcNl,
1478 1, numSfGrps, natm_nl, natm_nl_grp_max, nstates,
1479 nchareG, Gstates_per_pe, numIterNL, ees_nonlocal_on,
1480 thisInstance, particleOpts));
1481 UparticlePlaneProxy[thisInstance.proxyOffset].doneInserting();
1483 if(config.dumpMapFiles) {
1485 size[0] = nstates; size[1] = nchareG;
1486 MapFile *mf =
new MapFile(
"GSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1488 mf->dumpMap(&GSImaptable[thisInstance.getPO()], thisInstance.getPO());
1490 mf->dumpMap(&GSmaptable);
1495 if(config.dumpMapCoordFiles) {
1498 topoMgr =
new TopoManager();
1501 size[0] = nstates; size[1] = nchareG;
1502 MapFile *mf =
new MapFile(
"GSMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1504 mf->dumpMapCoords(&GSImaptable[thisInstance.getPO()], thisInstance.getPO());
1506 mf->dumpMapCoords(&GSmaptable);
1519 RSImaptable[numInst].buildMap(nstates, nchareR);
1520 Timer=CmiWallTimer();
1521 availGlobR->reset();
1524 if(config.loadMapFiles) {
1526 size[0] = nstates; size[1] = nchareR;
1527 MapFile *mf =
new MapFile(
"RSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1529 success = mf->loadMap(
"RSMap", &RSImaptable[0]);
1531 success = mf->loadMap(
"RSMap", &RSmaptable);
1538 nstates, nchareR, Rstates_per_pe, config.useCuboidMapRS,
1539 &GSImaptable[0], config.nchareG, numInst, x, y, z);
1542 Rstates_per_pe, config.useCuboidMapRS, &GSmaptable, config.nchareG);
1545 newtime=CmiWallTimer();
1546 CkPrintf(
"RSMap created in %g\n", newtime-Timer);
1549 if((CkNumPes()==1) && (config.fakeTorus!=1))
1550 RSImaptable[numInst]=RSImaptable[0];
1552 RSImaptable[numInst].translate(&RSImaptable[0], x,y,z, config.torusMap==1);
1553 CkPrintf(
"RSMap instance %d created in %g\n", numInst, newtime-Timer);
1556 CProxy_RSMap rsMap= CProxy_RSMap::ckNew(thisInstance);
1558 CkArrayOptions realSpaceOpts(nstates,nchareR);
1559 realSpaceOpts.setMap(rsMap);
1560 realSpaceOpts.setAnytimeMigration(
false);
1561 realSpaceOpts.setStaticInsertion(
true);
1564 int rforward=keeperRegister(std::string(
"RealSpaceForward"));
1565 int rbackward=keeperRegister(std::string(
"RealSpaceBackward"));
1568 UrealSpacePlaneProxy.push_back( CProxy_CP_State_RealSpacePlane::ckNew(1, 1, ngrida, ngridb, ngridc, rforward, rbackward, thisInstance, realSpaceOpts));
1569 UrealSpacePlaneProxy[thisInstance.proxyOffset].doneInserting();
1571 if(config.dumpMapFiles) {
1573 size[0] = nstates; size[1] = nchareR;
1574 MapFile *mf =
new MapFile(
"RSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1576 mf->dumpMap(&RSImaptable[thisInstance.getPO()], thisInstance.getPO());
1578 mf->dumpMap(&RSmaptable);
1583 if(config.dumpMapCoordFiles) {
1585 size[0] = nstates; size[1] = nchareR;
1586 MapFile *mf =
new MapFile(
"RSMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1588 mf->dumpMapCoords(&RSImaptable[thisInstance.getPO()], thisInstance.getPO());
1590 mf->dumpMapCoords(&RSmaptable);
1599 availGlobR->reset();
1603 CkPrintf(
"Making SF non-EES\n");
1604 if(!ees_nonlocal_on)
1606 CkPrintf(
"Making SF non-EES\n");
1607 int *nsend =
new int[nchareG];
1608 int **listpe =
new int * [nchareG];
1609 int numproc = config.numPes;
1610 int *gspace_proc =
new int [numproc];
1612 for(
int i =0;i<numproc;i++){gspace_proc[i]=0;}
1613 for(
int j=0;j<nchareG;j++){
1614 listpe[j]=
new int[nstates];
1616 for(
int i=0;i<nstates;i++){
1617 listpe[j][i] = gsprocNum(sim, i, j, thisInstance.getPO());
1618 gspace_proc[listpe[j][i]]+=1;
1620 lst_sort_clean(nstates, &nsend[j], listpe[j]);
1623 FILE *fp = fopen(
"gspplane_proc_distrib.out",
"w");
1624 for(
int i=0;i<numproc;i++){
1625 fprintf(fp,
"%d %d\n",i,gspace_proc[i]);
1628 delete [] gspace_proc;
1630 int minsend=nstates;
1635 CkPrintf(
"Structure factor chareG dests\n");
1636 CkPrintf(
"Number of g-space chares : %d\n",nchareG);
1638 for(
int lsi=0;lsi<nchareG;lsi++){
1640 CkPrintf(
"chareG [%d] nsend %d\n",lsi,nsend[lsi]);
1641 if(nsend[lsi]>maxsend)
1643 if(nsend[lsi]<minsend)
1645 avgsend+=(double) nsend[lsi];
1646 #ifdef SF_SEND_LIST_OUT
1647 for(
int lsj=0;lsj<nsend[lsi];lsj++){
1648 CkPrintf(
"[%d %d] pe %d\n",lsi,lsj,listpe[lsi][lsj]);
1653 CkPrintf(
"SFSends min %d max %d avg %g\n",minsend,maxsend,avgsend/(
double)chareG_use);
1660 if(config.numSfDups<dupmax){dupmax=config.numSfDups;}
1661 config.numSfDups = dupmax;
1662 int numSfDups = dupmax;
1663 CkPrintf(
"real numSfdups is %d based on maxsend of %d\n",numSfDups, maxsend);
1664 CkVec <int> peUsedBySF;
1665 for (
int dup=0; dup<dupmax; dup++){
1666 for (
int x = 0; x < nchareG; x += 1){
1667 int num_dup, istart, iend;
1668 get_grp_params( nsend[x], numSfDups, dup, x ,&num_dup, &istart, &iend);
1672 for (
int AtmGrp=0; AtmGrp<numSfGrps; AtmGrp++){
1673 UsfCompProxy[thisInstance.proxyOffset](AtmGrp, x, dup).insert(numSfGrps,numSfDups,
1674 natm_nl_grp_max, num_dup, &(listpe[x][istart]),
1675 thisInstance,atmGrpMap(istart, num_dup, nsend[x], listpe[x],AtmGrp,dup,x));
1676 peUsedBySF.push_back(atmGrpMap(istart, num_dup, nsend[x], listpe[x], AtmGrp, dup,x));
1679 if(pe_ind>nsend[x]){ pe_ind=0;}
1683 UsfCompProxy[thisInstance.proxyOffset].doneInserting();
1684 UpeUsedBySF.push_back(peUsedBySF);
1685 for(
int j=0;j<nchareG;j++){
delete [] listpe[j];}
1695 if(config.useCommlib) {
1701 CkPrintf(
"Making State streaming strats useGssRP = %d, useMssGP = %d, useGssRPP = %d, useMssGPP = %d\n",(
int)config.useGssInsRealP,(
int)config.useMssInsGP,(
int)config.useGssInsRealPP,(
int)config.useMssInsGPP);
1705 if(config.useGssInsRealP)
1707 StreamingStrategy *gmstrat =
new StreamingStrategy(config.gStreamPeriod,
1708 config.gBucketSize);
1709 gssInstance= ComlibRegister(gmstrat);
1713 if(config.useMssInsGP){
1714 StreamingStrategy *mstrat =
new StreamingStrategy(config.rStreamPeriod,
1715 config.rBucketSize);
1717 mssInstance= ComlibRegister(mstrat);
1719 if (config.useMssInsGPP){
1720 StreamingStrategy *rpmstrat =
new StreamingStrategy(config.rStreamPeriod,
1721 config.rBucketSize);
1723 mssPInstance= ComlibRegister(rpmstrat);
1725 if (config.useGssInsRealPP){
1726 StreamingStrategy *gpmstrat =
new StreamingStrategy(config.gStreamPeriod,
1727 config.gBucketSize);
1728 gssPInstance= ComlibRegister(gpmstrat);
1739 PRINTF(
"Completed G-space/R-space state chare array build\n");
1740 PRINT_LINE_STAR;printf(
"\n");
1767 int ngridaNl = sim->ngrid_nloc_a;
1768 int ngridbNl = sim->ngrid_nloc_b;
1769 int ngridcNl = sim->ngrid_nloc_c;
1770 int ees_nonlocal_on = sim->ees_nloc_on;
1772 int nchareG = sim->nchareG;
1773 int nchareRPP = ngridcNl;
1775 int numIterNL = sim->nlIters;
1776 int zmatSizeMax = sim->nmem_zmat_max;
1779 if(config.useRhoExclusionMap)
1780 nlexcludePes=exclusion;
1781 else if(config.useReductionExclusionMap)
1782 nlexcludePes=
new PeList(UpeUsedByNLZ[thisInstance.proxyOffset]);
1784 nlexcludePes=
new PeList(0);
1785 if(config.excludePE0 && ! config.loadMapFiles)
1786 nlexcludePes->appendOne(0);
1787 int Rstates_per_pe = config.Rstates_per_pe;
1788 availGlobG->reset();
1789 double newtime=CmiWallTimer();
1791 RPPImaptable[thisInstance.getPO()].buildMap(nstates, nchareRPP);
1796 if(config.loadMapFiles) {
1798 size[0] = nstates; size[1] = nchareRPP;
1799 MapFile *mf =
new MapFile(
"RPPMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1801 success = mf->loadMap(
"RPPMap", &RPPImaptable[thisInstance.getPO()]);
1803 success = mf->loadMap(
"RPPMap", &RPPmaptable);
1811 nstates, nchareRPP, Rstates_per_pe,
1812 boxSize, config.useCuboidMap,
1813 config.nchareG, &GSImaptable[thisInstance.getPO()]);
1816 nstates, nchareRPP, Rstates_per_pe,
1817 boxSize, config.useCuboidMap,
1818 config.nchareG, &GSmaptable);
1824 int x=mapOffsets[numInst].getx();
1825 int y=mapOffsets[numInst].gety();
1826 int z=mapOffsets[numInst].getz();
1827 if((CkNumPes()==1) && (config.fakeTorus!=1))
1828 RPPImaptable[numInst]=RPPImaptable[0];
1830 RPPImaptable[numInst].translate(&RPPImaptable[0], x,y,z, config.torusMap==1);
1832 CProxy_RPPMap rspMap= CProxy_RPPMap::ckNew(thisInstance);
1833 newtime=CmiWallTimer();
1834 CmiNetworkProgressAfter(0);
1835 CkPrintf(
"RPPMap created in %g\n",newtime-Timer);
1837 if(config.dumpMapFiles) {
1839 size[0] = nstates; size[1] = nchareRPP;
1840 MapFile *mf =
new MapFile(
"RPPMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1842 mf->dumpMap(&RPPImaptable[thisInstance.getPO()], thisInstance.getPO());
1844 mf->dumpMap(&RPPmaptable);
1848 if(config.dumpMapCoordFiles) {
1850 size[0] = nstates; size[1] = nchareRPP;
1851 MapFile *mf =
new MapFile(
"RPPMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
1853 mf->dumpMapCoords(&RPPImaptable[thisInstance.getPO()], thisInstance.getPO());
1855 mf->dumpMapCoords(&RPPmaptable);
1860 if(config.useRhoExclusionMap)
1866 if(nlexcludePes!=NULL)
1867 delete nlexcludePes;
1869 if(config.excludePE0 && !config.loadMapFiles)
1871 if(nlexcludePes==NULL)
1872 nlexcludePes=
new PeList(0);
1873 nlexcludePes->appendOne(0);
1876 CkArrayOptions pRealSpaceOpts(nstates,ngridcNl);
1877 pRealSpaceOpts.setMap(rspMap);
1878 pRealSpaceOpts.setAnytimeMigration(
false);
1879 pRealSpaceOpts.setStaticInsertion(
true);
1880 UrealParticlePlaneProxy.push_back(CProxy_CP_State_RealParticlePlane::ckNew(
1881 ngridaNl,ngridbNl,ngridcNl,
1882 numIterNL,zmatSizeMax,Rstates_per_pe,
1883 nchareG,ees_nonlocal_on, thisInstance,
1885 UrealParticlePlaneProxy[thisInstance.proxyOffset].doneInserting();
1888 PRINTF(
"Completed RealParticle chare array build\n");
1889 PRINT_LINE_STAR;printf(
"\n");
1911 int ngrid_eext_a = sim->ngrid_eext_a;
1912 int ngrid_eext_b = sim->ngrid_eext_b;
1913 int ngrid_eext_c = sim->ngrid_eext_c;
1914 int ees_eext_on = sim->ees_eext_on;
1915 int ees_nonlocal_on = sim->ees_nloc_on;
1916 int natmTyp = sim->natm_typ;
1917 int nchareRhoG = sim->nchareRhoG;
1918 int nchareRhoR = sim->sizeZ;
1919 int rhoGHelpers = config.rhoGHelpers;
1920 int nchareHartAtmT = config.nchareHartAtmT;
1921 int nchareRhoGHart = rhoGHelpers*nchareRhoG;
1922 int nchareRhoRHart = ngrid_eext_c;
1925 if(thisInstance.idxU.y>0)
1933 zeroKpointInstance.idxU.y=0;
1934 int proxyOffset=zeroKpointInstance.setPO();
1935 UrhoRealProxy.push_back(UrhoRealProxy[proxyOffset]);
1936 UrhoGProxy.push_back(UrhoGProxy[proxyOffset]);
1937 UrhoGHartExtProxy.push_back(UrhoGHartExtProxy[proxyOffset]);
1939 UrhoRHartExtProxy.push_back(UrhoRHartExtProxy[proxyOffset]);
1941 UlsRhoGProxy.push_back(UlsRhoGProxy[proxyOffset]);
1942 UlsRhoRealProxy.push_back(UlsRhoRealProxy[proxyOffset]);
1954 CkPrintf(
"Building RhoR, RhoG, RhoGHartExt, RhoRHartExt Chares %d %d %d %d natmtyp:%d\n",
1955 nchareRhoR,nchareRhoG,nchareRhoGHart,nchareRhoRHart,natmTyp);
1956 PRINT_LINE_DASH;printf(
"\n");
1963 if(!config.loadMapFiles)
1965 availGlobR->reset();
1967 RhoAvail=
new PeList(*availGlobR);
1971 excludePes=
new PeList(0);
1972 if(config.excludePE0 && !config.loadMapFiles)
1973 excludePes->appendOne(0);
1976 if(config.useReductionExclusionMap && !config.loadMapFiles)
1978 if( nchareRhoR*config.rhoRsubplanes+UpeUsedByNLZ[thisInstance.proxyOffset].size() <
1981 CkPrintf(
"subtracting %d NLZ nodes from %d for RhoR Map\n",
1982 UpeUsedByNLZ[thisInstance.proxyOffset].size(),RhoAvail->count());
1984 *RhoAvail-*excludePes;
1985 RhoAvail->reindex();
1986 CkPrintf(
"Leaving %d for RhoR Map\n",RhoAvail->count());
1992 if(ees_nonlocal_on==0){
1993 if( nchareRhoR*config.rhoRsubplanes+UpeUsedBySF[thisInstance.proxyOffset].size()<RhoAvail->count()){
1994 CkPrintf(
"subtracting %d SF nodes from %d for RhoR Map\n",
1995 UpeUsedBySF[thisInstance.proxyOffset].size(),RhoAvail->count());
1996 PeList sf(UpeUsedBySF[thisInstance.proxyOffset]);
1998 RhoAvail->reindex();
2002 if(!config.loadMapFiles && RhoAvail->count()>2 ) { RhoAvail->reindex(); }
2012 RhoRSImaptable[thisInstance.getPO()].buildMap(nchareRhoR, config.rhoRsubplanes);
2014 if(config.loadMapFiles) {
2016 size[0] = nchareRhoR; size[1] = config.rhoRsubplanes;
2017 MapFile *mf =
new MapFile(
"RhoRSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2018 success = mf->loadMap(
"RhoRSMap", &RhoRSImaptable[thisInstance.getPO()]);
2022 RhoRSMapTable RhoRStable(&RhoRSImaptable[thisInstance.getPO()], RhoAvail, nchareRhoR, config.rhoRsubplanes, config.nstates, config.useCentroidMapRho, &RSImaptable[thisInstance.getPO()], excludePes);
2027 int x=mapOffsets[numInst].getx();
2028 int y=mapOffsets[numInst].gety();
2029 int z=mapOffsets[numInst].getz();
2030 if((CkNumPes()==1) && (config.fakeTorus!=1))
2031 RhoRSImaptable[numInst]=RhoRSImaptable[0];
2033 RhoRSImaptable[numInst].translate(&RhoRSImaptable[0], x,y,z, config.torusMap==1);
2036 CProxy_RhoRSMap rhorsMap = CProxy_RhoRSMap::ckNew(thisInstance);
2037 CkArrayOptions rhorsOpts(nchareRhoR, config.rhoRsubplanes);
2039 rhorsOpts.setMap(rhorsMap);
2040 rhorsOpts.setAnytimeMigration(
false);
2041 rhorsOpts.setStaticInsertion(
true);
2042 if(config.dumpMapFiles) {
2044 size[0] = nchareRhoR; size[1] = config.rhoRsubplanes;
2045 MapFile *mf =
new MapFile(
"RhoRSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2047 mf->dumpMap(&RhoRSImaptable[thisInstance.getPO()], thisInstance.getPO());
2049 mf->dumpMap(&RhoRSmaptable);
2053 if(config.dumpMapCoordFiles) {
2055 size[0] = nchareRhoR; size[1] = config.rhoRsubplanes;
2056 MapFile *mf =
new MapFile(
"RhoRSMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2058 mf->dumpMapCoords(&RhoRSImaptable[thisInstance.getPO()], thisInstance.getPO());
2060 mf->dumpMapCoords(&RhoRSmaptable);
2064 CmiNetworkProgressAfter(0);
2068 if(!config.loadMapFiles && nchareRhoG>RhoAvail->count())
2070 CkPrintf(
"refreshing avail list count %d less than rhog %d\n",RhoAvail->count(), nchareRhoG);
2075 RhoGSImaptable[thisInstance.getPO()].buildMap(nchareRhoG, 1);
2077 if(config.loadMapFiles) {
2079 size[0] = nchareRhoG; size[1] = 1;
2080 MapFile *mf =
new MapFile(
"RhoGSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2081 success = mf->loadMap(
"RhoGSMap", &RhoGSImaptable[thisInstance.getPO()]);
2085 RhoGSMapTable RhoGStable(&RhoGSImaptable[thisInstance.getPO()], RhoAvail,nchareRhoG, config.useCentroidMapRho, &RhoRSImaptable[thisInstance.getPO()], excludePes);
2091 int x=mapOffsets[numInst].getx();
2092 int y=mapOffsets[numInst].gety();
2093 int z=mapOffsets[numInst].getz();
2094 if((CkNumPes()==1) && (config.fakeTorus!=1))
2095 RhoGSImaptable[numInst]=RhoGSImaptable[0];
2097 RhoGSImaptable[numInst].translate(&RhoGSImaptable[0], x,y,z, config.torusMap==1);
2101 CProxy_RhoGSMap rhogsMap = CProxy_RhoGSMap::ckNew(thisInstance);
2102 CkArrayOptions rhogsOpts(nchareRhoG,1);
2104 rhogsOpts.setMap(rhogsMap);
2105 rhogsOpts.setAnytimeMigration(
false);
2106 rhogsOpts.setStaticInsertion(
true);
2107 if(config.dumpMapFiles) {
2109 size[0] = nchareRhoG; size[1] = 1;
2110 MapFile *mf =
new MapFile(
"RhoGSMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2112 mf->dumpMap(&RhoGSImaptable[thisInstance.getPO()], thisInstance.getPO());
2114 mf->dumpMap(&RhoGSmaptable);
2118 if(config.dumpMapCoordFiles) {
2120 size[0] = nchareRhoG; size[1] = 1;
2121 MapFile *mf =
new MapFile(
"RhoGSMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2123 mf->dumpMapCoords(&RhoGSImaptable[thisInstance.getPO()], thisInstance.getPO());
2125 mf->dumpMapCoords(&RhoGSmaptable);
2134 if(!config.loadMapFiles && nchareRhoRHart*nchareHartAtmT > RhoAvail->count())
2136 CkArrayOptions rhorhartOpts(nchareRhoRHart, config.rhoRsubplanes, nchareHartAtmT);
2138 rhorhartOpts.setAnytimeMigration(
false);
2139 rhorhartOpts.setStaticInsertion(
true);
2143 RhoRHartImaptable[thisInstance.getPO()].buildMap(nchareRhoRHart, config.rhoRsubplanes, nchareHartAtmT);
2145 if(config.loadMapFiles) {
2147 size[0] = nchareRhoRHart; size[1] = config.rhoRsubplanes;
2148 size[2] = nchareHartAtmT;
2149 MapFile *mf =
new MapFile(
"RhoRHartMap", 3, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2150 success = mf->loadMap(
"RhoRHartMap", &RhoRHartImaptable[thisInstance.getPO()]);
2154 RhoRHartMapTable RhoRHarttable(&RhoRHartImaptable[thisInstance.getPO()], RhoAvail,
2155 nchareRhoRHart, config.rhoRsubplanes,
2156 config.nchareHartAtmT, excludePes);
2161 int x=mapOffsets[numInst].getx();
2162 int y=mapOffsets[numInst].gety();
2163 int z=mapOffsets[numInst].getz();
2164 if((CkNumPes()==1) && (config.fakeTorus!=1))
2165 RhoRHartImaptable[numInst]=RhoRHartImaptable[0];
2167 RhoRHartImaptable[numInst].translate(&RhoRHartImaptable[0], x,y,z, config.torusMap==1);
2171 CProxy_RhoRHartMap rhorHartMap = CProxy_RhoRHartMap::ckNew(thisInstance);
2172 rhorhartOpts.setMap(rhorHartMap);
2174 if(config.dumpMapFiles) {
2176 size[0] = nchareRhoRHart; size[1] = config.rhoRsubplanes,
2177 size[2] = nchareHartAtmT;
2178 MapFile *mf =
new MapFile(
"RhoRHartMap", 3, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2180 mf->dumpMap(&RhoRHartImaptable[thisInstance.getPO()], thisInstance.getPO());
2182 mf->dumpMap(&RhoRHartmaptable);
2186 if(config.dumpMapCoordFiles) {
2188 size[0] = nchareRhoRHart; size[1] = config.rhoRsubplanes,
2189 size[2] = nchareHartAtmT;
2190 MapFile *mf =
new MapFile(
"RhoRHartMap_coord", 3, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2192 mf->dumpMapCoords(&RhoRHartImaptable[thisInstance.getPO()], thisInstance.getPO());
2194 mf->dumpMapCoords(&RhoRHartmaptable);
2199 CkPrintf(
"RhoRHartMap built %d x %d x %d\n",nchareRhoRHart, config.rhoRsubplanes, config.nchareHartAtmT);
2203 if(!config.loadMapFiles && nchareRhoGHart>RhoAvail->count())
2207 RhoGHartImaptable[thisInstance.getPO()].buildMap(nchareRhoGHart, nchareHartAtmT);
2209 if(config.loadMapFiles) {
2211 size[0] = nchareRhoGHart; size[1] = nchareHartAtmT;
2212 MapFile *mf =
new MapFile(
"RhoGHartMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2213 success = mf->loadMap(
"RhoGHartMap", &RhoGHartImaptable[thisInstance.getPO()]);
2220 RhoRHartImaptablep=&RhoRHartImaptable[thisInstance.getPO()];
2221 RhoGHartMapTable RhoGHarttable(&RhoGHartImaptable[thisInstance.getPO()], RhoAvail,
2222 nchareRhoGHart, config.nchareHartAtmT,
2223 config.useCentroidMapRho,
2224 RhoRHartImaptablep, excludePes);
2230 int x=mapOffsets[numInst].getx();
2231 int y=mapOffsets[numInst].gety();
2232 int z=mapOffsets[numInst].getz();
2233 if((CkNumPes()==1) && (config.fakeTorus!=1))
2234 RhoGHartImaptable[numInst]=RhoGHartImaptable[0];
2236 RhoGHartImaptable[numInst].translate(&RhoGHartImaptable[0], x,y,z, config.torusMap==1);
2240 CProxy_RhoGHartMap rhogHartMap = CProxy_RhoGHartMap::ckNew(thisInstance);
2241 CkArrayOptions rhoghartOpts(nchareRhoGHart, nchareHartAtmT);
2243 rhoghartOpts.setMap(rhogHartMap);
2244 rhoghartOpts.setAnytimeMigration(
false);
2245 rhoghartOpts.setStaticInsertion(
true);
2246 if(config.dumpMapFiles) {
2248 size[0] = nchareRhoGHart; size[1] = nchareHartAtmT;
2249 MapFile *mf =
new MapFile(
"RhoGHartMap", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2251 mf->dumpMap(&RhoGHartImaptable[thisInstance.getPO()], thisInstance.getPO());
2253 mf->dumpMap(&RhoGHartmaptable);
2257 if(config.dumpMapCoordFiles) {
2259 size[0] = nchareRhoGHart; size[1] = nchareHartAtmT;
2260 MapFile *mf =
new MapFile(
"RhoGHartMap_coord", 2, size, config.numPes,
"TXYZ", 2, 1, 1, 1);
2262 mf->dumpMapCoords(&RhoGHartImaptable[thisInstance.getPO()], thisInstance.getPO());
2264 mf->dumpMapCoords(&RhoGHartmaptable);
2277 int rhokeeper= keeperRegister(std::string(
"Density"));
2279 UrhoRealProxy.push_back(CProxy_CP_Rho_RealSpacePlane::ckNew(sizeX,dummy,
2280 ees_eext_on, ngrid_eext_c,
2290 UrhoRealProxy[thisInstance.proxyOffset].doneInserting();
2292 UrhoRealProxy[thisInstance.proxyOffset].ckSetReductionClient(
new CkCallback(CkIndex_InstanceController::printEnergyEexc(NULL),CkArrayIndex1D(thisInstance.proxyOffset),instControllerProxy));
2293 CmiNetworkProgressAfter(0);
2296 UrhoGProxy.push_back(CProxy_CP_Rho_GSpacePlane::ckNew(sizeX, 1,
2297 1, dummy, thisInstance,
2303 UrhoGProxy[thisInstance.proxyOffset].doneInserting();
2304 CmiNetworkProgressAfter(0);
2307 UrhoGHartExtProxy.push_back(CProxy_CP_Rho_GHartExt::ckNew(ngrid_eext_a,ngrid_eext_b,
2308 ngrid_eext_c,ees_eext_on,
2309 natmTyp, thisInstance,
2320 UrhoGHartExtProxy[thisInstance.proxyOffset].ckSetReductionClient(
new CkCallback(CkIndex_InstanceController::printEnergyHart(NULL),CkArrayIndex1D(thisInstance.proxyOffset),instControllerProxy));
2321 UrhoGHartExtProxy[thisInstance.proxyOffset].doneInserting();
2322 CmiNetworkProgressAfter(0);
2326 UrhoRHartExtProxy.push_back(CProxy_CP_Rho_RHartExt::ckNew(ngrid_eext_a,ngrid_eext_b,
2327 ngrid_eext_c,ees_eext_on,
2328 natmTyp,thisInstance,
2340 UrhoRHartExtProxy[thisInstance.proxyOffset].doneInserting();
2342 CmiNetworkProgressAfter(0);
2347 int nchareRhoGLSP=1;
2348 int nchareRhoRealLSP=1;
2349 int nchareRhoRealLSPsubplanes=1;
2350 CkArrayOptions lspgspOpts(nchareRhoGLSP);
2351 CkArrayOptions lsprealOpts(nchareRhoRealLSP, nchareRhoRealLSPsubplanes);
2352 UlsRhoGProxy.push_back(CProxy_CP_LargeSP_RhoGSpacePlane::ckNew(thisInstance,lspgspOpts));
2353 UlsRhoRealProxy.push_back(CProxy_CP_LargeSP_RhoRealSpacePlane::ckNew(thisInstance,lsprealOpts));
2356 PRINTF(
"Completed G-space/R-space Rho chare array build\n");
2357 PRINT_LINE_STAR;printf(
"\n");
2378 if(thisInstance.idxU.y>0|| thisInstance.idxU.s>0)
2385 zeroKpointInstance.idxU.y=0;
2386 zeroKpointInstance.idxU.s=0;
2387 int proxyOffset=zeroKpointInstance.setPO();
2388 UatomsCacheProxy.push_back(UatomsCacheProxy[proxyOffset]);
2389 UatomsComputeProxy.push_back(UatomsComputeProxy[proxyOffset]);
2390 UegroupProxy.push_back(UegroupProxy[proxyOffset]);
2394 int ibead = thisInstance.idxU.x;
2395 int itemper = thisInstance.idxU.z;
2396 PhysicsAtomPosInit *PhysicsAtom =
new PhysicsAtomPosInit(ibead,itemper);
2397 int natm = PhysicsAtom->natm_tot;
2398 int natm_nl = PhysicsAtom->natm_nl;
2399 int len_nhc = PhysicsAtom->len_nhc;
2400 int iextended_on = PhysicsAtom->iextended_on;
2401 int cp_min_opt = PhysicsAtom->cp_min_opt;
2402 int cp_wave_opt = PhysicsAtom->cp_wave_opt;
2403 int isokin_opt = PhysicsAtom->isokin_opt;
2404 double kT = PhysicsAtom->kT;
2409 PhysicsAtom->DriverAtomInit(natm,atoms,atomsNHC,ibead,itemper);
2410 UegroupProxy.push_back(CProxy_EnergyGroup::ckNew(thisInstance));
2413 int nChareAtoms=(config.numPesPerInstance<natm) ? config.numPesPerInstance : natm;
2415 if (firstInstance) {
2417 AtomImaptable[numInst].buildMap(nChareAtoms);
2418 availGlobG->reset();
2420 numInst,nChareAtoms);
2424 int x=mapOffsets[numInst].getx();
2425 int y=mapOffsets[numInst].gety();
2426 int z=mapOffsets[numInst].getz();
2427 if((CkNumPes()==1) && (config.fakeTorus!=1))
2428 AtomImaptable[numInst]=AtomImaptable[0];
2430 AtomImaptable[numInst].translate(&AtomImaptable[0], x,y,z, config.torusMap==1);
2432 CProxy_AtomComputeMap aMap = CProxy_AtomComputeMap::ckNew(thisInstance);
2433 CkArrayOptions atomOpts(nChareAtoms);
2434 atomOpts.setMap(aMap);
2435 atomOpts.setAnytimeMigration(
false);
2436 atomOpts.setStaticInsertion(
true);
2437 UatomsCacheProxy.push_back( CProxy_AtomsCache::ckNew(natm,natm_nl,
2438 atoms,thisInstance));
2439 UatomsComputeProxy.push_back( CProxy_AtomsCompute::ckNew(natm,natm_nl,
2442 cp_min_opt,cp_wave_opt,isokin_opt,
2463 static CkReductionMsg *complexSum(
int nMsg, CkReductionMsg **msgs){
2466 int matrixSize = msgs[0]->getSize() /
sizeof(
complex);
2469 for (m = 0; m < nMsg; m++) {
2471 CkAssert(msgs[m]->getSize() == matrixSize *
sizeof(
complex));
2473 for (i = 0; i < matrixSize; i++)
2474 matrix[i] += data[i];
2476 CkReductionMsg *ret = CkReductionMsg::buildNew(matrixSize *
2487 void get_grp_params(
int natm_nl,
int numSfDups,
int indexSfGrp,
int planeIndex,
2488 int *n_ret,
int *istrt_ret,
int *iend_ret)
2493 int n = (natm_nl/numSfDups);
2494 int m = (natm_nl % numSfDups);
2496 int istrt = n*indexSfGrp;
2497 if(indexSfGrp>=m){istrt += m;}
2498 if(indexSfGrp<m) {istrt += indexSfGrp;}
2499 if(indexSfGrp<m) {n++;}
2501 if(numSfDups>natm_nl)
2507 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
2508 CkPrintf(
"Redundant DupSF for chare-G %d\n",planeIndex);
2509 CkPrintf(
"At present this hangs, so out you go\n");
2510 CkPrintf(
"@@@@@@@@@@@@@@@@@@@@_error_@@@@@@@@@@@@@@@@@@@@@@\n");
2515 (*istrt_ret) = istrt;
2528 int atmGrpMap(
int istart,
int nsend,
int listsize,
int *listpe,
int AtmGrp,
2529 int dup,
int planeIndex)
2534 int numSfDups=config.numSfDups;
2536 if(listsize <= numSfDups){
2537 return listpe[(dup % listsize)];
2540 if(nsend <= config.numSfGrps){
2541 return listpe[(istart + (AtmGrp % nsend))];
2545 return listpe[(istart + ((AtmGrp + config.numSfGrps * planeIndex)%nsend))];
2555 int gsprocNum(
CPcharmParaInfo *sim,
int state,
int plane,
int numInst) {
2557 proc = GSImaptable[numInst].get(state, plane);
2558 if(config.fakeTorus)
2559 proc=proc%CkNumPes();
2583 bool findCuboid(
int &x,
int &y,
int &z,
int &order,
int maxX,
int maxY,
int maxZ,
int maxT,
int volume,
int vn){
2591 if(config.forceMappingAxis>-1)
2593 order=config.forceMappingAxis;
2594 if (config.forceMappingAxis==0)
2596 if (config.forceMappingAxis==1)
2598 if (config.forceMappingAxis==2)
2604 maxD = (maxY>maxD) ? maxY : maxD;
2605 maxD = (maxZ>maxD) ? maxZ : maxD;
2608 maxD = (maxY>maxD) ? maxY : maxD;
2609 maxD = (maxZ>maxD) ? maxZ : maxD;
2610 minD = (maxY<minD) ? maxY : minD;
2611 minD = (maxZ<maxD) ? maxZ : minD;
2616 maxD = (maxY>maxD) ? maxY : maxD;
2617 maxD = (maxZ>maxD) ? maxZ : maxD;
2618 minD = (maxY<minD) ? maxY : minD;
2619 minD = (maxZ<minD) ? maxZ : minD;
2624 if(config.useCuboidMapRS)
2626 CkPrintf(
"Using long prisms for useCuboidMapRS\n");
2643 int redVol = volume / maxT;
2644 double cubert= cbrt((
double) redVol);
2645 int cubetrunc= (int) cubert;
2653 if(redVol==x*y*z && !config.useCuboidMapRS)
2655 bool switchSet=
false;
2660 x=1; y=1; z=1; switchSet=
true;
break;
2662 x=2; y=1; z=1; switchSet=
true;
break;
2664 x=3; y=1; z=1; switchSet=
true;
break;
2666 x=2; y=2; z=1; switchSet=
true;
break;
2668 x=5; y=1; z=1; switchSet=
true;
break;
2670 x=3; y=2; z=1; switchSet=
true;
break;
2672 x=7; y=1; z=1; switchSet=
true;
break;
2674 if(config.useCuboidMapRS)
2678 { x=2; y=2; z=2; switchSet=
true;
break;}
2687 x=3; y=3; z=1; switchSet=
true;
break;
2689 x=5; y=2; z=1; switchSet=
true;
break;
2691 x=2; y=3; z=2; switchSet=
true;
break;
2693 x=7; y=2; z=1; switchSet=
true;
break;
2695 x=5; y=3; z=1; switchSet=
true;
break;
2697 if(config.useCuboidMapRS)
2700 { x=8; y=2; z=1; switchSet=
true;
break;}
2702 x=4; y=2; z=2; switchSet=
true;
break;
2704 x=3; y=3; z=2; switchSet=
true;
break;
2706 x=5; y=2; z=2; switchSet=
true;
break;
2708 x=7; y=3; z=1; switchSet=
true;
break;
2710 x=4; y=3; z=2; switchSet=
true;
break;
2712 x=5; y=5; z=1; switchSet=
true;
break;
2714 x=3; y=3; z=3; switchSet=
true;
break;
2716 x=7; y=2; z=2; switchSet=
true;
break;
2718 x=5; y=2; z=2; switchSet=
true;
break;
2720 if(config.useCuboidMapRS)
2723 { x=8; y=2; z=2; switchSet=
true;
break;}
2725 { x=16; y=2; z=1; switchSet=
true;
break;}
2727 { x=32; y=1; z=1; switchSet=
true;
break;}
2730 x=4; y=2; z=4; switchSet=
true;
break;
2732 x=7; y=5; z=1; switchSet=
true;
break;
2734 x=4; y=3; z=3; switchSet=
true;
break;
2736 x=5; y=4; z=2; switchSet=
true;
break;
2738 x=7; y=3; z=2; switchSet=
true;
break;
2740 x=7; y=3; z=2; switchSet=
true;
break;
2742 x=5; y=3; y=3; switchSet=
true;
break;
2744 x=4; y=3; z=4; switchSet=
true;
break;
2746 x=5; y=5; z=2; switchSet=
true;
break;
2748 x=6; y=3; z=3; switchSet=
true;
break;
2750 x=7; y=4; z=2; switchSet=
true;
break;
2752 x=5; y= 4; z=3; switchSet=
true;
break;
2754 if(config.useCuboidMapRS)
2757 { x=8; y=4; z=2; switchSet=
true;
break;}
2759 { x=16; y=2; z=2; switchSet=
true;
break;}
2761 { x=32; y=2; z=1; switchSet=
true;
break;}
2763 { x=64; y=1; z=1; switchSet=
true;
break;}
2765 x=4; y=4; z=4; switchSet=
true;
break;
2767 if(config.useCuboidMapRS)
2770 { x=8; y=4; z=4; switchSet=
true;
break;}
2772 {x=16; y=4; z=2; switchSet=
true;
break;}
2774 { x=32; y=2; z=2; switchSet=
true;
break; }
2776 { x=64; y=2; z=1; switchSet=
true;
break; }
2778 { x=128; y=1; z=1; switchSet=
true;
break; }
2780 x=8; y=4; z=4; switchSet=
true;
break;
2782 if(config.useCuboidMapRS)
2785 { x=8; y=8; z=4; switchSet=
true;
break;}
2787 { x=16; y=4; z=4; switchSet=
true;
break;}
2789 { x=32; y=4; z=2; switchSet=
true;
break;}
2791 { x=64; y=2; z=2; switchSet=
true;
break;}
2793 { x=64; y=2; z=1; switchSet=
true;
break;}
2795 x=8; y=8; z=4; switchSet=
true;
break;
2797 if(config.useCuboidMapRS)
2800 { x=8; y=8; z=8; switchSet=
true;
break;}
2802 { x=16; y=4; z=8; switchSet=
true;
break;}
2804 { x=32; y=4; z=4; switchSet=
true;
break;}
2806 { x=64; y=4; z=2; switchSet=
true;
break;}
2808 { x=128; y=2; z=2; switchSet=
true;
break;}
2810 { x=256; y=2; z=1; switchSet=
true;
break;}
2812 x=8; y=8; z=8; switchSet=
true;
break;
2817 if(switchSet && config.forceMappingAxis>-1)
2820 switch(config.forceMappingAxis)
2886 int start=cubetrunc-1;
2887 if(config.useCuboidMapRS)
2888 x = (redVol>=maxX) ? maxX : cubetrunc;
2893 for(y=start; y<=maxY;y++)
2895 for(z=start; z<=maxZ;z++)
2911 CkReduction::reducerType sumFastDoubleType;
2912 void registersumFastDouble(
void){
2926 int size0=msgs[0]->getSize();
2927 int size=size0/
sizeof(double);
2932 double *ret=(
double *)msgs[0]->getData();
2934 for(
int i=1; i<nMsg;i++)
2936 inmatrix=(
double *) msgs[i]->getData();
2937 for(
int d=0;d<size;d++)
2938 ret[d]+=inmatrix[d];
2940 return CkReductionMsg::buildNew(size0,ret);
2949 int nplane,
int sizeY,
int ngridbHart,
2950 int *numRXRho,
int *numRYRho,
int *numRXEext,
int *numRYEext,
2957 if(rhoRsubplanes==1){
2959 for(
int i=0;i<nchareR;i++){
2960 numRXRho[i] = sizeY;
2961 numRYRho[i] = nplane;
2964 for(
int i=0;i<nchareRHart;i++){
2965 numRXEext[i] = ngridbHart;
2966 numRYEext[i] = nplane;
2974 if(rhoRsubplanes>1){
2979 div = (sizeY / rhoRsubplanes);
2980 rem = (sizeY % rhoRsubplanes);
2981 for(
int j=0;j<rhoRsubplanes;j++){
2982 int mySizeY = (j < rem ? div+1 : div);
2983 for(
int i=0;i<nchareR;i++){
2984 int ind = j*nchareR + i;
2985 numRXRho[ind] = mySizeY;
2991 for(
int j=0;j<rhoRsubplanes;j++){
2992 int myNplane = numSubGx[j];
2993 for(
int i=0;i<nchareR;i++){
2994 int ind = j*nchareR + i;
2995 numRYRho[ind] = myNplane;
3001 div = (ngridbHart / rhoRsubplanes);
3002 rem = (ngridbHart % rhoRsubplanes);
3003 for(
int j=0;j<rhoRsubplanes;j++){
3004 int myNgridb = (j < rem ? div+1 : div);
3005 for(
int i=0;i<nchareRHart;i++){
3006 int ind = j*nchareRHart + i;
3007 numRXEext[ind] = myNgridb;
3013 for(
int j=0;j<rhoRsubplanes;j++){
3014 int myNplane = numSubGx[j];
3015 for(
int i=0;i<nchareRHart;i++){
3016 int ind = j*nchareRHart + i;
3017 numRYEext[ind] = myNplane;
3034 traceRegisterUserEvent(
"doRealFwFFT", doRealFwFFT_);
3036 traceRegisterUserEvent(
"GspaceFwFFT", GspaceFwFFT_);
3038 traceRegisterUserEvent(
"fwFFTGtoR0", fwFFTGtoR0_);
3039 traceRegisterUserEvent(
"fwFFTGtoRnot0", fwFFTGtoRnot0_);
3040 traceRegisterUserEvent(
"OrthoDGEMM1", OrthoDGEMM1_);
3041 traceRegisterUserEvent(
"GradCorrGGA", GradCorrGGA_);
3042 traceRegisterUserEvent(
"WhiteByrdFFTX", WhiteByrdFFTX_);
3043 traceRegisterUserEvent(
"doRealBwFFT", doRealBwFFT_);
3044 traceRegisterUserEvent(
"WhiteByrdFFTY", WhiteByrdFFTY_);
3045 traceRegisterUserEvent(
"WhiteByrdFFTZ", WhiteByrdFFTZ_);
3046 traceRegisterUserEvent(
"PostByrdfwFFTGtoR", PostByrdfwFFTGtoR_);
3047 traceRegisterUserEvent(
"RhoRtoGFFT", RhoRtoGFFT_);
3048 traceRegisterUserEvent(
"BwFFTRtoG", BwFFTRtoG_);
3049 traceRegisterUserEvent(
"OrthoDGEMM2", OrthoDGEMM2_);
3050 traceRegisterUserEvent(
"ByrdanddoFwFFTGtoR",ByrdanddoFwFFTGtoR_);
3051 traceRegisterUserEvent(
"eesHartExcG",eesHartExcG_);
3052 traceRegisterUserEvent(
"eesEwaldG",eesEwaldG_);
3053 traceRegisterUserEvent(
"eesAtmForcR",eesAtmForcR_);
3054 traceRegisterUserEvent(
"eesAtmBspline",eesAtmBspline_);
3055 traceRegisterUserEvent(
"eesZmatR",eesZmatR_);
3056 traceRegisterUserEvent(
"eesEnergyAtmForcR",eesEnergyAtmForcR_);
3057 traceRegisterUserEvent(
"eesProjG",eesProjG_);
3058 traceRegisterUserEvent(
"doNlFFTGtoR",doNlFFTGtoR_);
3059 traceRegisterUserEvent(
"doNlFFTRtoG",doNlFFTRtoG_);
3060 traceRegisterUserEvent(
"eesPsiForcGspace",eesPsiForcGspace_);
3061 traceRegisterUserEvent(
"enlMatrixCalc",enlMatrixCalc_);
3062 traceRegisterUserEvent(
"enlAtmForcCalc",enlAtmForcCalc_);
3063 traceRegisterUserEvent(
"enlForcCalc",enlForcCalc_);
3064 traceRegisterUserEvent(
"doEextFFTRtoG",doEextFFTRtoG_);
3065 traceRegisterUserEvent(
"doEextFFTGtoR",doEextFFTGtoR_);
3067 traceRegisterUserEvent(
"HartExcVksG",HartExcVksG_);
3068 traceRegisterUserEvent(
"divRhoVksGspace",divRhoVksGspace_);
3069 traceRegisterUserEvent(
"GspaceBwFFT", GspaceBwFFT_);
3070 traceRegisterUserEvent(
"DoFFTContribute", DoFFTContribute_);
3072 traceRegisterUserEvent(
"Scalcmap", Scalcmap_);
3073 traceRegisterUserEvent(
"AcceptStructFact", AcceptStructFact_);
3074 traceRegisterUserEvent(
"doEextFFTGxtoRx", doEextFFTGxtoRx_);
3075 traceRegisterUserEvent(
"doEextFFTRytoGy", doEextFFTRytoGy_);
3076 traceRegisterUserEvent(
"doRhoFFTRytoGy", doRhoFFTRytoGy_);
3077 traceRegisterUserEvent(
"doRhoFFTGxtoRx", doRhoFFTGxtoRx_);
3079 traceRegisterUserEvent(
"GSProcnum", 10000);
3080 traceRegisterUserEvent(
"RSProcnum", 20000);
3081 traceRegisterUserEvent(
"SCProcnum", 30000);
3082 traceRegisterUserEvent(
"GHartAtmForcCopy",GHartAtmForcCopy_);
3083 traceRegisterUserEvent(
"GHartAtmForcSend",GHartAtmForcSend_);
3084 Ortho_UE_step2 = traceRegisterUserEvent(
"Ortho step 2");
3085 Ortho_UE_step3 = traceRegisterUserEvent(
"Ortho step 3");
3086 Ortho_UE_error = traceRegisterUserEvent(
"Ortho error");
3090 void computeMapOffsets()
3092 int x, y, z, x1, y1, z1;
3094 for(
int thisInst=1; thisInst<config.numInstances; thisInst++)
3096 if(config.torusMap == 1) {
3097 int dimNX, dimNY, dimNZ;
3098 int longDim = -1, maxD;
3100 x1 = dimNX = topoMgr->getDimNX();
3101 y1 = dimNY = topoMgr->getDimNY();
3102 z1 = dimNZ = topoMgr->getDimNZ();
3107 if (dimNY > maxD) { maxD = dimNY; longDim = 2; }
3108 if (dimNZ > maxD) { maxD = dimNZ; longDim = 3; }
3112 x = thisInst*(maxD/config.numInstances); y = 0; z = 0;
3113 x1 = dimNX / config.numInstances;
3116 x = 0; y = thisInst*(maxD/config.numInstances); z = 0;
3117 y1 = dimNY / config.numInstances;
3120 x = 0; y = 0; z = thisInst*(maxD/config.numInstances);
3121 z1 = dimNZ / config.numInstances;
3128 x=thisInst*config.numPesPerInstance;
3143 cfgSymmPC->
isDynamics = (sim->cp_min_opt==1)?
false:
true;
3148 cfgSymmPC->
grainSize = config.sGrainSize;
3152 cfgSymmPC->
isLBon = config.lbpaircalc;
3163 cfgSymmPC->gemmSplitFWm = config.gemmSplitFWm;
3164 cfgSymmPC->gemmSplitBW = config.gemmSplitBW;
3171 cfgSymmPC->
numChunks = config.numChunksSym;
3177 *cfgAsymmPC=*cfgSymmPC;
3182 cfgAsymmPC->
numChunks = config.numChunksAsym;
3190 cfgSymmPC->
gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptNewPsi ((CkReductionMsg*)NULL);
3191 cfgSymmPC->
PsiVEP = CkIndex_CP_State_GSpacePlane::acceptNewPsiV((CkReductionMsg*)NULL);
3201 cfgAsymmPC->
gSpaceEP = CkIndex_CP_State_GSpacePlane::acceptLambda ((CkReductionMsg*)NULL);
3210 #ifdef _CP_SUBSTEP_TIMING_
3212 cfgSymmPC->forwardTimerID = keeperRegister(
"Sym Forward");
3213 cfgSymmPC->backwardTimerID = keeperRegister(
"Sym Backward");
3214 cfgSymmPC->beginTimerCB = CkCallback(CkIndex_TimeKeeper::collectStart(NULL),0,TimeKeeperProxy);
3215 cfgSymmPC->endTimerCB = CkCallback(CkIndex_TimeKeeper::collectEnd(NULL),0,TimeKeeperProxy);
3217 cfgAsymmPC->forwardTimerID = keeperRegister(
"Asym Forward");
3218 cfgAsymmPC->backwardTimerID = keeperRegister(
"Asym Backward");
3219 cfgAsymmPC->beginTimerCB = CkCallback(CkIndex_TimeKeeper::collectStart(NULL),0,TimeKeeperProxy);
3220 cfgAsymmPC->endTimerCB = CkCallback(CkIndex_TimeKeeper::collectEnd(NULL),0,TimeKeeperProxy);
3231 orthoCfg->
isDynamics = (sim->cp_min_opt==1)?
false:
true;
3232 orthoCfg->
isGenWave = (sim->gen_wave==1)?
true:
false;
3234 orthoCfg->
grainSize = config.orthoGrainSize;
3235 orthoCfg->instanceIndex = thisInstance.getPO();
3237 orthoCfg->
uponToleranceFailure = CkCallback(CkIndex_GSpaceDriver::needUpdatedPsiV(), UgSpaceDriverProxy[thisInstance.getPO()]);
3240 cfgSymmPC->
gSpaceAID = UgSpacePlaneProxy[thisInstance.getPO()].ckGetArrayID();
3241 cfgAsymmPC->
gSpaceAID = UgSpacePlaneProxy[thisInstance.getPO()].ckGetArrayID();
3245 cfgSymmPC->
uponSetupCompletion = CkCallback(CkIndex_InstanceController::doneInit(NULL),CkArrayIndex1D(thisInstance.getPO()),instControllerProxy.ckGetArrayID());
3246 cfgAsymmPC->
uponSetupCompletion = CkCallback(CkIndex_InstanceController::doneInit(NULL),CkArrayIndex1D(thisInstance.getPO()),instControllerProxy.ckGetArrayID());
3249 CkCallback pcHandleCB(CkIndex_CP_State_GSpacePlane::acceptPairCalcAIDs(0), UgSpacePlaneProxy[thisInstance.getPO()]);
3254 &GSImaptable[thisInstance.getPO()],
3255 (config.torusMap == 1),
3256 (config.fakeTorus == 1),
3257 mapOffsets[numInst]);
3261 pcCreator.
build(pcHandleCB, pcMapCfg);
3265 #include "CPcharmParaInfo.def.h"
3266 #include "timeKeeper.def.h"
3267 #include "startupMessages.def.h"
3268 #include "cp_state_ctrl/CP_State_GSpacePlane.h"
3269 #include "cpaimd.def.h"
bool isSymmetric
Is this a symmetric or asymmetric paircalc instance.
void make_rho_runs(CPcharmParaInfo *sim)
== rho space run descriptors for spherical cutoff fft support
int grainSize
The block size for parallelization.
~main()
Cleanup stuff in the hopes of getting clean valgrind.
holds the UberIndex and the offset for proxies
const char OpenAtomRevision[]
A global constant for use in the code.
int gSpaceEP
The entry point to which this instance should send results to.
int inputMsgPriority
The priority (set by GSpace) of the input messages.
int numPlanes
The total number of planes in the system.
Accepts reduction of forces from AtomsCache, integrates forces to produce new coordinates, distributes new coordinates to AtomsCache.
void paircalcstartup(pc::pcConfig *cfgSymmPC, pc::pcConfig *cfgAsymmPC, CPcharmParaInfo *sim, int doublePack)
stuff to be include before the decl or else
bool isDoublePackOn
Is double-packing on?
void setTraceUserEvents()
void init_commlib_strategies(int numRhoG, int numReal, int numRhoRhart, UberCollection thisInstance)
Initialize Commlib communication strategies.
int numStates
The number of states in the simulation (the dimension of the input square matrix) ...
bool isBWbarriered
Should we impose a hard barrier in the BW path to sync all PC chares?
CkArrayID gSpaceAID
The array ID of the GSpace chare array this instance talks to.
collection point for global scope map, proxy, and Uber read-only variables
double maxTolerance
The tolerance threshold for the S->T iterations in Ortho at which to trigger a PsiV update...
void init_eesNL_chares(int natm_nl, int natm_nl_grp_max, int doublePack, PeList *exclusion, CPcharmParaInfo *sim, UberCollection thisInstance)
/addtogroup Particle
bool isInputMulticast
Will the input data be multicast to PC sections or sent directly (p2p)
Author: Abhinav S Bhatele Date Created: December 28th, 2006.
int inputSpanningTreeFactor
The branching factor of the spanning trees that carry the input msgs.
A container for assorted mapping inputs to pass around easily.
Configuration settings for the ortho world.
CkCallback uponSetupCompletion
Callback to trigger at the end of a paircalc array's init.
void init_PIBeads(CPcharmParaInfo *sim, UberCollection thisInstance)
Create the PIBeadAtoms array.
CkGroupID mCastGrpId
Multicast manager group that handles many mcast/redns in the code. Grep for info. ...
int gemmSplitFWk
{ BGL's painful NIC forces us to split long computations.
A place to collect substep times.
int numStates
The total number of states in the system.
Add type declarations for simulationConstants class (readonly vars) and once class for each type of o...
void init_state_chares(int natm_nl, int natm_nl_grp_max, int numSfGrps, int doublePack, CPcharmParaInfo *sim, UberCollection thisInstance)
Create the array elements for the GSpace, Particle and Real Space planes ////////////////////////////...
bool isDynamics
Is this a minimization or dynamics run.
int conserveMemory
The mem footprint vs performance setting for the paircalcs (tribool)
Hacky solution to passing a PeList to GSpace(0,0) for use in paircalc mapping without actually having...
bool fakeTorus
readonly defined in cpaimd.C
#define IntegrateModForces_
200-300 reserved for paircalculator
int grainSize
The grain size along the states dimensions (plural) (number of states per PC chare) ...
bool isDynamics
Is this a minimization or dynamics run.
int PsiVEP
The entry point to which this instance should send PsiV tolerance update results to.
int instanceIndex
The proxyOffset value of thisInstance of OpenAtom computations.
bool isOutputReduced
Should the results from each PC chare be reduced or delivered individually to GSpace?
int numChunks
The number of chunks (4th dimension of decomposition)
bool useComplexMath
Should the actual matrix multiplies be handled as real math or complex math.
Some basic data structures and the array map classes are defined here.
void build(CkCallback cb, const PCMapConfig &mapCfg)
CkCallback uponToleranceFailure
Callback to notify bubble owner (GSpace) that a tolerance update is needed.
bool isLBon
Should the paircalcs worry about load balancing.
bool shouldDelayBWsend
Should we tweak msg priority to delay msgs to GSpace carrying the results?
Dumb structure that holds all the configuration inputs required for paircalc instantiation, functioning and interaction.
bool isBWstreaming
Should this instance stream the result fragments in the BW path as they become ready?
int orthoGrainSize
The grain size along the states dimensions for Ortho chares.
bool findCuboid(int &x, int &y, int &z, int &order, int maxX, int maxY, int maxZ, int maxT, int volume, int vn)
return the cuboid x,y,z of a subpartition exactly matching that volume
bool arePhantomsOn
If this is a symmetric instance, should it use phantom chares to balance the BW path.
double Timer
readonly globals
void create_line_decomp_descriptor(CPcharmParaInfo *sim)
/////////////////////////////////////////////////////////////////////////cc
#define OPENATOM_REVISION
The build system should define this macro to be the commit identifier.
CkReductionMsg * sumFastDouble(int nMsg, CkReductionMsg **msgs)
sum together matrices of doubles possibly faster than sum_double due to minimizing copies and using s...
Manages the creation of a complete paircalc bubble that includes two paircalc instances (symmetric an...
void control_physics_to_driver(UberCollection thisInstance)
Get the atoms and the parainfo //////////////////////////////////////////////////////////////////////...
bool isGenWave
If, this is a minimization run, is it for generating the system wave functions?
int resultMsgPriority
If shouldDelayBWsend, what priority should this instance use for the result msgs. ...
int init_rho_chares(CPcharmParaInfo *sim, UberCollection thisInstance)
Creating arrays CP_Rho_GSpacePlane, CP_Rho_GSpacePlaneHelper and CP_Rho_RealSpacePlane.
Author: Eric J Bohm Date Created: May 31, 2006.
bool areBWTilesCollected
Should this instance collect result fragments and send them out together in the BW path...
void create_Rho_fft_numbers(int nchareR, int nchareRHart, int rhoRsubplanes, int nplane, int sizeY, int ngridbHart, int *numRXRho, int *numRYRho, int *numRXEext, int *numRYEext, int *numSubGx)