OpenAtom  Version1.5a
GSpaceState

The electronic structure is loaded in Fourier space (referred to as GSpace), tranformed to RealSpaceState and updated each step. More...

Namespaces

 cp
 Class for paircalc config data.
 

Classes

class  RDMASetupConfirmationMsg< tokenType >
 Reply from data receiver to the data sender indicating completion of setup on the receiver side. More...
 
class  GSIFFTMsg
 
class  GSRedPsiMsg
 
class  GStateOutMsg
 
class  RSFFTMsg
 
class  CP_State_GSpacePlane
 2D chare array [nchareG][nstates] Handles the electronic structure in Fourier space (referred to as GSpace). More...
 
class  GSpaceDriver
 2D chare array [nchareG][nstates] Handles flow of control within an instance, always same dimensional cardinality and mapping as CP_Gspace_State_Plane More...
 

Macros

#define _SDAG_DEBUG_PSI_OFF_   false
 
#define _SDAG_DEBUG_SFNL_OFF_   false
 
#define _SDAG_DEBUG_VKS_OFF_   false
 
#define _SDAG_DEBUG_ORTHO_OFF_   false
 

Functions

void printForce (void *param, void *msg)
 
void testeke (int ncoef, complex *psi_g, int *k_x, int *k_y, int *k_z, int iflag, int index)
 Test does ReadFile() parse psi(g) and g-vectors properly. More...
 
entry void startControl ()
 
entry void needUpdatedPsiV ()
 
entry void startNonLocalEes (int iteration_loc)
 
entry void doneComputingEnergy (const int AtomGrpIter)
 
entry void doneMovingAtoms (const int AtomGrpIter)
 
entry void donePsiFandVKS ()
 
entry void doneLambdaAndCg ()
 
entry void doneRedPsi ()
 
entry void doneNewPsi ()
 
entry void donePsiV ()
 
entry void doneOutput ()
 
entry void doneNLForces ()
 
entry[nokeep] void allDoneNLForces (CkReductionMsg *msg)
 
entry void driveGSpace ()
 SDAG method for flow control of the Driver and its associated GSpace object. More...
 
entry void launchComputeZs ()
 
entry void computeZ (PPDummyMsg *dmsg)
 
entry void reduceZ (int size, int atmIndex, complex zmatrix[size], complex zmatrix_fx[size], complex zmatrix_fy[size], complex zmatrix_fz[size])
 
entry void getForces (int zsize, int atmIndex, complex zmat[zsize])
 
entry void lPrioStartNLEes (NLDummyMsg *m)
 
entry[nokeep] void setEnlCookie (EnlCookieMsg *m)
 
entry void recvFromEesRPP (GSPPIFFTMsg *m)
 
entry void registrationDone (CkReductionMsg *msg)
 
entry void printEnl (CkReductionMsg *msg)
 
entry void init ()
 
entry void recvFromEesGPP (NLFFTMsg *)
 
entry void recvZMatEes (CkReductionMsg *)
 
entry[nokeep] void computeAtmForcEes (CompAtmForcMsg *msg)
 
entry[nokeep] void setPlaneRedCookie (EnlCookieMsg *)
 
entry void registrationDone ()
 
entry void printEnlR (CkReductionMsg *)
 
entry void printEnlRSimp (double, int, int)
 
entry void recvZMatEesSimp (int size, double _zmat[size], int state, int index, int iterNL_in)
 
entry[local] void FFTNLEesFwdR ()
 
entry void launchFFTControl (int)
 
entry void enlSectDone (CkReductionMsg *m)
 
entry void planeRedSectDone (CkReductionMsg *m)
 
entry void run ()
 
entry[nokeep] void acceptFFT (RSFFTMsg *m)
 
entry[nokeep] void acceptProduct (ProductMsg *m)
 
entry[local] void doFFT ()
 
entry[local] void doVksFFT ()
 
entry void setNumPlanesToExpect (int num)
 
entry void printData ()
 
entry[nokeep] void init (ProductMsg *m)
 
entry void acceptPairCalcAIDs (pcSetupMsg *msg)
 
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)
 
entry void acceptIFFT (GSIFFTMsg *msg)
 
