ComputeMsmMsa.h

Go to the documentation of this file.
00001 
00007 #ifndef COMPUTEMSMMSA_H
00008 #define COMPUTEMSMMSA_H
00009 
00010 #ifdef CHARM_HAS_MSA
00011 
00012 #include <vector>
00013 #include "ComputeHomePatches.h"
00014 #include "NamdTypes.h"
00015 #include "ComputeMoa.h"  // needed for Int3 declaration
00016 #include "msa/msa.h"
00017 
00018 typedef MSA::MSA3D<float, DefaultEntry<float>,
00019         MSA_DEFAULT_ENTRIES_PER_PAGE> MsmMsaGrid;
00020 
00021 #if 0
00022 struct Int3 {
00023   int nx, ny, nz;
00024   Int3() : nx(0), ny(0), nz(0) { }
00025   Int3(int mx, int my, int mz) : nx(mx), ny(my), nz(mz) { }
00026   void pup(PUP::er &p) { p|nx, p|ny, p|nz; }
00027 };
00028 #endif
00029 
00030 class SubmitReduction;
00031 typedef Force MsmMsaForce;
00032 
00033 class ComputeMsmMsa : public ComputeHomePatches {
00034 public:
00035   ComputeMsmMsa(ComputeID c);
00036   virtual ~ComputeMsmMsa();
00037   void doWork();
00038   void saveResults(int n, const MsmMsaForce [], double self_energy);
00039 
00040 private:
00041   double qscaling;  // charge scaling constant
00042   SubmitReduction *reduction;
00043 };
00044 
00045 struct MsmMsaData {
00046   int ispx, ispy, ispz;
00047   float hx_1, hy_1, hz_1;
00048   float a;
00049 
00050   float origin_x, origin_y, origin_z;
00051 
00052   int nlevels, maxlevels, toplevel;
00053 
00054   int approx;
00055   int split;
00056 
00057   std::vector<MsmMsaGrid> qh;
00058   std::vector<MsmMsaGrid> eh;
00059   std::vector<Int3> grid_len;  // grid points in each dimension for each level
00060   std::vector<Int3> grid_idstart;  // starting index for each level
00061 
00062   std::vector<float> scaling;  // scaling factor for each grid level
00063   Int3 gc_len;            // length of grid cutoff stencil in each dimension
00064   Int3 gc_idstart;        // starting index of grid cutoff stencil
00065   std::vector<float> gc;  // grid cutoff stencil
00066 
00067   Int3 gctop_len;
00068   Int3 gctop_idstart;
00069   std::vector<float> gctop;  // grid cutoff stencil for top level
00070 
00071   std::vector<int> num_clients_qh;  // number client chares for each qh grid
00072   std::vector<int> num_clients_eh;  // number client chares for each eh grid
00073 
00074   int num_anterpolation_chares;  // number of chares doing anterpolation
00075   int num_interpolation_chares;  // number of chares doing interpolation
00076   std::vector<int> num_restriction_chares;  // number restrictions per level
00077   std::vector<int> num_prolongation_chares; // number prolongations per level
00078   std::vector<int> num_gridcutoff_chares;   // number grid-cutoff-s per level
00079   std::vector<Int3> dim_gridcutoff_chares;  // grid cutoff chare dim per level
00080   std::vector<Int3> dim_gridtransfer_chares; // grid trans chare dim per level
00081   int num_total_restriction_chares;
00082   int num_total_prolongation_chares;
00083   int num_total_gridcutoff_chares;
00084   int num_energy_chares;  // number of energy summing chares
00085 
00086   Int3 num_points_per_chare;  // size of grid point sub-cubes
00087 
00088   double self_energy_const;
00089 
00090   void pup(PUP::er &p);  // for parameter marshalling
00091   void print();          // for debugging
00092 };
00093 
00094 #endif // CHARM_HAS_MSA
00095 
00096 #endif // COMPUTEMSMMSA_H
00097 

Generated on Mon Nov 20 01:17:11 2017 for NAMD by  doxygen 1.4.7