6 #ifdef _CP_DEBUG_PSI_OFF_
7 #define _SDAG_DEBUG_PSI_OFF_ true
9 #define _SDAG_DEBUG_PSI_OFF_ false
12 #ifdef _CP_DEBUG_SFNL_OFF_
13 #define _SDAG_DEBUG_SFNL_OFF_ true
15 #define _SDAG_DEBUG_SFNL_OFF_ false
18 #ifdef _CP_DEBUG_VKS_OFF_
19 #define _SDAG_DEBUG_VKS_OFF_ true
21 #define _SDAG_DEBUG_VKS_OFF_ false
24 #ifdef _CP_DEBUG_ORTHO_OFF_
25 #define _SDAG_DEBUG_ORTHO_OFF_ true
27 #define _SDAG_DEBUG_ORTHO_OFF_ false
32 include
"uber/Uber.h";
39 entry
void startControl();
42 entry
void needUpdatedPsiV();
43 entry
void startNonLocalEes(
int iteration_loc);
46 entry
void doneComputingEnergy(
const int AtomGrpIter);
47 entry
void doneMovingAtoms(
const int AtomGrpIter);
48 entry
void donePsiFandVKS();
49 entry
void doneLambdaAndCg();
50 entry
void doneRedPsi();
51 entry
void doneNewPsi();
52 entry
void donePsiV();
53 entry
void doneOutput();
54 entry
void doneNLForces();
57 entry [nokeep]
void allDoneNLForces(CkReductionMsg *msg) { serial { doneNLForces(); } };
63 while(myGSpaceObj->iteration < config.maxIter && !myGSpaceObj->exitFlag && !myGSpaceObj->exitFlagMin) {
64 if ((cp_min_opt==1 && gen_wave==0) || isFirstStep==
false) {
66 serial { myGSpaceObj->thisProxy(thisIndex.x,thisIndex.y).startNewIter(); }
68 if (!_SDAG_DEBUG_PSI_OFF_) {
70 if (!_SDAG_DEBUG_SFNL_OFF_ && ees_nonlocal==0 && natm_nl!=0) serial {
76 if (!_SDAG_DEBUG_VKS_OFF_) serial {
77 myGSpaceObj->computePsiFandVKS();
78 }
else if (!_SDAG_DEBUG_SFNL_OFF_ && ees_nonlocal==1 && natm_nl!=0) serial {
79 startNonLocalEes(myGSpaceObj->iteration);
84 if (!_SDAG_DEBUG_SFNL_OFF_) {
85 when doneNLForces() {}
87 if (!_SDAG_DEBUG_VKS_OFF_) {
88 when donePsiFandVKS() {}
92 serial { myGSpaceObj->combineForcesGetEke(); }
95 serial { myGSpaceObj->launchAtoms(); }
97 if (!_SDAG_DEBUG_PSI_OFF_) {
98 serial { myGSpaceObj->computeLambdaAndCg(); }
99 when doneLambdaAndCg() {}
104 if (config.stateOutput==1 && cp_min_opt==0 && myGSpaceObj->iteration > 1 &&
105 (myGSpaceObj->iteration % ndump_frq==1 || myGSpaceObj->iteration==config.maxIter || myGSpaceObj->exitFlag==1)) {
106 serial { myGSpaceObj->doOutput(); }
110 serial { myGSpaceObj->computeRedPsi(); }
115 if (!_SDAG_DEBUG_PSI_OFF_) {
116 serial { myGSpaceObj->computeNewPsi(); }
121 if (config.stateOutput==1 && cp_min_opt==1 && myGSpaceObj->iteration > 0 &&
122 (myGSpaceObj->iteration % ndump_frq==0 || myGSpaceObj->iteration==config.maxIter || myGSpaceObj->exitFlag==1)) {
123 serial { myGSpaceObj->doOutput(); }
127 if (isPsiVupdateNeeded && cp_min_opt==1 && myGSpaceObj->iteration > 1) {
128 serial { myGSpaceObj->computeNewPsiV(); }
129 when donePsiV() serial { isPsiVupdateNeeded =
false; }
136 if (!_SDAG_DEBUG_PSI_OFF_) {
137 when doneComputingEnergy(
const int AtomGrpIter) {}
139 when doneMovingAtoms(
const int AtomsGrpIter) {}
144 myGSpaceObj->screenPrintWallTimes();
150 #ifdef _CP_SUBSTEP_TIMING_
153 (TimeKeeperProxy.ckLocalBranch())->printHPM();
158 CkCallback cb(CkIndex_InstanceController::cleanExit(NULL),
159 CkArrayIndex1D(thisInstance.proxyOffset),
160 instControllerProxy);
169 module gParticlePlane
183 entry
CP_State_ParticlePlane(
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int ,
int,
UberCollection);
184 entry
void launchComputeZs();
186 entry
void reduceZ(
int size,
int atmIndex,
complex zmatrix[size],
complex zmatrix_fx[size],
complex zmatrix_fy[size],
complex zmatrix_fz[size]);
187 entry
void getForces(
int zsize,
int atmIndex,
complex zmat[zsize]);
188 entry
void lPrioStartNLEes(NLDummyMsg *m);
189 entry [nokeep]
void setEnlCookie(EnlCookieMsg *m);
191 entry
void registrationDone(CkReductionMsg *msg);
192 entry
void printEnl(CkReductionMsg *msg);
199 entry
void recvFromEesGPP(
NLFFTMsg *);
200 entry
void recvZMatEes(CkReductionMsg *);
203 entry [nokeep]
void setPlaneRedCookie(EnlCookieMsg *);
204 entry [nokeep]
void setEnlCookie(EnlCookieMsg *);
205 entry
void registrationDone();
206 entry
void printEnlR(CkReductionMsg *);
207 entry
void printEnlRSimp(
double ,
int,
int);
208 entry
void recvZMatEesSimp(
int size,
double _zmat[size],
int state,
209 int index,
int iterNL_in);
210 entry [local]
void FFTNLEesFwdR();
211 entry
void launchFFTControl(
int );
212 entry
void enlSectDone(CkReductionMsg *m);
213 entry
void planeRedSectDone(CkReductionMsg *m);
220 extern module pcMessages;
221 extern module instanceController;
222 extern module RDMAMessages;
242 include
"paircalc/pcFwdDeclarations.h";
243 include
"load_balance/PeList.h";
250 for (count = 0; count < nchareG; count++) {
252 when acceptFFT(
RSFFTMsg *m) serial { unpackFFT(m); }
261 for (countProduct = 0; countProduct < rhoRsubplanes; ++countProduct) {
263 when acceptProduct(
ProductMsg *m) serial { unpackProduct(m); }
269 contribute(CkCallback(CkIndex_CP_State_RealSpacePlane::rdoneVks(NULL),
270 UrealSpacePlaneProxy[thisInstance.proxyOffset]));
272 when rdoneVks(CkReductionMsg *m) serial {
delete m; }
277 thisProxy[thisIndex].doVksFFT();
284 entry [nokeep]
void acceptFFT(
RSFFTMsg *m);
285 entry [nokeep]
void acceptProduct(
ProductMsg *m);
286 entry [local]
void doFFT();
287 entry [local]
void doVksFFT();
288 entry
void setNumPlanesToExpect(
int num);
289 entry
void printData();
293 entry
void rdoneVks(CkReductionMsg *m);
300 entry
void acceptPairCalcAIDs(
pcSetupMsg *msg);
301 entry
void initGSpace(
int m,
complex pts[m],
int mv,
complex vpts[mv],
int nx,
int ny,
int nz,
int ngridaNL,
int ngridbNL,
int ngridcNL,
int istart_cp);
303 entry
void completeRDMAhandshake(RDMASetupConfirmationMsg<RDMApair_GSP_PC> *msg);
304 entry [nokeep]
void acceptFileOutput(
GStateOutMsg *msg);
306 entry
void acceptLambda(CkReductionMsg *msg);
308 entry
void acceptNewPsi(CkReductionMsg *msg);
311 entry
void acceptNewPsiV(CkReductionMsg *msg);
315 entry
void makePCproxies();
316 entry [local]
void startNewIter();
318 entry
void computeEnergies(
int p,
double d);
319 entry
void acceptCgOverlap(CkReductionMsg *msg);
320 entry
void acceptNewTemperature(
double temp);
321 entry
void readFile();
322 entry [nokeep]
void initBeadCookie(
ICCookieMsg *msg);
323 entry [nokeep]
void minimizeSync(
ICCookieMsg *msg);
324 entry
void setExitFlag();
327 #ifdef BARRIER_CP_GSPACE_IFFT
328 entry [nokeep]
void allDoneIFFT(CkReductionMsg *msg);
330 #ifdef BARRIER_CP_GSPACE_PSI
331 entry [nokeep]
void allDonePsi(CkReductionMsg *msg);
333 #ifdef BARRIER_CP_GSPACE_PSIV
334 entry [nokeep]
void allDonePsiV(CkReductionMsg *msg);
338 entry
void computePsiFandVKS() {
346 while (countIFFT != gs.planeSize[1]) {
347 when acceptIFFT(
GSIFFTMsg *msg) serial { unpackIFFT(msg); }
354 #ifdef BARRIER_CP_GSPACE_IFFT
355 when allDoneIFFT(CkReductionMsg* msg) {}
358 UgSpaceDriverProxy[thisInstance.proxyOffset](thisIndex.x,thisIndex.y).donePsiFandVKS();
362 entry
void computeLambdaAndCg() {
368 if (!_SDAG_DEBUG_ORTHO_OFF_) {
369 while (countLambda != AllLambdaExpected) {
371 when acceptLambda(CkReductionMsg *msg) serial { unpackLambda(msg); }
375 serial { doLambda(); }
377 serial { computeCgOverlap(); }
378 when acceptCgOverlap(CkReductionMsg *msg) serial {
380 UgSpaceDriverProxy[thisInstance.proxyOffset](thisIndex.x,thisIndex.y).doneLambdaAndCg();
384 entry
void computeRedPsi() {
391 while (iRecvRedPsi == 0) {
392 when acceptRedPsi(
GSRedPsiMsg *msg) serial { unpackRedPsi(msg); }
395 doneRedPsiIntegrate();
396 UgSpaceDriverProxy[thisInstance.proxyOffset](thisIndex.x,thisIndex.y).doneRedPsi();
400 entry
void computeNewPsi() {
401 serial { sendPsi(); }
402 if (!_SDAG_DEBUG_ORTHO_OFF_) {
403 while (countPsi != AllPsiExpected) {
405 when acceptNewPsi(CkReductionMsg *msg) serial { unpackNewPsi(msg); }
409 serial { doNewPsi(); }
410 #ifdef BARRIER_CP_GSPACE_PSI
411 when allDonePsi(CkReductionMsg *msg) {}
413 serial { UgSpaceDriverProxy[thisInstance.proxyOffset](thisIndex.x, thisIndex.y).doneNewPsi(); }
417 entry
void computeNewPsiV() {
419 acceptedVPsi =
false;
422 while (iRecvRedPsiV == 0) {
423 when acceptRedPsiV(
GSRedPsiMsg *msg) serial { unpackRedPsiV(msg); }
426 doneRedPsiIntegrate();
429 while (countVPsi != AllPsiExpected) {
431 when acceptNewPsiV(CkReductionMsg *msg) serial { unpackNewPsiV(msg); }
435 serial { doNewPsiV(); }
436 #ifdef BARRIER_CP_GSPACE_PSIV
437 when allDonePsiV(CkReductionMsg *msg) {}
439 serial { UgSpaceDriverProxy[thisInstance.proxyOffset](thisIndex.x, thisIndex.y).donePsiV(); }
442 entry
void doOutput() {
444 serial { contributeFileOutput(); }
447 if (thisIndex.y == redPlane) {
448 while (countFileOut < nchareG) {
449 when acceptFileOutput(
GStateOutMsg* msg) serial { unpackFileOutput(msg); }
451 serial { writeOutputFile(); }
456 contribute(CkCallback(CkIndex_GSpaceDriver::doneOutput(), UgSpaceDriverProxy[thisInstance.proxyOffset]));
holds the UberIndex and the offset for proxies
2D chare array [nchareG][nstates] Handles flow of control within an instance, always same dimensional...
entry void driveGSpace()
SDAG method for flow control of the Driver and its associated GSpace object.
2D chare array [nchareG][nstates] Handles the electronic structure in Fourier space (referred to as G...
paircalc::CreationManager returns relevant chare array handles via this msg
A request from a data sender to setup an RDMA link. Initiates the sender-receiver handshake required ...
A (hopefully) tiny token that is unique to every data sender-receiver pair, and is shared by them dur...
Reply from data receiver to the data sender indicating completion of setup on the receiver side...