entry void completeRDMAhandshake (RDMASetupConfirmationMsg< RDMApair_GSP_PC > *msg)
 
entry[nokeep] void acceptFileOutput (GStateOutMsg *msg)
 
entry void acceptLambda (CkReductionMsg *msg)
 
entry void acceptLambda (partialResultMsg *msg)
 
entry void acceptNewPsi (CkReductionMsg *msg)
 
entry void acceptNewPsi (partialResultMsg *msg)
 
entry void acceptRedPsi (GSRedPsiMsg *msg)
 
entry void acceptNewPsiV (CkReductionMsg *msg)
 
entry void acceptNewPsiV (partialResultMsg *msg)
 
entry void acceptRedPsiV (GSRedPsiMsg *msg)
 
entry void makePCproxies ()
 
entry[local] void startNewIter ()
 
entry void computeEnergies (int p, double d)
 
entry void acceptCgOverlap (CkReductionMsg *msg)
 
entry void acceptNewTemperature (double temp)
 
entry void readFile ()
 
entry[nokeep] void initBeadCookie (ICCookieMsg *msg)
 
entry[nokeep] void minimizeSync (ICCookieMsg *msg)
 
entry void setExitFlag ()
 
entry void computePsiFandVKS ()
 
entry void computeLambdaAndCg ()
 
entry void computeRedPsi ()
 
entry void computeNewPsi ()
 
entry void computeNewPsiV ()
 
entry void doOutput ()
 
void CP_State_GSpacePlane::psiCgOvlap (CkReductionMsg *msg)
 Entry method to resume execution after computing reduction over all planes and states to form psiCgOvlap (cg only) and magforPsi. More...
 
void CP_State_GSpacePlane::initBeadCookie (ICCookieMsg *m)
 
void CP_State_GSpacePlane::minimizeSync (ICCookieMsg *m)
 
void CP_State_GSpacePlane::setExitFlag ()
 
 CP_State_GSpacePlane::CP_State_GSpacePlane (int, int, int, int, int, int, UberCollection)
 Constructor for GSpacePlane. More...
 
 CP_State_GSpacePlane::CP_State_GSpacePlane (CkMigrateMessage *m)
 
void CP_State_GSpacePlane::pup (PUP::er &)
 
void CP_State_GSpacePlane::acceptPairCalcAIDs (pcSetupMsg *msg)
 
void CP_State_GSpacePlane::readFile ()
 In this function data is read from files, and sent to the corresponding G-space planes. More...
 
void CP_State_GSpacePlane::initGSpace (int, complex *, int, complex *, int, int, int, int, int, int, int)
 This method is used to accept the state data from some initializing routine. More...
 
void CP_State_GSpacePlane::acceptNewTemperature (double temp)
 
void CP_State_GSpacePlane::makePCproxies ()
 
void CP_State_GSpacePlane::startNewIter ()
 
void CP_State_GSpacePlane::screenPrintWallTimes ()
 
void CP_State_GSpacePlane::doFFT ()
 This method is used to start the forward ffts in the CP_State_GSpacePlanes. More...
 
void CP_State_GSpacePlane::sendFFTData ()
 Send result to realSpacePlane : perform the transpose Force data cannot be overwritten due to all to all nature of comm. More...
 
void CP_State_GSpacePlane::unpackIFFT (GSIFFTMsg *)
 Entry Method. This is used to receive data from all the corresponding RealSpacePlanes, upon which the inverse FFTs are triggered. More...
 
void CP_State_GSpacePlane::doIFFT ()
 
void CP_State_GSpacePlane::combineForcesGetEke ()
 
void CP_State_GSpacePlane::launchAtoms ()
 Atoms are launched by allDoneCpForces when all after ALL planes and states have reported. More...
 
void CP_State_GSpacePlane::sendLambda ()
 After my CP forces have arrived : sendLambda. More...
 
void CP_State_GSpacePlane::unpackLambda (CkReductionMsg *msg)
 
void CP_State_GSpacePlane::unpackLambda (partialResultMsg *msg)
 
void CP_State_GSpacePlane::doLambda ()
 When all the inputs have arrived, complete the lambda computation. More...
 
void CP_State_GSpacePlane::computeCgOverlap ()
 If minimization : compute lambda matrix (Lagrange multipliers) modify forces using the lambda matrix compute the |force|^2 = fovlap. More...
 
