NAMD
ComputeMsmMsa.h
Go to the documentation of this file.
1 
7 #ifndef COMPUTEMSMMSA_H
8 #define COMPUTEMSMMSA_H
9 
10 #ifdef CHARM_HAS_MSA
11 
12 #include <vector>
13 #include "ComputeHomePatches.h"
14 #include "NamdTypes.h"
15 #include "ComputeMoa.h" // needed for Int3 declaration
16 #include "msa/msa.h"
17 
18 typedef MSA::MSA3D<float, DefaultEntry<float>,
19  MSA_DEFAULT_ENTRIES_PER_PAGE> MsmMsaGrid;
20 
21 #if 0
22 struct Int3 {
23  int nx, ny, nz;
24  Int3() : nx(0), ny(0), nz(0) { }
25  Int3(int mx, int my, int mz) : nx(mx), ny(my), nz(mz) { }
26  void pup(PUP::er &p) { p|nx, p|ny, p|nz; }
27 };
28 #endif
29 
30 class SubmitReduction;
31 typedef Force MsmMsaForce;
32 
33 class ComputeMsmMsa : public ComputeHomePatches {
34 public:
35  ComputeMsmMsa(ComputeID c);
36  virtual ~ComputeMsmMsa();
37  void doWork();
38  void saveResults(int n, const MsmMsaForce [], double self_energy);
39 
40 private:
41  double qscaling; // charge scaling constant
42  SubmitReduction *reduction;
43 };
44 
45 struct MsmMsaData {
46  int ispx, ispy, ispz;
47  float hx_1, hy_1, hz_1;
48  float a;
49 
50  float origin_x, origin_y, origin_z;
51 
52  int nlevels, maxlevels, toplevel;
53 
54  int approx;
55  int split;
56 
57  std::vector<MsmMsaGrid> qh;
58  std::vector<MsmMsaGrid> eh;
59  std::vector<Int3> grid_len; // grid points in each dimension for each level
60  std::vector<Int3> grid_idstart; // starting index for each level
61 
62  std::vector<float> scaling; // scaling factor for each grid level
63  Int3 gc_len; // length of grid cutoff stencil in each dimension
64  Int3 gc_idstart; // starting index of grid cutoff stencil
65  std::vector<float> gc; // grid cutoff stencil
66 
67  Int3 gctop_len;
68  Int3 gctop_idstart;
69  std::vector<float> gctop; // grid cutoff stencil for top level
70 
71  std::vector<int> num_clients_qh; // number client chares for each qh grid
72  std::vector<int> num_clients_eh; // number client chares for each eh grid
73 
74  int num_anterpolation_chares; // number of chares doing anterpolation
75  int num_interpolation_chares; // number of chares doing interpolation
76  std::vector<int> num_restriction_chares; // number restrictions per level
77  std::vector<int> num_prolongation_chares; // number prolongations per level
78  std::vector<int> num_gridcutoff_chares; // number grid-cutoff-s per level
79  std::vector<Int3> dim_gridcutoff_chares; // grid cutoff chare dim per level
80  std::vector<Int3> dim_gridtransfer_chares; // grid trans chare dim per level
81  int num_total_restriction_chares;
82  int num_total_prolongation_chares;
83  int num_total_gridcutoff_chares;
84  int num_energy_chares; // number of energy summing chares
85 
86  Int3 num_points_per_chare; // size of grid point sub-cubes
87 
88  double self_energy_const;
89 
90  void pup(PUP::er &p); // for parameter marshalling
91  void print(); // for debugging
92 };
93 
94 #endif // CHARM_HAS_MSA
95 
96 #endif // COMPUTEMSMMSA_H
97 
int ComputeID
Definition: NamdTypes.h:183
Definition: Vector.h:64
int nx
Definition: ComputeMoa.h:65
virtual void doWork()
Definition: Compute.C:108
int ny
Definition: ComputeMoa.h:65
void pup(PUP::er &p)
Definition: ComputeMoa.h:68
Int3()
Definition: ComputeMoa.h:66
std::vector< std::string > split(const std::string &text, std::string delimiter)
Definition: MoleculeQM.C:73
int nz
Definition: ComputeMoa.h:65