OpenAtom  Version1.5a
cpaimd.ci
Go to the documentation of this file.
1 /** \file cpaimd.ci
2  *
3  */
4 
5 module CPcharmParaInfo
6 {
7  class CPcharmParaInfo;
8  // The physics configuration, both input, and derived, is kept here.
9  // This data is effectively readonly.
10  group CPcharmParaInfoGrp
11  {
13  };
14 };
15 
16 module PhysScratchCache
17 {
18  class PSNONLOCAL;
19  // The physics configuration, both input, and derived, is kept here.
20  // This data is effectively readonly.
21  group PhysScratchCache
22  {
23  entry PhysScratchCache();
24  };
25 };
26 
27 
28 module Atoms
29 {
30  // Forward declarations
31  class Atom;
32  class AtomNHC;
33  include "uber/Uber.h";
34 
35  message AtomMsg
36  {
37  double data[];
38  };
39 
40 
41  message AtomXYZMsg
42  {
43  double x[];
44  double y[];
45  double z[];
46  };
47 
48  group AtomsCache {
49  entry AtomsCache(int natm, int natm_nl, Atom atoms[natm],
51  entry void acceptAtoms(AtomMsg *);
52  entry void contributeforces();
53  entry void atomsDone();
54  entry void atomsDone(CkReductionMsg *);
55 
56  };
57 
58  array [1D] AtomsCompute {
59  entry AtomsCompute(int natm, int natm_nl, int len_nhc, int iextended_on,
60  int cp_min_opt, int cp_wave_opt, int isokin_opt, double kT,
61  Atom atoms[natm],AtomNHC atomsNHC[natm], int nChareAtoms, UberCollection);
62  entry void init();
63  entry void acceptAtoms(AtomMsg *);
64  entry void startRealSpaceForces();
65  entry void acceptNewTemperature(double temp);
66  entry void recvContribute(CkReductionMsg *);
67  entry void recvContributeForces(CkReductionMsg *);
68  entry void atomsDone(CkReductionMsg *);
69  entry void accept_PIMD_x(double _x, double _y, double _z, int atomI);
70  entry void accept_PIMD_Fu(double _fxu, double _fyu, double _fzu, int atomI);
71  entry void accept_PIMD_Fu_and_u(double _fxu, double _fyu, double _fzu,
72  double _xu, double _yu, double _zu, int atomI);
73  entry void accept_PIMD_CM(AtomXYZMsg *msg);
74  entry void accept_PIMD_u(double _ux, double _uy, double _uz, int atomI);
75 
76  };
77 
78 };
79 
80 module EnergyGroup
81 {
82  include "main/energy.h";
83  // The global energies are stored here.
84  group EnergyGroup {
86  entry void updateEnergiesFromGS(EnergyStruct es, UberCollection);
87  entry void energyDone(CkReductionMsg *);
88  entry void resumeFromTemper();
89  entry void sendToTemper(CkReductionMsg *m);
90 
91  };
92 };
93 
94 module PIBeadAtoms
95 {
96  // Forward declarations
97  class UberCollection;
98  class Atom;
99  class AtomNHC;
100  array [1D] PIBeadAtoms {
101  entry PIBeadAtoms(UberCollection, int,int);
102  entry void accept_PIMD_x(double x,double y, double z, int index );
103  entry void accept_PIMD_Fx(AtomXYZMsg *msg);
104  entry void accept_PIMD_Fx_and_x(AtomXYZMsg *msg);
105  entry void accept_PIMD_u(double xu,double yu, double zu, int index);
106  };
107 
108 
109 };
110 
111 
112 
113 module timeKeeper
114 {
115  group TimeKeeper {
116  entry TimeKeeper();
117  entry void init();
118  entry void collectStart(CkReductionMsg *m);
119  entry void collectEnd(CkReductionMsg *m);
120  };
121 };
122 
123 
124 module ENL_EKE_Collector
125 {
126 
127 /// across all beads and k-points and spin, not across tempers
128  array [1D] ENL_EKE_Collector {
129  entry ENL_EKE_Collector(int clients, int outputs);
130  entry void acceptENL(double enl);
131  entry void acceptEKE(double eke);
132  };
133 
134 };
135 
136 
137 module instanceController
138 {
139  message ICCookieMsg;
140  array [1D] InstanceController {
141  entry InstanceController();
142  entry void acceptNewTemperature(double t);
143  entry void useNewTemperature(double t);
144  entry void printEnergyEexc(CkReductionMsg *msg);
145  entry void printEnergyHart(CkReductionMsg *msg);
146  entry void printFictEke(CkReductionMsg *msg);
147  entry void allDoneCPForces(CkReductionMsg *m);
148  entry void printEnergyEke(CkReductionMsg *m);
149  entry void allDoneCPForcesAllKPoint(CkReductionMsg *m);
150  entry [nokeep] void initCookie(ICCookieMsg *msg);
151  entry void doneInit(CkReductionMsg *msg);
152  entry void cleanExit(CkReductionMsg *m);
153  entry void cleanExitAll(CkReductionMsg *m);
154  entry void gspDoneNewTemp(CkReductionMsg *m);
155  entry void atomsDoneNewTemp(CkReductionMsg *m);
156  entry void fmagMinTest(CkReductionMsg *m);
157  };
158 };
159 
160 module temperController
161 {
162  array [1D] TemperController {
163  entry void TemperController();
164  entry void acceptData(int temper, EnergyStruct);
165  };
166 };
167 
168 
169 
170 mainmodule cpaimd {
171  initnode void initFFTLock(void);
172 
173  readonly double Timer;
174  readonly int nstates;
175  readonly int sizeX;
176  readonly int nchareG;
177  readonly int Ortho_UE_step2;
178  readonly int Ortho_UE_step3;
179  readonly int Ortho_UE_error;
180  readonly bool Ortho_use_local_cb;
181  readonly int done_init;
182  readonly int TimeKeeperID;
183  readonly int numPes;
184  readonly int planes_per_pe;
185  readonly bool fakeTorus;
186  readonly CProxy_TimeKeeper TimeKeeperProxy;
187  initnode registersumFastDouble(void);
188 
189  extern module CPcharmParaInfo;
190  extern module PhysScratchCache;
191  extern module gSpaceDriver;
192  extern module gParticlePlane;
193  extern module gStatePlane;
194  extern module ckPairCalculator;
195  extern module CLA_Matrix;
196  extern module ortho;
197  extern module structureFactor;
198  extern module structureFactorCache;
199  extern module Atoms;
200  extern module EnergyGroup;
201  extern module PIBeadAtoms;
202  extern module timeKeeper;
203  extern module startupMessages;
204  extern module ENL_EKE_Collector;
205  extern module instanceController;
206  extern module temperController;
207 
208 
209  readonly CPcharmParaInfo simReadOnly;
210  readonly CkVec < CkVec <int> > UplaneUsedByNLZ;
211  readonly CkHashtableT<intdual, int> GSmaptable;
212  readonly CkHashtableT<intdual, int> RSmaptable;
213  readonly CkHashtableT<intdual, int> RPPmaptable;
214  readonly CkHashtableT<intdual, int> RhoGSmaptable;
215  readonly CkHashtableT<intdual, int> RhoRSmaptable;
216  readonly CkHashtableT<intdual, int> RhoGHartmaptable;
217  readonly CkHashtableT<inttriple, int> RhoRHartmaptable;
218  readonly CkHashtableT<intdual, int> Orthomaptable;
219  readonly CkHashtableT<intdual, int> OrthoHelpermaptable;
220  readonly CkHashtableT<intdual, int> AsymScalcmaptable;
221  readonly CkHashtableT<intdual, int> SymScalcmaptable;
222  readonly CkVec <MapType1> AtomImaptable;
223  readonly CkVec <int> PIBImaptable;
224  readonly CkVec <MapType2> GSImaptable;
225  readonly CkVec <MapType2> RSImaptable;
226  readonly CkVec <MapType2> RPPImaptable;
227  readonly CkVec <MapType2> RhoGSImaptable;
228  readonly CkVec <MapType2> RhoRSImaptable;
229  readonly CkVec <MapType2> RhoGHartImaptable;
230  readonly CkVec <MapType3> RhoRHartImaptable;
231 
232 
233  readonly Config config;
234 
235  readonly CProxy_PhysScratchCache pScratchProxy;
236  readonly CProxy_InstanceController instControllerProxy;
237 
238  readonly CProxy_TemperController temperControllerProxy;
239 
240  readonly CProxy_ENL_EKE_Collector ENLEKECollectorProxy;
241 
242  readonly CkVec <CProxy_PIBeadAtoms> UPIBeadAtomsProxy;
243 
244  readonly CkVec <CProxy_CP_State_GSpacePlane> UgSpacePlaneProxy;
245  readonly CkVec <CProxy_GSpaceDriver> UgSpaceDriverProxy;
246  readonly CkVec <CProxy_CP_State_ParticlePlane> UparticlePlaneProxy;
247  readonly CkVec <CProxy_CP_State_RealSpacePlane> UrealSpacePlaneProxy;
248  readonly CkVec <CProxy_CP_State_RealParticlePlane> UrealParticlePlaneProxy;
249  readonly CkVec <CProxy_CP_Rho_RealSpacePlane> UrhoRealProxy;
250  readonly CkVec <CProxy_CP_Rho_GSpacePlane> UrhoGProxy;
251  readonly CkVec <CProxy_CP_Rho_GHartExt> UrhoGHartExtProxy;
252  readonly CkVec <CProxy_CP_Rho_RHartExt> UrhoRHartExtProxy;
253  readonly CkVec <CProxy_AtomsCache> UatomsCacheProxy;
254  readonly CkVec <CProxy_AtomsCompute> UatomsComputeProxy;
255  readonly CkVec <CProxy_EnergyGroup> UegroupProxy;
256  readonly CkVec <CProxy_FFTcache> UfftCacheProxy;
257  readonly CkVec <CProxy_StructFactCache> UsfCacheProxy;
258  readonly CkVec <CProxy_StructureFactor> UsfCompProxy;
259  readonly CkVec <CProxy_eesCache> UeesCacheProxy;
260 
261  readonly CkVec <CProxy_CP_LargeSP_RhoGSpacePlane> UlsRhoGProxy;
262  readonly CkVec <CProxy_CP_LargeSP_RhoRealSpacePlane> UlsRhoRealProxy;
263 
264  readonly CkVec <UberCollection> UberAlles;
265 
266  readonly CkGroupID mCastGrpId;
267 
268 //#ifdef USE_COMLIB
269  // exc, hart, eext communication
270  readonly ComlibInstanceHandle commGHartInstance;
271  readonly ComlibInstanceHandle commGInstance0;
272  readonly ComlibInstanceHandle commGInstance1;
273  readonly ComlibInstanceHandle commGInstance2;
274  readonly ComlibInstanceHandle commGInstance3;
275  readonly ComlibInstanceHandle commGByrdInstance;
276  readonly ComlibInstanceHandle commRealInstance;
277  readonly ComlibInstanceHandle commRealIGXInstance;
278  readonly ComlibInstanceHandle commRealIGYInstance;
279  readonly ComlibInstanceHandle commRealIGZInstance;
280 
281  //ortho to itself
282  readonly ComlibInstanceHandle orthoInstance;
283 
284  // pc communication
285  readonly ComlibInstanceHandle gAsymInstance;
286  readonly ComlibInstanceHandle gSymInstance;
287 
288  // multicast for vks to states and other things
289  readonly CkVec <ComlibInstanceHandle> mcastInstance;
290  readonly ComlibInstanceHandle mcastInstancePP;
291  readonly ComlibInstanceHandle mcastInstanceRPP;
292  readonly ComlibInstanceHandle mcastInstancemRPP;
293 
294  // density from psi : g->r and r->g
295  readonly ComlibInstanceHandle mssInstance;
296  readonly ComlibInstanceHandle gssInstance;
297 
298  // Nonlocal Ees method : g->r and r->g
299  readonly ComlibInstanceHandle gssPInstance;
300  readonly ComlibInstanceHandle mssPInstance;
301 
302  // Eext method : g->r and r->g
303  readonly ComlibInstanceHandle commRHartGHartIns;
304  readonly ComlibInstanceHandle commGHartRHartIns0;
305  readonly ComlibInstanceHandle commGHartRHartIns1;
306 //#endif
307  // PINY Physics readonly data structures
308  readonly MDINTEGRATE readonly_mdintegrate;
309  readonly MDATOMS readonly_mdatoms;
310  readonly MDINTER readonly_mdinter;
311  readonly MDINTRA readonly_mdintra;
312  readonly GENERAL_DATA readonly_general_data;
313  readonly CP readonly_cp;
314 
315 
316 
317  message RSDummyResume;
318 
319  message GHartDummyMsg;
320 
321  message TMsg {complex data[];};
322 
323  message RPPPFFTMsg {complex data[];};
324 
325  message RhoGSFFTMsg {complex data[];};
326 
327  message RhoGHartMsg {complex data[];};
328 
329  message RhoRHartMsg {complex data[];};
330 
331  message RhoRSFFTMsg {complex data[];};
332 
333  message RhoHartRSFFTMsg {complex data[];};
334 
335  mainchare main {
336  entry main(CkArgMsg *);
337  };
338 
339  array [2D] CP_Rho_RealSpacePlane {
340  entry CP_Rho_RealSpacePlane(int, bool,int,int, int, UberCollection);
341  entry void init();
342  entry void exitForDebugging();
343  entry void acceptDensity(CkReductionMsg *m);
344  entry void acceptGradRhoVks(RhoRSFFTMsg *msg);
345  entry void acceptGradRhoVksAll(RhoRSFFTMsg *msg);
346  entry void acceptWhiteByrd(RhoRSFFTMsg *msg);
347  entry void acceptHartVks(RhoHartRSFFTMsg *msg);
348  entry void RHartReport();
349  entry void isAtSync(int);
350  entry void acceptRhoGradVksRyToGy(RhoGSFFTMsg *msg);
351  entry void acceptRhoGradVksGxToRx(RhoGSFFTMsg *msg);
352  };
353 
354  array [3D] CP_Rho_RHartExt {
355  entry CP_Rho_RHartExt(int, int, int,int,int, UberCollection);
356  entry void init();
357  entry void startEextIter();
358  entry void recvAtmForcFromRhoGHart(RhoRHartMsg *msg);
359  entry void registrationDone(CkReductionMsg *msg);
360  entry void recvAtmSfRyToGy(RhoGHartMsg *msg);
361  entry void recvAtmForcGxToRx(RhoGHartMsg *msg);
362  entry void exitForDebugging();
363  }
364 
365  array [2D] CP_Rho_GSpacePlane {
366  entry CP_Rho_GSpacePlane(int, int, int, bool, UberCollection);
367  entry void init();
368  entry void acceptRhoData(RhoGSFFTMsg *msg);
369  entry void acceptWhiteByrd(RhoGSFFTMsg *msg);
370  entry void acceptWhiteByrdAll(RhoGSFFTMsg *msg);
371  entry void isAtSync(int);
372  entry [local] void doRhoFFT();
373  entry void exitForDebugging();
374  };
375 
376  array [2D] CP_Rho_GHartExt {
377  entry CP_Rho_GHartExt(int,int,int,int,int, UberCollection);
378  entry void acceptData(RhoGHartMsg *msg);
379  entry void init();
380  entry void isAtSync(int);
381  entry void recvAtmSFFromRhoRHart(RhoGHartMsg *msg);
382  entry [local] void FFTEesBck();
383  entry void registrationDone(CkReductionMsg *msg);
384  entry void exitForDebugging();
385  entry void acceptVks(int size, complex inVks[size]);
386  entry void acceptAtmSFTot(int size, complex inSF[size]);
387  };
388  array [1D] CP_LargeSP_RhoGSpacePlane {
390  entry [nokeep] void init();
391  entry void acceptMDSg();
392  entry void acceptLSPRhoR();
393  };
394 
395  array [2D] CP_LargeSP_RhoRealSpacePlane {
397  entry [nokeep] void init();
398  entry void acceptLSPRhoG();
399  entry void acceptRhoR();
400  };
401 
402  group AtomComputeMap : CkArrayMap {
404  };
405 
406  group RhoGSMap : CkArrayMap {
407  entry RhoGSMap(UberCollection);
408  };
409 
410  group RhoRSMap : CkArrayMap {
411  entry RhoRSMap(UberCollection);
412  };
413 
414  group RhoGHartMap : CkArrayMap {
416  };
417 
418  group RhoRHartMap : CkArrayMap {
420  };
421 
422  group GSMap : CkArrayMap {
423  entry GSMap(UberCollection);
424  };
425 
426  group RPPMap : CkArrayMap {
427  entry RPPMap(UberCollection);
428  };
429 
430 
431  group RSMap : CkArrayMap {
432  entry RSMap(UberCollection);
433  };
434 
435  extern module pcMaps; // Just so that this module gets registered
436 
437  /**
438  * A place to hold the fftw plans or sizes for essl.
439  * Preallocated space for ffts some of which retain their data
440  * across entry method calls. Does no messaging.
441  */
442  group FFTcache {
443  entry FFTcache( int , int , int , int , int , int ,
444  int , int , int , int , int , int , int ,
445  int nchareGState, int nchareRState,
446  int nchareGNL, int nchareRNL,
447  int nchareGRho, int nchareRRho, int nchareRRhoTot,
448  int nchareGEext, int nchareREext, int nchareREextTot,
449  int numGState[nchareGState],
450  int numRXState[nchareRState],
451  int numRYState[nchareRState],
452  int numRYStateLower[nchareRState],
453  int numGNL[nchareGNL],
454  int numRXNL[nchareRNL],
455  int numRYNL[nchareRNL],
456  int numRYNLLower[nchareRNL],
457  int numGRho[nchareGRho],
458  int numRXRho[nchareRRhoTot],
459  int numRYRho[nchareRRhoTot],
460  int numGEext[nchareGEext],
461  int numRXEext[nchareREextTot],
462  int numRYEext[nchareREextTot],
463  int , int , int , int, UberCollection );
464  };
465 
466 
467 
468  /**
469  * A place to hold the computed ees planewise data on each proc
470  */
471  group eesCache {
472  entry eesCache(int,int,int,int,int,int,int, UberCollection);
473  };
474 };
475 
int main()
holds the UberIndex and the offset for proxies
Definition: Uber.h:68
group eesCache
A place to hold the computed ees planewise data on each proc.
Definition: cpaimd.ci:471
group FFTcache
A place to hold the fftw plans or sizes for essl.
Definition: cpaimd.ci:442
readonly CProxy_InstanceController instControllerProxy
Definition: cpaimd.ci:236
The Large Sparse RhoR is where we interpolate dense RhoR onto the large grid for QMMM.
readonly CkGroupID mCastGrpId
Multicast manager group that handles many mcast/redns in the code. Grep for info. ...
Definition: cpaimd.ci:266
The Large Sparse RhoG is where we interface with NAMD in QMMM for the large grid. ...
readonly bool fakeTorus
readonly defined in cpaimd.C
Definition: cpaimd.ci:185
Class used for instantiation of real-space group objects.
Definition: cpaimd.h:349
module startupMessages
Module containing messages that used during application startup.
Definition: Atoms.h:129
Definition: cpaimd.h:393
readonly Config config
addtogroup Uber
Definition: cpaimd.ci:233
Definition: Atoms.h:20
PhysScratchCache class.
Group Container class : Only allowed chare data classes have data.
Definition: eesCache.h:18
The class which creates the main chare.
Definition: cpaimd.h:96
Definition: cpaimd.h:290
Class used for instantiation of G-space group objects.
Definition: cpaimd.h:260
double Timer
readonly globals
Definition: cpaimd.C:200
provide procnum mapping for RhoR
Definition: cpaimd.h:445
EnergyGroup class.
Definition: energyGroup.h:14
provide procnum mapping for RhoG
Definition: cpaimd.h:494