void CP_State_GSpacePlane::contributeFileOutput ()
 In this function data is written to files the simpliest way possible.
 
void CP_State_GSpacePlane::unpackFileOutput (GStateOutMsg *msg)
 
void CP_State_GSpacePlane::writeOutputFile ()
 
void CP_State_GSpacePlane::integrateModForce ()
 Integrate the forces. More...
 
void CP_State_GSpacePlane::sendRedPsi ()
 send red psi More...
 
void CP_State_GSpacePlane::unpackRedPsi (GSRedPsiMsg *msg)
 = More...
 
void CP_State_GSpacePlane::doneRedPsiIntegrate ()
 When all red psi have arrived, complete their integration.
 
void CP_State_GSpacePlane::sendPsi ()
 Send the psi out to symm PC. More...
 
void CP_State_GSpacePlane::unpackNewPsi (CkReductionMsg *msg)
 
void CP_State_GSpacePlane::unpackNewPsi (partialResultMsg *msg)
 Accept partial results when symm PC s sending to us directly. More...
 
void CP_State_GSpacePlane::doNewPsi ()
 All Psi have arrived, finish the new Psi process. More...
 
void CP_State_GSpacePlane::launchOrthoT ()
 = dynamics triggers send of orthoT to asymm calc when psi is done
 
void CP_State_GSpacePlane::sendRedPsiV ()
 
void CP_State_GSpacePlane::unpackRedPsiV (GSRedPsiMsg *msg)
 
void CP_State_GSpacePlane::doneRedPsiVIntegrate ()
 when all red psi velocities are in, integrate
 
void CP_State_GSpacePlane::sendPsiV ()
 send psi velocities More...
 
void CP_State_GSpacePlane::unpackNewPsiV (CkReductionMsg *msg)
 
void CP_State_GSpacePlane::unpackNewPsiV (partialResultMsg *msg)
 
void CP_State_GSpacePlane::doNewPsiV ()
 process all the PsiV data More...
 
void CP_State_GSpacePlane::screenOutputPsi (int)
 output a few select psi values for post processing validation More...
 
void CP_State_GSpacePlane::computeEnergies (int p, double d)
 Once All chares have completed energy computation and reduction, this storage routine is invoked. More...
 
void CP_State_GSpacePlane::completeRDMAhandshake (RDMASetupConfirmationMsg< RDMApair_GSP_PC > *msg)
 Gets called from the PairCalc data receivers to confirm the setup of an RDMA link. More...
 
 GSpaceDriver::GSpaceDriver (const UberCollection _thisInstance)
 Constructor. More...
 
 GSpaceDriver::GSpaceDriver (CkMigrateMessage *msg)
 
void GSpaceDriver::pup (PUP::er &p)
 PUP method.
 
void GSpaceDriver::init ()
 Initializer. More...
 
void GSpaceDriver::startControl ()
 Entry Method. Creates and invokes the SDAG that controls GSpace execution. More...
 
void GSpaceDriver::needUpdatedPsiV ()
 Entry Method. Ortho notifies us that GSpace needs a tolerance update (velocity rotation) More...
 
void GSpaceDriver::startNonLocalEes (int iteration_loc)
 Entry Method. Triggers nonlocal energy computations. More...
 
void GSpaceDriver::releaseSFComputeZ ()
 Triggers nonlocal energy computations. More...
 

Variables

module gSpaceDriver
 
array[2D] GSpaceDriver
 
module gParticlePlane
 
message NLDummyMsg
 
message EnlCookieMsg
 
