16 #include "ckmulticast.h"
17 #include "structure_factor/StructFactorCache.h"
18 #include "structure_factor/StructureFactor.h"
44 void init(
int _nzmat,
double *_zmat,
int _iterNL)
48 CmiMemcpy(zmat, _zmat,
sizeof(
double)* nZmat);
177 CP_State_RealSpacePlane_SDAG_CODE
180 ~CP_State_RealSpacePlane() {
if(cookie!=NULL)
delete [] cookie; };
185 void doProductThenFFT();
187 void setNumPlanesToExpect(
int num);
191 void ResumeFromSync();
196 int backwardTimeKeep;
198 int ibead_ind,kpoint_ind, itemper_ind;
212 CkSectionInfo *cookie;
213 CProxy_CP_State_GSpacePlane gproxy;
249 int recvCountFromGRho;
250 int recvCountFromGHartExt;
279 void isAtSync(
int iter){AtSync();};
280 void ResumeFromSync();
302 CProxySection_CP_State_RealSpacePlane *realSpaceSectionProxyA;
303 CProxySection_CP_State_RealSpacePlane *realSpaceSectionCProxyA;
304 CProxy_CP_Rho_GSpacePlane rhoGProxy_com;
305 CProxy_CP_Rho_GSpacePlane rhoGProxyIGX_com;
306 CProxy_CP_Rho_GSpacePlane rhoGProxyIGY_com;
307 CProxy_CP_Rho_GSpacePlane rhoGProxyIGZ_com;
309 CkReductionMsg *RedMsg;
330 void ResumeFromSync();
335 void pup(PUP::er &p);
336 void isAtSync(
int iter){AtSync();};
348 CProxySection_GSpaceDriver nlsectproxy;
350 int recvCountFromRRho;
354 int countWhiteByrd[4];
362 CProxy_CP_Rho_RealSpacePlane rhoRealProxy0_com;
363 CProxy_CP_Rho_RealSpacePlane rhoRealProxy1_com;
364 CProxy_CP_Rho_RealSpacePlane rhoRealProxy2_com;
365 CProxy_CP_Rho_RealSpacePlane rhoRealProxy3_com;
366 CProxy_CP_Rho_RealSpacePlane rhoRealProxyByrd_com;
383 int registrationFlag;
408 int recvCountFromGHartExt;
429 double *atmEwdSFRint;
431 double *atmEwdForcRint;
433 CProxy_CP_Rho_GHartExt rhoGHartProxy_com;
438 void pup(PUP::er &p);
480 void isAtSync(
int iter){AtSync();};
490 int registrationFlag;
510 int recvCountFromRHartExt;
524 CProxy_CP_Rho_RealSpacePlane rhoRealProxy_com;
525 CProxy_CP_Rho_RHartExt rhoRHartProxy_com0;
526 CProxy_CP_Rho_RHartExt rhoRHartProxy_com1;
527 int **index_pack_tran;
548 int ibead_ind,kpoint_ind, itemper_ind;
566 int reductionPlaneNum;
569 int registrationFlag;
573 bool planeRedSectionComplete;
574 bool enlSectionComplete;
588 CProxySection_CP_State_RealParticlePlane rPlaneSectProxy;
589 CProxySection_CP_State_RealParticlePlane rPlaneENLProxy;
590 CkSectionInfo rPlaneRedCookie;
591 CkSectionInfo rEnlCookie;
592 CProxy_CP_State_ParticlePlane gPP_proxy;
593 #ifdef _CP_GS_DEBUG_COMPARE_VKS_
596 double *savedProjpsiRScr;
696 #endif // #ifndef _PLANE_H_
void acceptAtmSFTot(int size, complex *inAtm)
Collect the SF from all the atm type chares on chare 0 //////////////////////////////////////////////...
void recvZMatEes(CkReductionMsg *)
Reduction client of zmat : Here everyone must have the same iteration ///////////////////////////////...
void acceptRhoGradVksGxToRx(RhoGSFFTMsg *msg)
Double Transpose Bck Recv : A(gx,y,z) on the way to A(x,y,z) Recv (gx,z) parallel -> (y...
void getHartEextEes()
compute HartreeEextEes
void acceptDensity(CkReductionMsg *)
Data comes from StateRspacePlane once an algorithm step.
void sendPartlyFFTtoRhoG(int)
The Tranpose to G-space : A(gx,gy,z) on the way to A(gx,gy,gz) Change parallel by gx...
void planeRedSectDone(CkReductionMsg *m)
All cookies initialized for zmat plane reduction ////////////////////////////////////////////////////...
holds the UberIndex and the offset for proxies
void startEextIter()
Invoke by Rspace-density : Density has arrived in r-space and will soon arrive in g-space...
void printEnlR(CkReductionMsg *m)
Energy reduction client for ees method! /////////////////////////////////////////////////////////////...
int calcReductionPlaneNum(int)
spread the reduction plane numbers around to minimize map collisions
void sendAtmSfRyToGy()
Double Transpose Fwd Send : A(gx,y,z) on the way to A(gx,gy,z) Send so that (y,z) parallelism is swit...
void addHartEextVks()
Add the VksHartEext to VksTot : Set the done flag.
void init()
post constructor initialization
void computeAtmForcEes(CompAtmForcMsg *msg)
Use Zmat and ProjPsi to get atmForces, Energy and psiforces /////////////////////////////////////////...
void exitForDebugging()
Glenn's Rhart exit.
void divRhoVksGspace()
invoke fft subroutine : doFwFFT() unpack do an FFT 1D along z rho(gx,gy,gz) parallelized in full z-li...
void init()
Post construction initialization.
void addWhiteByrdVks()
Add the VksWhiteByrd to VksTot : Set the done flag.
void registrationDone(CkReductionMsg *msg)
= Make sure everyone is registered on the 1st time step
void acceptLSPRhoG()
Data comes from LSP_RhoG once an algorithm step.
void FFTNLEesBckR()
Do the FFT of projPsi(x,y,z) to get projPsi(gx,gy,z) ////////////////////////////////////////////////...
void exitForDebugging()
Glenn's RhoReal exit.
void sendToEesGPP()
Send the PsiForce NL FFT back to GparticlePlane.
void initComplete()
Initialization and registration done for this chare /////////////////////////////////////////////////...
The Large Sparse RhoR is where we interpolate dense RhoR onto the large grid for QMMM.
void computeAtmForc(int)
Get forces on atoms from Ewald or electrons /////////////////////////////////////////////////////////...
void whiteByrdFFT()
The white-bird term : First fwfft redefined delrho(r) to delrho(g) then send to RhoGspacePlane.
void printEnlRSimp(double, int, int)
Energy reduction client for ees method! /////////////////////////////////////////////////////////////...
~CP_State_RealParticlePlane()
The destructor : never called directly but I guess migration needs it ///////////////////////////////...
void doMulticastCheck()
If all the parts of exc-eext-hart are done, invoke blast of vks to states.
void acceptWhiteByrd(RhoRSFFTMsg *msg)
The white bird vks correction is returned from RhoG : VksW(gx,gy,z) This routine recvs the transpose ...
void recvAtmSFFromRhoRHart(RhoGHartMsg *msg)
Recv Atm SF from RhoRhart : Euler Exponential spline based method ///////////////////////////////////...
void FFTEesFwd(int)
Statr FFting to R-space atmSF(gx,gy,gz) -> atmSF(gx,gy,z) ///////////////////////////////////////////...
void init(ProductMsg *)
Setting up the multicast trees for Gengbin's library.
void setPlaneRedCookie(EnlCookieMsg *)
Recv a dummy message, 1 integer, and set the cookie monster /////////////////////////////////////////...
void launchEextRNlG()
The density is here : Launch ees NL and ees Ext routines.
void fftRhoRyToGy(int iopt)
Double Transpose Fwd FFT : A(gx,y,z) -> A(gx,gy,z)
void GradCorr()
The gradient of the density is now completed.
void FFTNLEesFwdR()
Complete the Forward FFT of psi-projector sent from g-space chares //////////////////////////////////...
void fftAtmSfRtoG()
FFT of SF(x,y,z,iatmTyp) -> SF(gx,gy,z,iatmTyp)
void acceptVks(int size, complex *inVks)
Collect the VKS from all the atm type chares on chare 1 /////////////////////////////////////////////...
void recvFromEesGPP(NLFFTMsg *)
Recv FFT data/psi-projector from CP_StateParticlePlane kicking things off for this Chare...
The Large Sparse RhoG is where we interface with NAMD in QMMM for the large grid. ...
void acceptWhiteByrdAll(RhoGSFFTMsg *msg)
RhoReal sends rho(gx,gy,z) here such that it is now decomposed with lines of constant gx...
void doMulticast()
Send vks back to the states /////////////////////////////////////////////////////////////////////////...
void enlSectDone(CkReductionMsg *m)
All cookies initialized for enl section, only reduction root receives this //////////////////////////...
void pup(PUP::er &)
Pup my variables for migration.
void acceptHartVks(RhoHartRSFFTMsg *)
Accept hartExt transpose data : receive VksHartEext(gx,gy,z) gx,z is parallel.
void doReduction()
No one else can use tmpdataR until I perform doReduction because I will not be rolled out until I fin...
void acceptGradRhoVks(RhoRSFFTMsg *)
Accept transpose data from RhoG : receive grad_rho(gy,gx,z)
void launchNLRealFFT()
Launch ees-nonlocal real here.
void sendAtmSF(int)
Send the SF data to back to Rhart to get atm forces /////////////////////////////////////////////////...
void sendAtmSfRhoGHart()
Send SF(gx,gy,z,iatmTYP) to g-space whence the FFT will be completed.
void FFTVks()
Partly fft vks(gx,gy,gz) -> vks(gx,gy,z)
void acceptData(RhoGHartMsg *msg)
The density arrives from RhoGspace ONCE a time step /////////////////////////////////////////////////...
void computeAtmSF()
Start the real space part of the EES interpolation for atmSF(iatmTyp) ///////////////////////////////...
void acceptLSPRhoR()
Data comes from LargeSP_RhoReal once an algorithm step.
void handleDensityReduction()
Handle the memory cleanup and setting of flags when density has all arrived.
void init()
post constructor initialization
void sendPartlyFFTGxToRx(int)
Double Transpose Bck Send : A(gx,y,z) on the way to A(x,y,z) Send so (gx,z) parallel -> (y...
void recvZMatEesSimp(int, double *, int, int, int)
A chare can be behind by 1 iteration only.
void energyComputation()
Compute one part of the EXC energy using PINY CP_exc_calc.
~CP_Rho_GHartExt()
Destructor /////////////////////////////////////////////////////////////////////////// //////////////...
void init()
Post constructor initialization /////////////////////////////////////////////////////////////////////...
void acceptRhoGradVksRyToGy(RhoGSFFTMsg *msg)
Double Transpose Fwd Recv : A(gx,y,z) on the way to A(gx,gy,z) Recv so that (y,z) parallel switched t...
void doFFT()
After receiving from G-space, FFT to real space /////////////////////////////////////////////////////...
void getSplitDecomp(int *, int *, int *, int, int, int)
Initialization Function /////////////////////////////////////////////////////////////////////////// /...
void fftAtmForcGtoR(int flagEwd)
Complete the FFT : sf(gx,gy,z) ->sf(x,y,z) //////////////////////////////////////////////////////////...
void launchNlG()
The density is here : Launch ees NL.
void launchFFTControl(int)
Control launch of FFT based on Rho having more of its act together //////////////////////////////////...
void registrationDone()
= Make sure everyone is registered on the 1st time step
void acceptRhoData(RhoGSFFTMsg *msg)
RhoReal sends rho(gx,gy,z) here such that it is now decomposed with lines of constant gx...
void fftRhoRtoRhoG()
1) Perform FFT of density: Single Transpose method rho(x,y,z) —> rho(gx,gy,z) Double Transpose method...
void sendVks()
Send vks_hart_ext back to rho_real where fft(gx,gy) will be performed ///////////////////////////////...
void recvAtmForcGxToRx(RhoGHartMsg *msg)
void acceptGradRhoVksAll(RhoRSFFTMsg *msg)
Accept transpose data from RhoG : receive grad_rho(gy,gx,z)
void sendPartlyFFTRyToGy(int iopt)
Double Transpose Fwd Send : A(gx,y,z) on the way to A(gx,gy,z) Send so that (y,z) parallelism is swit...
void FFTEesBck()
Finish FFting to G-space :: 2D) atmSF(gx,gy,z) -> atmSF(gx,gy,gz)
void acceptRhoR()
Data comes from Rho_Real once an algorithm step.
void registrationDone(CkReductionMsg *msg)
= Make sure everyone is registered on the 1st time step
void acceptMDSg()
Data comes from MD once an algorithm step.
void pup(PUP::er &)
Pup my variables for migration.
void sendPartlyFFTtoRhoGall()
void HartExtVksG()
Compute hartree eext and vks using the N^2 method ///////////////////////////////////////////////////...
void doRhoFFT()
Complete the FFT to give use Rho(gx,gy,gz) //////////////////////////////////////////////////////////...
void setEnlCookie(EnlCookieMsg *)
Recv a dummy message, 1 integer, and set the cookie monster /////////////////////////////////////////...
void computeZmatEes()
Compute the Zmat elements of this iteration : Spawn the section reduction ///////////////////////////...
void recvAtmSfRyToGy(RhoGHartMsg *msg)
Double Transpose Fwd Recv : A(gx,y,z) on the way to A(gx,gy,z) Recv so that (y,z) parallel switched t...
void unpackProduct(ProductMsg *)
In this method, we receive vks from the density.
void unpackFFT(RSFFTMsg *)
void recvAtmForcFromRhoGHart(RhoRHartMsg *msg)
Hartree sends back atom forces from e-atm interation Depending on the flag, it is Ewald or e-atm inte...
void exitForDebugging()
Glenn's special exit.
void init()
post constructor initialization /////////////////////////////////////////////////////////////////////...
void RHartReport()
Under ees-eext Rhart chare reports its completion : Set the done flag.
CP_State_RealSpacePlane_SDAG_CODE CP_State_RealSpacePlane(int, int, int, int, int, int, int, UberCollection)
void exitForDebugging()
Glenn's RhoReal exit.
void sendAtmForcGxToRx(int iopt)
void init()
post constructor initialization
void pup(PUP::er &)
Pup my variables for migration.