OpenAtom  Version1.5a
GSpaceDriver.h
1 #include "debug_flags.h"
2 #include "gSpaceDriver.decl.h"
3 #include "structureFactor.decl.h"
4 #include "main/CPcharmParaInfoGrp.h"
5 #include "charm++.h"
6 #include "uber/Uber.h"
7 
8 #ifndef GSPACE_DRIVER_H
9 #define GSPACE_DRIVER_H
10 
11 /// Forward declarations
14 /** @addtogroup GSpaceState
15  @{
16 */
17 
18 /** @brief 2D chare array [\ref nchareG][\ref nstates]
19  * Handles flow of control within an instance, always same dimensional cardinality
20  * and mapping as \ref CP_Gspace_State_Plane
21 */
22 
23 /** A 2D chare array bound to CP_State_GspacePlane that manages the driver logic and related communication details.
24  *
25  * Implements entry methods that are primarily used by other chares for notifying progress on different portions
26  * of the computation. This information is used to orchestrate the work. Holds counters and flags used in the GSpace
27  * driver logic that is currently implemented as SDAG code.
28  *
29  * Use starts with the creation of the numInstances bound arrays in init_state_chares(). InstanceController::doneInit()
30  * then invokes startControl() which calls init and then driveGSpace. The latter uses Structured DAGger to manage the control flow. The intricacies of the workflow
31  * should be evident in gspace.ci's documentation and in the SDAG code comments. SDAG defined the chain of dependencies between entry methods and invokes different local object functions when their input dependencies have been met. Flow returns naturally to the driveGSpace as those functions return.
32  *
33  */
35 {
36  public:
37  GSpaceDriver_SDAG_CODE
38  /// Constructors
40  GSpaceDriver(CkMigrateMessage *msg);
41  GSpaceDriver(const UberCollection _thisInstance);
42  /// Initializer
43  void init();
44  /// PUP method
45  void pup(PUP::er &p);
46 
47  /// @entry Creates and invokes the SDAG that controls GSpace execution.
48  void startControl();
49  /// @entry local. GSpace notifies me that its ready to exit by calling this method
50  void readyToExit();
51  /// @entry Ortho notifies us that GSpace needs a tolerance update (velocity rotation)
52  void needUpdatedPsiV();
53  /// @entry Triggers nonlocal energy computations
54  void startNonLocalEes(int iteration_loc);
55  /// Triggers nonlocal energy computations
56  void releaseSFComputeZ();
57 
58  /// True if this is the first step
60  ///
61  int ees_nonlocal;
62  ///
63  int natm_nl;
64  ///
65  int cp_min_opt;
66  ///
67  int gen_wave;
68  ///
69  int ndump_frq;
70  ///
71  bool isPsiVupdateNeeded;
72  ///
73  bool isOutputNeeded;
74 
75  /// Pointer to the GSpacePlane object that I am driving (controlling)
77  /// Pointer to the ParticlePlane object that I am driving (controlling)
79  /// A handle to the local copy of the config parameters (refresh on migration)
80 
81  private:
82  /// A marker tying this class to a particular instance of interacting chares
84  /// Array section of the structure factor chares that I will be triggering
85  CProxySection_StructureFactor sfCompSectionProxy;
86 };
87 /*@}*/
88 #endif // GSPACE_DRIVER_H
CProxySection_StructureFactor sfCompSectionProxy
Array section of the structure factor chares that I will be triggering.
Definition: GSpaceDriver.h:85
holds the UberIndex and the offset for proxies
Definition: Uber.h:68
GSpaceDriver_SDAG_CODE GSpaceDriver()
Constructors.
Definition: GSpaceDriver.h:39
2D chare array [nchareG][nstates] Handles flow of control within an instance, always same dimensional...
Definition: GSpaceDriver.h:34
void readyToExit()
Entry Method. local. GSpace notifies me that its ready to exit by calling this method.
void releaseSFComputeZ()
Triggers nonlocal energy computations.
Definition: GSpaceDriver.C:148
void startControl()
Entry Method. Creates and invokes the SDAG that controls GSpace execution.
Definition: GSpaceDriver.C:97
const UberCollection thisInstance
A handle to the local copy of the config parameters (refresh on migration)
Definition: GSpaceDriver.h:83
CP_State_GSpacePlane * myGSpaceObj
Pointer to the GSpacePlane object that I am driving (controlling)
Definition: GSpaceDriver.h:76
bool isFirstStep
True if this is the first step.
Definition: GSpaceDriver.h:59
2D chare array [nchareG][nstates] Handles the electronic structure in Fourier space (referred to as G...
void init()
Initializer.
Definition: GSpaceDriver.C:70
void pup(PUP::er &p)
PUP method.
Definition: GSpaceDriver.C:50
void startNonLocalEes(int iteration_loc)
Entry Method. Triggers nonlocal energy computations.
Definition: GSpaceDriver.C:122
CP_State_ParticlePlane * myParticlePlaneObj
Pointer to the ParticlePlane object that I am driving (controlling)
Definition: GSpaceDriver.h:78
void needUpdatedPsiV()
Entry Method. Ortho notifies us that GSpace needs a tolerance update (velocity rotation) ...
Definition: GSpaceDriver.C:113
Useful debugging flags.