message GSPPIFFTMsg {complex data[]
 
message NLFFTMsg {complex data[]
 
message CompAtmForcMsg {double zmat[]
 
array[2D] CP_State_ParticlePlane
 
array[2D] CP_State_RealParticlePlane
 
module gStatePlane
 
module instanceController
 
module RDMAMessages
 
message RDMASetupRequestMsg< RDMApair_GSP_PC >
 
message RDMASetupConfirmationMsg< RDMApair_GSP_PC >
 
message RSFFTMsg { complex data[]
 
message GSIFFTMsg { complex data[]
 
message GSRedPsiMsg { complex data[]
 
message ProductMsg {double data[]
 
message GStateOutMsg
 
complex vdata []
 
int k_x []
 
int k_y []
 
int k_z []
 
include paircalc pcFwdDeclarations h
 
array[2D] CP_State_RealSpacePlane
 
array[2D] CP_State_GSpacePlane
 

Detailed Description

The electronic structure is loaded in Fourier space (referred to as GSpace), tranformed to RealSpaceState and updated each step.

Data is arranged into approximately equal size chunks nchareg. The number of chunks is a free parameter selected at runtime. See GSpaceDriver::driveGSpace for flow of control.

Function Documentation

void CP_State_GSpacePlane::acceptPairCalcAIDs ( pcSetupMsg msg)

Contribute to the reduction telling main we are done

Definition at line 643 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::asymmPCmgr, CP_State_GSpacePlane::myOrtho, and CP_State_GSpacePlane::symmPCmgr.

void CP_State_GSpacePlane::combineForcesGetEke ( )

Add forces from particle plane to forces from IFFT then zero them

Compute force due to quantum kinetic energy and add it in. Reduce quantum kinetic energy or eke

Debug output

Definition at line 1550 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind, and Config::nfreq_cpnonlocal_eke.

void CP_State_GSpacePlane::completeRDMAhandshake ( RDMASetupConfirmationMsg< RDMApair_GSP_PC > *  msg)

Gets called from the PairCalc data receivers to confirm the setup of an RDMA link.

RDMA routines for ibverbs CmiDirect optimization.

Definition at line 4045 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::asymmPCmgr, CP_State_GSpacePlane::numRDMAlinksSymm, and CP_State_GSpacePlane::symmPCmgr.

void CP_State_GSpacePlane::computeCgOverlap ( )

If minimization : compute lambda matrix (Lagrange multipliers) modify forces using the lambda matrix compute the |force|^2 = fovlap.

Flow of control check and local variables CkPrintf("{%d} GSP [%d,%d] computeCgOverlap\n",thisInstance.proxyOffset, thisIndex.x,thisIndex.y);

Definition at line 2219 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::computeEnergies ( int  param,
double  d 
)

Once All chares have completed energy computation and reduction, this storage routine is invoked.

Since eke is the last energy, its reduction client invokes this guy on chare (0,0). The routine then bcasts its results to the energy group (one per processor) thereby making information available on all procs for tolerence testing via a cklocal type deal.

= if your debugging or natm_nl==0 you get fewer energies

Definition at line 3784 of file CP_State_GSpacePlane.C.

Referenced by CP_State_GSpacePlane::psiCgOvlap().

CP_State_GSpacePlane::CP_State_GSpacePlane ( int  sizeX,
int  gSpaceUnits,
int  realSpaceUnits,
int  s_grain,
int  _gforward,
int  _gbackward,
UberCollection  _thisInstance 
)

Constructor for GSpacePlane.

initialize member vars

Setup Symm PC accounting to expected manage message counts

Asymm PC msg count accounting

Compute the number of RDMA links that I'll have with the symm/asymm PC chares

Just zero everything for now

Load Balancing etc

Pick a reduction plane

Parameters
sizeXnumplanes in x per state
gSpaceUnitsnumplanes per slab (Gspace: in x dimension)
realSpaceUnitsnumplanes per slab (Rspace: in y dimension)
s_grainS matrix grain size
_gforwardtimekeeper fwd
_gbackwardtimekeeper bwd
_thisInstanceuber

Definition at line 269 of file CP_State_GSpacePlane.C.

References initGStateSlab(), CP_State_GSpacePlane::iplane_ind, CP_State_GSpacePlane::istate_ind, and CP_State_GSpacePlane::numRDMAlinksSymm.

void CP_State_GSpacePlane::doFFT ( )

This method is used to start the forward ffts in the CP_State_GSpacePlanes.

The work done here could have been done in the acceptData method, but for the fact that we need to synchronize all the CP_State_GSpacePlanes before doing the forward-ffts. This is a feature, not a bug!

Do fft in forward direction, 1-D, in z direction A local function not a message : get pointer to memory for fft group

Definition at line 1291 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

void CP_State_GSpacePlane::doIFFT ( )

If there is a barrier after the IFFTs, contribute to the reduction barrier that will sync all GSpace chares

Definition at line 1499 of file CP_State_GSpacePlane.C.

References FFTcache::doStpFFTRtoG_Gchare(), and CP_State_GSpacePlane::iplane_ind.

void CP_State_GSpacePlane::doLambda ( )

When all the inputs have arrived, complete the lambda computation.

(I) If you have got it all : Rescale it and resume

Retrieve Non-orthog psi

Debug Schmoo

Debug : Write out forces after Lambda-ization

Definition at line 2111 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

void CP_State_GSpacePlane::doNewPsi ( )

All Psi have arrived, finish the new Psi process.

(0) Fuss with the redundant psis

(I) If you have got it all : Rescale it, produce some output

(A) Reset counters and rescale the kx=0 stuff

(B) Generate some screen output of orthogonal psi

(E) Debug psi

(E) Reset psi

= Back to the threaded loop.

Definition at line 3096 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::screenOutputPsi().

void CP_State_GSpacePlane::doNewPsiV ( )

process all the PsiV data

(0) Error check

(I) Reset counters and rescale the kx=0 stuff

III) Replace by finite difference until update is better

Definition at line 3609 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

entry void driveGSpace ( )

SDAG method for flow control of the Driver and its associated GSpace object.

Loop until we hit the last iteration, or the GSpacePlane has signaled that we have met the desired tolerance by setting exitFlag to 1.

Resets flags and increases the iteration counter

If called, releaseSFComputeZ() triggers an NL force computation.

Both branches of this if will trigger an NL force computation if releaseSFComputeZ() was not called above.

Wait for both the VKS and the NL force computations to complete.

If output is on and we are doing dynamics then dump to file every ndump_frq iteration as well as the final iteration. We skip the first iterations because nothing moves before iter 2.

If output is on and we are doing minimization then dump to file every ndump_frq iteration as well as the final iteration.

Wait for both the energy computation, and the atoms to be moved before going to the next iteration.

Print out the iteration times and set isFirstStep to false.

Definition at line 60 of file gspace.ci.

Referenced by GSpaceDriver::startControl().

GSpaceDriver::GSpaceDriver ( const UberCollection  _thisInstance)

Constructor.

Initialize flags and counters that record the control state

Definition at line 19 of file GSpaceDriver.C.

void GSpaceDriver::init ( )

Initializer.

Creates a structure factor array section proxy that is used later in releaseSFComputeZ.

Todo:
: When is the earliest that you can do this? Can we do this upon construction? Probably not, as we have no guarantee that UsfCompProxy is up and ready.

If EES nonlocals are off, each state=0 driver chare creates a structure factor array section

numDups must be less than the number of states because thats the maximum number of times you can duplicate a plane

Create a list of SF chares in this section

Create the SF array section

Definition at line 70 of file GSpaceDriver.C.

References GSpaceDriver::sfCompSectionProxy, and GSpaceDriver::thisInstance.

Referenced by GSpaceDriver::startControl().

void CP_State_GSpacePlane::initGSpace ( int  size,
complex points,
int  vsize,
complex vpoints,
int  nx,
int  ny,
int  nz,
int  nxNL,
int  nyNL,
int  nzNL,
int  istart_cp 
)

This method is used to accept the state data from some initializing routine.

Since a CP_State_GSpacePlane class can have more than one plane, the method used for initialization is as follows:

This call initializes the entire set of planes runDescSize: number of run-descriptors size: the total number of non-zero points points: pointer to the total data. n * The data is copied into the planes.

Section Reductions and SF proxy creation

Register with the cache : Eric's multiple reduction schemes ensure its done before we need it.

Setup gs

Setup gpspaceplane and particle plane

Setup k-vector ranges, masses and zero the force overlap

Init NHC, Sample velocities

Send the k's to the structure factor

Some PC initialization that needs to happen here to avoid /onstructor race conditions

This reduction is done to signal the end of initialization to main

Definition at line 840 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind, and GStateSlab::setKRange().

Referenced by CP_State_GSpacePlane::readFile().

void CP_State_GSpacePlane::integrateModForce ( )

Integrate the forces.

I. Error Conditions : you haven't accepted present steps lambda you haven't accepted previous steps psi or vpsi

II. Local pointers

III. Set conjugate gradient parameter : Don't reset too often

IV. Evolve the states using the forces/conjugate direction

(A) Debug output before integration

(B) Numerical integration

(C) Debug output after integration

V. Contribute FictKe : Output and store in energy group

VI. Pack up and set the flag that indicating you've finished integrating.

Definition at line 2436 of file CP_State_GSpacePlane.C.

References IntegrateModForces_, CP_State_GSpacePlane::iplane_ind, and Config::nfreq_cpintegrate.

void CP_State_GSpacePlane::launchAtoms ( )

Atoms are launched by allDoneCpForces when all after ALL planes and states have reported.

The usual stuff

Definition at line 1688 of file CP_State_GSpacePlane.C.

void GSpaceDriver::needUpdatedPsiV ( )

Entry Method. Ortho notifies us that GSpace needs a tolerance update (velocity rotation)

Ortho notifies us that GSpace needs a tolerance update (velocity rotation)

Definition at line 113 of file GSpaceDriver.C.

References GSpaceDriver::myGSpaceObj, and CP_State_GSpacePlane::myOrtho.

void CP_State_GSpacePlane::psiCgOvlap ( CkReductionMsg *  msg)

Entry method to resume execution after computing reduction over all planes and states to form psiCgOvlap (cg only) and magforPsi.

Unpack CkPrintf("{%d} GSP [%d,%d] psiCgOvlap\n",thisInstance.proxyOffset, thisIndex.x,thisIndex.y);

Copy old/new : Set new values

Output the mag force, send to the energy group, set the exit flag

Do a little cputime management in GS class then resume

Definition at line 113 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::computeEnergies(), and mCastGrpId.

void CP_State_GSpacePlane::pup ( PUP::er &  p)

ontrol flags and functions reference by thread are public

Definition at line 553 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind, CP_State_GSpacePlane::istate_ind, CP_State_GSpacePlane::numRDMAlinksSymm, and GStateSlab::pup().

void CP_State_GSpacePlane::readFile ( )

In this function data is read from files, and sent to the corresponding G-space planes.

Data reading will be done in chunk 0 of each state

Local pointers

Set the file name using the config path and state number

Test the input g-vectors and psi(g) using kinetic energy testeke(numData,complexPoints,kx,ky,kz,1,ind_state);

Blast off the data to chares

Clean up

Definition at line 666 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::initGSpace(), processState(), and readState().

void GSpaceDriver::releaseSFComputeZ ( )

Triggers nonlocal energy computations.

Set to false, just before I spawn the nonlocal work Tell the structure factor chares to do their work

Multicast to all states of our plane and dups using the section proxy

Call on corresponding particle plane chare to launch all the Z matrix computations

Definition at line 148 of file GSpaceDriver.C.

References CP_State_ParticlePlane::launchComputeZs(), GSpaceDriver::myGSpaceObj, GSpaceDriver::myParticlePlaneObj, and GSpaceDriver::sfCompSectionProxy.

void CP_State_GSpacePlane::screenOutputPsi ( int  iprintout)

output a few select psi values for post processing validation

Screen Output

II) Tell the world you are done with the output

Definition at line 3697 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

Referenced by CP_State_GSpacePlane::doNewPsi(), and CP_State_GSpacePlane::startNewIter().

void CP_State_GSpacePlane::sendFFTData ( )

Send result to realSpacePlane : perform the transpose Force data cannot be overwritten due to all to all nature of comm.

Until everyone sends, no one gets anything back

Do a Comlib Dance

Send your (x,y,z) to processors z.

Finish up

Definition at line 1355 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::sendLambda ( )

After my CP forces have arrived : sendLambda.

Reset lambda (not done) and force counters (not done for NEXT step):

Get nice local variables and if dynamics make a copy

Debug output schmoo : contrib to diagonal element of lambda from this chare : Most effective for 1 gspace chare when you : get the diangonal elemens of lambda (see below)

Debug output schmoo : output forces before lambda-ization! :

Scale the variables for dynamics and double packing : Single pack will require modification of factors of 2 in PC or scaling all the variables which stinks

Enormous debug schmoo

Send to lambda : Finally

sub-phase timing

Definition at line 1722 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::asymmPCmgr, CP_State_GSpacePlane::iplane_ind, cp::gspace::PCCommManager::sendLeftData(), and cp::gspace::PCCommManager::sendRightData().

void CP_State_GSpacePlane::sendPsi ( )

Send the psi out to symm PC.

= Error checking

= Prepare the data : If cp dynamics is going, save the non-orthogonal puppies.

Debugging

Start the calculator

Symm loop PC chares in the top left [*,0,0,*] will not receive any right matrix data. Hence, if you're in such a PC's block, dont send right

Definition at line 2840 of file CP_State_GSpacePlane.C.

References cp::paircalc::pcConfig::grainSize, cp::gspace::PCCommManager::pcCfg, cp::gspace::PCCommManager::sendLeftData(), cp::gspace::PCCommManager::sendRightData(), and CP_State_GSpacePlane::symmPCmgr.

void CP_State_GSpacePlane::sendPsiV ( )

send psi velocities

Error Check

Symm loop PC chares in the top left [*,0,0,*] will not receive any right matrix data. Hence, if you're in such a PC's block, dont send right

Definition at line 3436 of file CP_State_GSpacePlane.C.

References cp::paircalc::pcConfig::grainSize, cp::gspace::PCCommManager::pcCfg, cp::gspace::PCCommManager::sendLeftData(), cp::gspace::PCCommManager::sendRightData(), and CP_State_GSpacePlane::symmPCmgr.

void CP_State_GSpacePlane::sendRedPsi ( )

send red psi

Check for errors

Definition at line 2692 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::sendRedPsiV ( )

I) Local Pointer setup

II) Sync yourself with psi by integrating to time t if output has not done it you have the wrong force but thats OK until you put in a better rotation

III) We still have these funky g=0 plane guys that may be on other procs and we have sync those guys, also, or PC won't work correctly

Check for errors

I send the stuff and I need a new velocity

Definition at line 3223 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

void GSpaceDriver::startControl ( )

Entry Method. Creates and invokes the SDAG that controls GSpace execution.

Called from InstanceController::doneInit which is a reduction client invoked by all (state,plane) objects after completion of CP_State_GspacePlane::initGSpace.

Get hold of the (local) GSpacePlane and ParticlePlane objects that we'll be working with

Do other initialization chores

Call the SDAG method in charge of control flow

Definition at line 97 of file GSpaceDriver.C.

References driveGSpace(), GSpaceDriver::init(), GSpaceDriver::myGSpaceObj, GSpaceDriver::myParticlePlaneObj, and GSpaceDriver::thisInstance.

void CP_State_GSpacePlane::startNewIter ( )

Check for flow of control errors :

Reset all the counters that need to be reset (not more not less) otherwise race conditions can leak in. Rely on the constructor for initialization. Reset set your flags as soon as you are done with the tests that require them.

Check Load Balancing, Increment counter, set done flags equal to false.

Output psi at start of minimization for debugging

Definition at line 1131 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::screenOutputPsi().

void GSpaceDriver::startNonLocalEes ( int  iteration_loc)

Entry Method. Triggers nonlocal energy computations.

Trigger the nonlocal computations.

Set to false, just before I spawn the nonlocal work

Definition at line 122 of file GSpaceDriver.C.

References GSpaceDriver::myGSpaceObj, GSpaceDriver::myParticlePlaneObj, CP_State_ParticlePlane::startNLEes(), and GSpaceDriver::thisInstance.

void testeke ( int  ncoef,
complex psi_g,
int *  k_x,
int *  k_y,
int *  k_z,
int  iflag,
int  index 
)

Test does ReadFile() parse psi(g) and g-vectors properly.

Local pointers

Compute some eke

Definition at line 3936 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackFileOutput ( GStateOutMsg msg)

Receive the message

Definition at line 2352 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackIFFT ( GSIFFTMsg msg)

Entry Method. This is used to receive data from all the corresponding RealSpacePlanes, upon which the inverse FFTs are triggered.

Force cannot be overwitten because we can't receive until all chares send.

The beauty of all to all comm Forces are initialized HERE. No need to zero them etc. elsewhere.

Recv the message

Definition at line 1449 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackLambda ( CkReductionMsg *  msg)

Count then debug

Add the forces

A) Double Pack

B) Double Pack is off

