ComputeGlobal.h

Go to the documentation of this file.
00001 
00007 /*
00008    Forwards atoms to master node for force evaluation.
00009 */
00010 
00011 #ifndef COMPUTEGLOBAL_H
00012 #define COMPUTEGLOBAL_H
00013 
00014 #include "ComputeHomePatches.h"
00015 #include "NamdTypes.h"
00016 
00017 class ComputeGlobalConfigMsg;
00018 class ComputeGlobalDataMsg;
00019 class ComputeGlobalResultsMsg;
00020 class ComputeMgr;
00021 class SubmitReduction;
00022 
00023 struct intpair {
00024   int first, second;
00025   intpair() {;}
00026   intpair(int f, int s) : first(f), second(s) {;}
00027 };
00028 
00029 inline bool operator<(const intpair &lhs, const intpair &rhs) {
00030   return lhs.first < rhs.first ? true :
00031          lhs.first != rhs.first ? false :
00032          lhs.second < rhs.second;
00033 }
00034 
00035 class ComputeGlobal : public ComputeHomePatches {
00036 public:
00037   ComputeGlobal(ComputeID, ComputeMgr*);
00038   virtual ~ComputeGlobal();
00039   void doWork();
00040   // void recvConfig(ComputeGlobalConfigMsg *);
00041   void recvResults(ComputeGlobalResultsMsg *);
00042   // For "loadtotalforces" TCL command
00043   void saveTotalForces(HomePatch *);
00044 
00045 private:
00046   ComputeMgr *comm;
00047 
00048   void sendData();
00049   void configure(AtomIDList &newaid, AtomIDList &newgdef);
00050 
00051   AtomIDList aid;
00052   AtomIDList gdef;  // definitions of groups
00053   ResizeArray<intpair> gpair;
00054   
00055   // (For "loadtotalforces" TCL command)
00056   // The atom IDs and forces of the requested atoms on the node
00057   // after force evaluation. "fid" could be slightly different
00058   // from "aid", since the latter is after atom migration.
00059   AtomIDList fid;
00060   ForceList totalForce;
00061   ForceList groupTotalForce;
00062   int numGroupsRequested;
00063 
00064   Force **forcePtrs;
00065   FullAtom **atomPtrs;
00066   
00067   int forceSendEnabled; // are total forces received?
00068   int forceSendActive; // are total forces received this step?
00069   int gfcount;  // count of atoms contributing to group forces
00070   char *isRequested;  // whether this atom is requested by the TCL script
00071   int isRequestedAllocSize;  // size of array
00072   int endRequested;  // starting at this point assume not requested
00073   int dofull;  // whether "Results::slow" force will exist
00074 
00075   int firsttime;
00076   SubmitReduction *reduction;
00077 };
00078 
00079 #endif
00080 

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