C) Cleanup

Do we have everything?

Definition at line 1921 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

void CP_State_GSpacePlane::unpackLambda ( partialResultMsg msg)

= 0) unpack the message : pop out variables from groups

= I) Increment the counter and do some checking

(II) Add it in to our forces : Careful about offsets, doublepack and cpmin/cp

A) Double Pack

B) Single pack

C) Clean up

are we done?

Definition at line 2018 of file CP_State_GSpacePlane.C.

References CP_State_GSpacePlane::iplane_ind.

void CP_State_GSpacePlane::unpackNewPsi ( CkReductionMsg *  msg)

(0) Fuss with the redundant psis

(0) Nan Check and output

(I) Unpack the contribution to newpsi (orthonormal psi)

(II) If you have got it all : Rescale it, produce some output

Definition at line 2943 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackNewPsi ( partialResultMsg msg)

Accept partial results when symm PC s sending to us directly.

(0) Fuss with the redundant psis

(0) Check for Nans

(I) Unpack the contribution to newpsi (orthonormal psi)

When all have arrived, continue in doNewPsi

Definition at line 3017 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackNewPsiV ( CkReductionMsg *  msg)

(I) Local pointer setup

(II) Unpack the contribution to newpsi (orthonormal psi)

(III) When all has arrive, onward to victory

Definition at line 3487 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackNewPsiV ( partialResultMsg msg)

(I) Local pointer setup

(I) Unpack the contribution to newpsi (orthonormal psi)

(II) Continue

Definition at line 3543 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackRedPsi ( GSRedPsiMsg msg)

=

unpack

Check if all have arrived

Definition at line 2765 of file CP_State_GSpacePlane.C.

void CP_State_GSpacePlane::unpackRedPsiV ( GSRedPsiMsg msg)

unpack

if all have arrived resumecontrol

Definition at line 3341 of file CP_State_GSpacePlane.C.

Variable Documentation

array [2D] CP_State_GSpacePlane
Initial value:
{
entry CP_State_GSpacePlane(int sizeX, int numG, int numR, int s_grain, int timekeepf, int timekeepb, UberCollection)
holds the UberIndex and the offset for proxies
Definition: Uber.h:68
2D chare array [nchareG][nstates] Handles the electronic structure in Fourier space (referred to as G...

Definition at line 298 of file gspace.ci.

array [2D] CP_State_ParticlePlane
Initial value:
{
entry CP_State_ParticlePlane(int ,int ,int ,int ,int ,int ,int ,int ,int ,int ,int ,int ,int ,int ,int, UberCollection)
holds the UberIndex and the offset for proxies
Definition: Uber.h:68

Definition at line 182 of file gspace.ci.

array [2D] CP_State_RealParticlePlane
Initial value:
{
entry CP_State_RealParticlePlane(int , int , int ,int , int ,int ,int,int, UberCollection)
holds the UberIndex and the offset for proxies
Definition: Uber.h:68

Definition at line 196 of file gspace.ci.

array [2D] CP_State_RealSpacePlane
Initial value:
{
entry CP_State_RealSpacePlane( int , int ,int, int, int,int, int, UberCollection)
holds the UberIndex and the offset for proxies
Definition: Uber.h:68

Definition at line 245 of file gspace.ci.

module gParticlePlane
Initial value:
{
holds the UberIndex and the offset for proxies
Definition: Uber.h:68

Definition at line 170 of file gspace.ci.

module gSpaceDriver
Initial value:
{
include "uber/Uber.h"

Definition at line 31 of file gspace.ci.

array [2D] GSpaceDriver
Initial value:
{
entry GSpaceDriver(const UberCollection _thisInstance)
holds the UberIndex and the offset for proxies
Definition: Uber.h:68
2D chare array [nchareG][nstates] Handles flow of control within an instance, always same dimensional...
Definition: GSpaceDriver.h:34

Definition at line 34 of file gspace.ci.

message GStateOutMsg
Initial value:

Definition at line 233 of file gspace.ci.

module gStatePlane
Initial value:
{
extern module pcMessages

Definition at line 219 of file gspace.ci.