NAMD
HomePatch.h
Go to the documentation of this file.
1 
7 /*
8  HomePatch is the key distributed source/sink of Atom data
9  including positions, velocities and forces applied
10 */
11 
12 #ifndef HOMEPATCH_H
13 #define HOMEPATCH_H
14 
15 #include "charm++.h"
16 
17 #include "NamdTypes.h"
18 #include "Patch.h"
19 #include "PatchMap.h"
20 #include "MigrateAtomsMsg.h"
21 #include "main.h"
22 #include "common.h"
23 #include "Migration.h"
24 #include "Settle.h"
25 
26 #include <string>
27 #include <map>
28 
29 class RegisterProxyMsg;
30 class UnregisterProxyMsg;
32 class ProxyResultMsg;
34 class Sequencer;
35 class SubmitReduction;
38 class CheckpointAtomsMsg;
39 class ExchangeAtomsMsg;
40 
42 
43 class ComputeQMMgr;
44 
45 
46 #ifdef TIMER_COLLECTION
47 
48 #include <time.h>
49 
50 struct TimerMicrosecond {
51  struct timespec ts;
52  inline void start() {
53  clock_gettime(CLOCK_REALTIME, &ts);
54  }
55  inline double stop() {
56  struct timespec tsend;
57  clock_gettime(CLOCK_REALTIME, &tsend);
58  return( (tsend.tv_sec - ts.tv_sec) * 1e6 // sec to microsec
59  + (tsend.tv_nsec - ts.tv_nsec) * 1e-3 ); // nanosec to microsec
60  }
61 };
62 
63 #define TIMER_SLOTS 101
64 #define TIMER_SLOT_WIDTH 1
65 
67 struct TimerEntry {
68  TimerMicrosecond tmicro;
69  double tcur;
70  double tavg;
71  double tvar;
72  double tstd;
73  double tmin;
74  double tmax;
75  double tsum;
76 #if defined(DEBUG_TIMER_COLLECTION)
77  double tcharm;
78 #endif
79 #if defined(TIMER_HISTOGRAM)
80  double slotwidth;
81  double inv_slotwidth;
82  int hist[TIMER_SLOTS];
83 #endif
84  int count;
85  TimerEntry() { reset(); }
87  inline void reset() {
88  memset(this, 0, sizeof(TimerEntry));
89  }
90  inline void init(double t = TIMER_SLOT_WIDTH) {
91  tmin = 1e20;
92 #if defined(TIMER_HISTOGRAM)
93  slotwidth = t;
94  inv_slotwidth = (slotwidth > 0 ? 1./slotwidth : 0);
95 #endif
96  }
98  inline void start() {
99 #if defined(DEBUG_TIMER_COLLECTION)
100  tcharm = CkWallTimer();
101 #endif
102  tmicro.start();
103  }
105  inline void stop() {
106  tcur = tmicro.stop();
107 #if defined(DEBUG_TIMER_COLLECTION)
108  tcharm = CkWallTimer() - tcharm; // find ellapsed time
109  tcharm *= 1e6; // convert to microseconds
110 #endif
111  }
117  inline void update() {
118  count++;
119  tsum += tcur;
120  double delta = tcur - tavg;
121  tavg = tavg + delta / count;
122  double delta2 = tcur - tavg;
123  tvar += delta * delta2;
124  if (tcur > tmax) tmax = tcur;
125  if (tcur < tmin) tmin = tcur;
126 #if defined(TIMER_HISTOGRAM)
127  int index = int(floor(tcur * inv_slotwidth));
128  if (index >= TIMER_SLOTS) index = TIMER_SLOTS - 1;
129  hist[index]++;
130 #endif
131  }
135  inline void finalize() {
136  if (count > 0) tvar /= count;
137  tstd = sqrt(tvar);
138  if (tmin > tmax) tmin = tmax;
139  }
140 };
141 
142 struct TimerSet {
143  enum {
144  KICK,
145  MAXMOVE,
146  DRIFT,
147  PISTON,
148  SUBMITHALF,
149  VELBBK1,
150  VELBBK2,
151  RATTLE1,
152  SUBMITFULL,
153  SUBMITCOLLECT,
154  NUMTIMERS
155  };
156  TimerEntry t[NUMTIMERS];
157  static const char *tlabel[NUMTIMERS];
158 };
159 
160 #define TIMER_INIT(T,TYPE) \
161  do { \
162  (T).t[TimerSet::TYPE].init(); \
163  } while(0)
164 
165 #define TIMER_INIT_WIDTH(T,TYPE,WIDTH) \
166  do { \
167  (T).t[TimerSet::TYPE].init(WIDTH); \
168  } while(0)
169 
170 #define TIMER_START(T,TYPE) \
171  do { \
172  (T).t[TimerSet::TYPE].start(); \
173  } while(0)
174 
175 #if defined(DEBUG_TIMER_COLLECTION)
176 
177 // For debugging, compare clock_gettime with CkWallTimer.
178 // The concern is regarding these routines that are on average less than
179 // 10 us (microseconds) but are sometimes an order of magnitude slower.
180 //
181 // Note: After testing, everything with use of clock_gettime seems
182 // to be working correctly.
183 //
184 #define TIMER_STOP(T,TYPE) \
185  do { \
186  (T).t[TimerSet::TYPE].stop(); \
187  (T).t[TimerSet::TYPE].update(); \
188  double tcur = (T).t[TimerSet::TYPE].tcur; \
189  int count = (T).t[TimerSet::TYPE].count; \
190  if (tcur >= 100 && patch->patchID == SPECIAL_PATCH_ID) { \
191  printf("*** %s timing: %g count: %d line: %d charm: %g\n", \
192  (T).tlabel[TimerSet::TYPE], tcur, count, __LINE__, \
193  (T).t[TimerSet::TYPE].tcharm); \
194  } \
195  } while(0)
196 
197 #else // no DEBUG
198 
199 #define TIMER_STOP(T,TYPE) \
200  do { \
201  (T).t[TimerSet::TYPE].stop(); \
202  (T).t[TimerSet::TYPE].update(); \
203  } while(0)
204 
205 #endif // DEBUG_TIMER_COLLECTION
206 
207 #define TIMER_DONE(T) \
208  do { \
209  for (int i=0; i < TimerSet::NUMTIMERS; i++) { \
210  (T).t[i].finalize(); \
211  } \
212  } while(0)
213 
214 #if defined(TIMER_HISTOGRAM)
215 
216 #define TIMER_REPORT(T) \
217  do { \
218  printf("%13s %11s %11s %8s %8s %11s %8s\n", \
219  "name", "avg", "std", "min", "max", "sum", "calls"); \
220  printf("---------------------------------------------------------------" \
221  "-------------\n"); \
222  for (int i=0; i < TimerSet::NUMTIMERS; i++) { \
223  printf("%13s %11g %11g %8g %8g %11g %8d\n", \
224  (T).tlabel[i], (T).t[i].tavg, (T).t[i].tstd, \
225  (T).t[i].tmin, (T).t[i].tmax, (T).t[i].tsum, (T).t[i].count); \
226  } \
227  printf("---------------------------------------------------------------" \
228  "-------------\n"); \
229  for (int i=0; i < TimerSet::NUMTIMERS; i++) { \
230  printf("%13s %8s %8s %8s\n", \
231  (T).tlabel[i], "slot", "time", "count"); \
232  for (int j=0; j < TIMER_SLOTS; j++) { \
233  printf("%13s %8d %8g %8d\n", \
234  " ", j, (j+1)*(T).t[i].slotwidth, (T).t[i].hist[j]); \
235  } \
236  printf("---------------------------------------------------------------" \
237  "-------------\n"); \
238  } \
239  } while(0)
240 
241 #else // no HISTOGRAM
242 
243 #define TIMER_REPORT(T) \
244  do { \
245  printf("%13s %11s %11s %8s %8s %11s %8s\n", \
246  "name", "avg", "std", "min", "max", "sum", "calls"); \
247  printf("---------------------------------------------------------------" \
248  "-------------\n"); \
249  for (int i=0; i < TimerSet::NUMTIMERS; i++) { \
250  printf("%13s %11g %11g %8g %8g %11g %8d\n", \
251  (T).tlabel[i], (T).t[i].tavg, (T).t[i].tstd, \
252  (T).t[i].tmin, (T).t[i].tmax, (T).t[i].tsum, (T).t[i].count); \
253  } \
254  printf("---------------------------------------------------------------" \
255  "-------------\n"); \
256  } while(0)
257 
258 #endif // TIMER_HISTOGRAM
259 
260 #else // no TIMER
261 
262 #define TIMER_INIT(T,TYPE) do { } while(0)
263 #define TIMER_INIT_WIDTH(T,TYPE,WIDTH) do{ } while(0)
264 #define TIMER_START(T,TYPE) do { } while(0)
265 #define TIMER_STOP(T,TYPE) do { } while(0)
266 #define TIMER_DONE(T) do { } while(0)
267 #define TIMER_REPORT(T) do { } while(0)
268 
269 #endif // TIMER_COLLECTION
270 
271 
272 /***
273  * Store atom data for a patch in SOA (structure of arrays) form for
274  * improved vectorization. For now we keep AOS form for packing
275  * messages, especially for atom migration, and to remain compatible
276  * with the rest of NAMD. Copy AOS to SOA data structure at the end
277  * of each atom migration. Copy AOS forces to SOA after force computes.
278  * Copy updated positions from SOA to AOS before launching force computes.
279  * Copy updated coordinates to AOS before atom migration and collections.
280  *
281  * Buffer space is allocated in one large block containing arrays of the
282  * atom components. These arrays are padded up to the next multiple of
283  * 32 for vectorization. Maintaining a single buffer space makes it
284  * easier to move data onto GPU.
285  *
286  * XXX Plan to remove derived constants from FullAtom (e.g. recipMass),
287  * to reduce message sizes as much as possible. Recalculate derived
288  * constants after atom migration.
289  *
290  * XXX Plan to split storage into necessary data and auxiliary buffer
291  * space. Gaussian random numbers need buffer space for generating
292  * but don't need to be maintained. The velNew* and posNew* buffers
293  * are temporary space for calculating rigid bond constraints.
294  */
295 enum {
296 #ifdef NAMD_CUDA
297  MAXFACTOR = 32
298 #else
299  //TODO:HIP verify
300  MAXFACTOR = 32
301 #endif
302 };
303 
304 
308 
313 size_t PatchDataSOA_set_size(
314  PatchDataSOA *p,
315  int natoms,
316  int pad = MAXFACTOR
317  );
318 
324  PatchDataSOA *p,
325  void *mybuffer
326  );
327 
328 
329 class HomePatch : public Patch {
330  friend class PatchMgr;
331  friend class Sequencer;
332  //friend class PatchData;
333 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
334  friend class SequencerCUDA;
335 #endif
336  friend class ComputeGlobal;
337 
338 private:
339  // for PatchMgr to use only
341 
342  void reinitAtoms(FullAtomList&);
343  ScaledPosition min, max, center;
344  BigReal aAwayDist, bAwayDist, cAwayDist;
345 
346  Bool doAtomUpdate; // atom changes other than migration
347 
348  //Note: If new proxies are added to this HomePatch
349  // after load balancing, and it is not the immediate step
350  // after atom migration (where ProxyAllMsg will be sent),
351  // then the CompAtomExt list has to be resent with the
352  // ProxyDataMsg (the normal proxy msg when atoms don't
353  // migrate), otherwise, program will crash without such
354  // information when doing force calculations --Chao Mei
355  Bool isNewProxyAdded;
356  int numGBISP1Arrived, numGBISP2Arrived, numGBISP3Arrived;
357  bool phase1BoxClosedCalled;
358  bool phase2BoxClosedCalled;
359  bool phase3BoxClosedCalled;
360 
361 public:
362 
363  ~HomePatch();
364 
365  // Message from ProxyPatch (via ProxyMgr) which registers its existence
367  // opposite of above
369 
370  // ProxyPatch sends Forces back to here (via ProxyMgr)
372  void receiveResults(ProxyResultMsg *msg);
373  //gbis receiving results from intermediate phases
374  void receiveResult(ProxyGBISP1ResultMsg *msg);//after P1
375  void receiveResult(ProxyGBISP2ResultMsg *msg);//after P2
376 
377  //direct function calls, not as entry methods
379 
380  // AtomMigration messages passes from neighbor HomePatches to here.
382 
383  // Bind a Sequencer to this HomePatch
384  void useSequencer(Sequencer *sequencerPtr);
385  // start simulation over this Patch of atoms
386  void runSequencer(void);
387 
388  //--------------------------------------------------------------------
389  // methods for Sequencer to use
390  //
391 
392  // Signal HomePatch that positions stored are to be now to be used
393  void positionsReady(int doMigration=0);
394  void positionsReady_SOA(int doMigration=0);
395 
396  // Used in device migration
397  void positionsReady_GPU(int doMigration=0, int startup=0);
398  void updateAtomCount(const int n, const int reallocate);
399  void updateAtomBuffers();
400 
403  // methods to implement integration
404  void saveForce(const int ftag = Results::normal);
405  void addForceToMomentum(
406  FullAtom * __restrict atom_arr,
407  const Force * __restrict force_arr,
408  const BigReal dt,
409  int num_atoms
410  )
411 #if !defined(WIN32) && !defined(WIN64)
412  __attribute__((__noinline__))
413 #endif
414  ;
415  void addForceToMomentum3(
416  FullAtom * __restrict atom_arr,
417  const Force * __restrict force_arr1,
418  const Force * __restrict force_arr2,
419  const Force * __restrict force_arr3,
420  const BigReal dt1,
421  const BigReal dt2,
422  const BigReal dt3,
423  int num_atoms
424  )
425 #if !defined(WIN32) && !defined(WIN64)
426  __attribute__((__noinline__))
427 #endif
428  ;
430  FullAtom * __restrict atom_arr,
431  const BigReal dt,
432  int num_atoms
433  )
434 #if !defined(WIN32) && !defined(WIN64)
435  __attribute__((__noinline__))
436 #endif
437  ;
438 
439  // impose hard wall constraint on Drude bond length
440  int hardWallDrude(const BigReal, Tensor *virial, SubmitReduction *);
441 
442  // methods for rigidBonds
443  struct RattleList {
444  int ig;
445  int icnt;
446  };
447 
448  std::vector<int> settleList;
449  std::vector<RattleList> rattleList;
450  std::vector<RattleParam> rattleParam;
451  std::vector<int> noconstList;
452 
455 
456  // Array to store new positions and velocities. Allocated in "buildRattleList" to size numAtoms
457  std::vector<Vector> velNew;
458  std::vector<Vector> posNew;
459 
460  void addRattleForce(const BigReal invdt, Tensor& wc);
461 
462  void buildRattleList();
463  int rattle1old(const BigReal, Tensor *virial, SubmitReduction *);
464  int rattle1(const BigReal, Tensor *virial, SubmitReduction *);
465  void rattle2(const BigReal, Tensor *virial);
466  void minimize_rattle2(const BigReal, Tensor *virial, bool forces=false);
467 
468  // SOA rattle
469  void buildRattleList_SOA();
470  int rattle1_SOA(const BigReal, Tensor *virial, SubmitReduction *);
471 
472  // methods for mollified impluse (MOLLY)
473  void mollyAverage();
474  void mollyMollify(Tensor *virial);
475 // Bool average(Vector qtilde[],const Vector q[],BigReal lambda[],const int n,const int m, const BigReal imass[], const BigReal length2[], const int ial[], const int ilb[], const Vector qji[], const BigReal tolf, const int ntrial);
476 // void mollify(Vector qtilde[],const Vector q0[],const BigReal lambda[], Vector force[],const int n, const int m, const BigReal imass[],const int ial[],const int ibl[],const Vector refab[]);
477 
478  // BEGIN LA
479  void loweAndersenVelocities();
480  void loweAndersenFinish();
481  // END LA
482 
483  void setGBISIntrinsicRadii();
484  void gbisComputeAfterP1();//calculate bornRad
485  void gbisComputeAfterP2();//calculate dHdrPrefix or self energies
486  void gbisP2Ready();
487  void gbisP3Ready();
488 
489  //LCPO
490  void setLcpoType();
491 
492  // methods for CONTRA, etc
493  void checkpoint(void);
494  void revert(void);
495 
496  void exchangeCheckpoint(int scriptTask, int &bpc);
497  void recvCheckpointReq(int task, const char *key, int replica, int pe);
500  void recvCheckpointAck();
502  struct checkpoint_t {
505  int numAtoms;
507  };
508  std::map<std::string,checkpoint_t*> checkpoints;
509 
510  // replica exchange
511  void exchangeAtoms(int scriptTask);
512  void recvExchangeReq(int req);
518 
519  // methods for QM (ExtForces replacement)
520  void replaceForces(ExtForce *f);
521 
522  void qmSwapAtoms();
523 
524  // load-balancing trigger
525  void submitLoadStats(int timestep);
526 
527  // for ComputeHomePatches
528  FullAtomList &getAtomList() { return (atom); }
529  ScaledPosition getMin() {return min;}
530  ScaledPosition getMax() {return max;}
531 
532 #ifdef NODEAWARE_PROXY_SPANNINGTREE
533  // build spanning tree for proxy nodes
534  void buildNodeAwareSpanningTree(void);
535  void setupChildrenFromProxySpanningTree();
536 #else
537  // build spanning tree for proxy nodes
538  void buildSpanningTree(void);
539 #endif
540 
543 
544  void sendSpanningTree();
545  void recvSpanningTree(int *t, int n);
546 
547 
548  void sendProxies();
549 
550 #if USE_TOPOMAP
551  int findSubroots(int dim, int* subroots, int psize, int* pidscopy);
552 #endif
553 
554  LDObjHandle ldObjHandle;
555 
556 #ifdef TIMER_COLLECTION
557  TimerSet timerSet;
558 #endif
559 protected:
560  virtual void boxClosed(int);
561 
562  // Internal Atom Migration methods and data
563  void doPairlistCheck();
564  void doGroupSizeCheck();
565  void doGroupSizeCheck_SOA();
566  void doMarginCheck();
567  void doMarginCheck_SOA();
568  void doAtomMigration();
570  int numMlBuf;
572 
573 private:
574  // Store of Atom-wise variables
575  int numSoluteAtoms;
576  int numSolventAtoms;
577  int numWaters;
578  FullAtomList sortatom;
579  FullAtomList atom;
581  ExtForce *replacementForces;
582 #if 1
583  CudaAtomList cudaAtomList;
584 #else
585  CudaAtom* cudaAtomList;
586  int sizeCudaAtomList;
587 #endif
588 
594  void sort_solvent_atoms();
595 
596  PatchDataSOA patchDataSOA;
597 
598 #if defined(NAMD_CUDA) || defined(NAMD_HIP)
599  unsigned char* soa_buffer = nullptr;
600  size_t soa_buffer_size = 0;
601 #else
602  ResizeArray<unsigned char> soa_buffer;
603 #endif
604 
610  void copy_atoms_to_SOA();
614 
618  void calculate_derived_SOA();
619 
624  void copy_forces_to_SOA();
625 
629  void copy_updates_to_AOS();
630  void copy_forces_to_AOS();
631 
635  void zero_global_forces_SOA();
636 
639  void clearAtomMap();
640 
641  // DMK - Atom Separation (water vs. non-water)
642  #if NAMD_SeparateWaters != 0
643  FullAtomList tempAtom; // A temporary array used to sort waters
644  // from non-waters in the atom array
645  void separateAtoms(); // Function to separate the atoms currently in atoms.
646  void mergeAtomList(FullAtomList &al); // Function to combine and separate
647  // the atoms in al with atoms.
648  #endif
649 
650 
651  // checkpointed state
652  FullAtomList checkpoint_atom;
653  Lattice checkpoint_lattice;
654 
655  // DMK - Atom Separation (water vs. non-water)
656  #if NAMD_SeparateWaters != 0
657  int checkpoint_numWaterAtoms;
658  #endif
659 
660 
661  // checkPairlist data
662  CompAtomList doPairlistCheck_positions;
663  Lattice doPairlistCheck_lattice;
664  BigReal doPairlistCheck_newTolerance;
665 
666  // MOLLY data
667  ResizeArray<BigReal> molly_lambda;
668 
669  // List of Proxies
670  NodeIDList proxy;
671 
672  Sequencer *sequencer;
673 
674  // Needed for initialization
675  int patchMapRead;
676  void readPatchMap();
677 
678  // Atom Migration internals
679  int allMigrationIn;
680  int migrationSuspended;
681  int patchMigrationCounter;
682  int numNeighbors;
684  MigrationInfo *mInfo[3][3][3];
685 
686 #ifdef NODEAWARE_PROXY_SPANNINGTREE
687  //the whole spanning tree for all the proxies this home patch has
688  proxyTreeNodeList ptnTree;
689  //the immediate children (recording pe ids) containing two parts:
690  //one part of them all belong to the physical node this home patch
691  // resides on; the other part of pes belong to all external nodes.
692  /* Moved to Patch.h */
693  //int *children;
694  //int numChild;
695 #else
696  NodeIDList tree; // the whole tree
697  int *child; // spanning tree of proxies - immediate children
698  int nChild;
699 #endif
700 
701  // Cached settle1 parameters
702  int settle_initialized;
703  BigReal settle_mO;
704  BigReal settle_mH;
705  BigReal settle_mOrmT; BigReal settle_mHrmT; BigReal settle_ra;
706  BigReal settle_rb; BigReal settle_rc; BigReal settle_rra;
707 
712  void redistrib_lonepair_forces(const int, Tensor *);
713 
714  // single topology force redistribution
715  void redistrib_alchpair_forces(const int);
716 
717  // PLF -- for TIP4P
718  //void redistrib_tip4p_force(Vector&, Vector&, Vector&, Vector&, int, Tensor*);
719  void redistrib_tip4p_forces(const int, Tensor*);
720  void tip4_omrepos(Vector*, Vector*, Vector*, BigReal);
721  void init_tip4();
722 
723  // Drude SWM4
724  void redistrib_swm4_forces(const int, Tensor*);
725  void swm4_omrepos(Vector*, Vector*, Vector*, BigReal);
726  void init_swm4();
727 
733  void reposition_colinear_lonepair(
734  Vector& ri, const Vector& rj, const Vector& rk, Real distance,
735  Real scale);
736 
741  void reposition_relative_lonepair(
742  Vector& ri, const Vector& rj, const Vector& rk, const Vector& rl,
743  Real distance, Real angle, Real dihedral);
744 
748  void reposition_all_lonepairs(void);
749 
750  //single topology end state reposition
751  void reposition_alchpair(Vector& ri, Vector& rj, Mass& Mi, Mass& Mj);
752  void reposition_all_alchpairs(void); //single topolofy alch
753 
757  void redistrib_colinear_lp_force(
758  Vector& fi, Vector& fj, Vector& fk,
759  const Vector& ri, const Vector& rj, const Vector& rk,
760  Real distance, Real scale, Tensor *virial);
761 
765  void redistrib_relative_lp_force(
766  Vector& fi, Vector& fj, Vector& fk, Vector& fl,
767  const Vector& ri, const Vector& rj, const Vector& rk, const Vector& rl,
768  Tensor *virial, int midpt);
769 
770  //single topology force transfer
771  void redistrib_ap_force(Vector& fi, Vector& fj);
777  void redistrib_lp_water_force(
778  Vector& f_ox, Vector& f_h1, Vector& f_h2, Vector& f_lp,
779  const Vector& p_ox, const Vector& p_h1, const Vector& p_h2,
780  const Vector& p_lp, Tensor *virial);
781 
782  BigReal r_om, r_ohc;
783  void write_tip4_props(void);
784 
785  int isProxyChanged;
786 
787 #if CMK_PERSISTENT_COMM
788  PersistentHandle *localphs;
789  int nphs;
790 #endif
791 };
792 
793 #endif
794 
void doMarginCheck_SOA()
Definition: HomePatch.C:5633
void depositMigration(MigrateAtomsMsg *)
Definition: HomePatch.C:5956
void recvCheckpointLoad(CheckpointAtomsMsg *msg)
Definition: HomePatch.C:5295
void sendProxies()
Definition: HomePatch.C:509
ScaledPosition getMin()
Definition: HomePatch.h:529
void runSequencer(void)
Definition: HomePatch.C:305
void minimize_rattle2(const BigReal, Tensor *virial, bool forces=false)
Definition: HomePatch.C:4378
void positionsReady_SOA(int doMigration=0)
Definition: HomePatch.C:971
void registerProxy(RegisterProxyMsg *)
Definition: HomePatch.C:443
void updateAtomBuffers()
int marginViolations
Definition: HomePatch.h:401
int exchange_dst
Definition: HomePatch.h:514
Definition: Vector.h:72
void addForceToMomentum(FullAtom *__restrict atom_arr, const Force *__restrict force_arr, const BigReal dt, int num_atoms) __attribute__((__noinline__))
Definition: HomePatch.C:3315
int rattle1(const BigReal, Tensor *virial, SubmitReduction *)
Definition: HomePatch.C:3784
void rattle2(const BigReal, Tensor *virial)
Definition: HomePatch.C:4245
void recvNodeAwareSpanningTree(ProxyNodeAwareSpanningTreeMsg *msg)
Definition: HomePatch.C:671
float Real
Definition: common.h:118
void gbisComputeAfterP2()
Definition: HomePatch.C:4937
void receiveResults(ProxyResultVarsizeMsg *msg)
Definition: HomePatch.C:837
ExchangeAtomsMsg * exchange_msg
Definition: HomePatch.h:517
virtual void boxClosed(int)
Definition: HomePatch.C:370
int inMigration
Definition: HomePatch.h:569
void doGroupSizeCheck()
Definition: HomePatch.C:5584
void loweAndersenVelocities()
Definition: HomePatch.C:4860
void recvCheckpointReq(int task, const char *key, int replica, int pe)
Definition: HomePatch.C:5265
void exchangeCheckpoint(int scriptTask, int &bpc)
Definition: HomePatch.C:5257
void PatchDataSOA_initialize(PatchDataSOA *p)
Definition: HomePatch.C:2366
LDObjHandle ldObjHandle
Definition: HomePatch.h:554
void gbisP3Ready()
Definition: HomePatch.C:5001
bool rattleListValid
Definition: HomePatch.h:453
void positionsReady(int doMigration=0)
Definition: HomePatch.C:1895
void recvCheckpointAck()
Definition: HomePatch.C:5359
std::vector< RattleList > rattleList
Definition: HomePatch.h:449
bool gridForceIdxChecked
Definition: HomePatch.h:402
Definition: Patch.h:35
void revert(void)
Definition: HomePatch.C:5226
size_t PatchDataSOA_set_size(PatchDataSOA *p, int natoms, int pad=MAXFACTOR)
Definition: HomePatch.C:2373
void doGroupSizeCheck_SOA()
Definition: HomePatch.C:5531
void positionsReady_GPU(int doMigration=0, int startup=0)
int rattle1_SOA(const BigReal, Tensor *virial, SubmitReduction *)
Definition: HomePatch.C:4653
void updateAtomCount(const int n, const int reallocate)
FullAtomList & getAtomList()
Definition: HomePatch.h:528
void qmSwapAtoms()
Definition: HomePatch.C:907
void unregisterProxy(UnregisterProxyMsg *)
Definition: HomePatch.C:457
ResizeArray< FullAtom > atoms
Definition: HomePatch.h:506
std::map< std::string, checkpoint_t * > checkpoints
Definition: HomePatch.h:508
void submitLoadStats(int timestep)
Definition: HomePatch.C:5422
void mollyMollify(Tensor *virial)
Definition: HomePatch.C:5153
int rattle1old(const BigReal, Tensor *virial, SubmitReduction *)
Definition: HomePatch.C:3975
~HomePatch()
Definition: HomePatch.C:357
int Bool
Definition: common.h:142
void buildRattleList()
Definition: HomePatch.C:3612
void recvSpanningTree(int *t, int n)
Definition: HomePatch.C:677
ScaledPosition getMax()
Definition: HomePatch.h:530
void replaceForces(ExtForce *f)
Definition: HomePatch.C:2310
std::vector< int > settleList
Definition: HomePatch.h:448
void gbisComputeAfterP1()
Definition: HomePatch.C:4909
void sendNodeAwareSpanningTree()
Definition: HomePatch.C:672
void setLcpoType()
Definition: HomePatch.C:4883
int exchange_req
Definition: HomePatch.h:516
void doPairlistCheck()
Definition: HomePatch.C:5432
void doAtomMigration()
Definition: HomePatch.C:5792
MigrateAtomsMsg * msgbuf[PatchMap::MaxOneAway]
Definition: HomePatch.h:571
int hardWallDrude(const BigReal, Tensor *virial, SubmitReduction *)
Definition: HomePatch.C:3406
void setGBISIntrinsicRadii()
Definition: HomePatch.C:4894
void saveForce(const int ftag=Results::normal)
Definition: HomePatch.C:2315
std::vector< Vector > posNew
Definition: HomePatch.h:458
void buildRattleList_SOA()
Definition: HomePatch.C:4516
int exchange_src
Definition: HomePatch.h:515
void gbisP2Ready()
Definition: HomePatch.C:4981
void sendSpanningTree()
Definition: HomePatch.C:700
void checkpoint(void)
Definition: HomePatch.C:5216
std::vector< RattleParam > rattleParam
Definition: HomePatch.h:450
friend class SequencerCUDA
Definition: HomePatch.h:334
Definition: Tensor.h:15
void mollyAverage()
Definition: HomePatch.C:5079
bool rattleListValid_SOA
Definition: HomePatch.h:454
void PatchDataSOA_set_buffer(PatchDataSOA *p, void *mybuffer)
Definition: HomePatch.C:2393
pad length of arrays up to this next multiple
Definition: HomePatch.h:297
void recvExchangeReq(int req)
Definition: HomePatch.C:5385
void buildSpanningTree(void)
Definition: HomePatch.C:715
int checkpoint_task
Definition: HomePatch.h:501
float Mass
Definition: ComputeGBIS.inl:20
std::vector< Vector > velNew
Definition: HomePatch.h:457
void receiveResult(ProxyGBISP1ResultMsg *msg)
Definition: HomePatch.C:5024
void addForceToMomentum3(FullAtom *__restrict atom_arr, const Force *__restrict force_arr1, const Force *__restrict force_arr2, const Force *__restrict force_arr3, const BigReal dt1, const BigReal dt2, const BigReal dt3, int num_atoms) __attribute__((__noinline__))
Definition: HomePatch.C:3344
void addVelocityToPosition(FullAtom *__restrict atom_arr, const BigReal dt, int num_atoms) __attribute__((__noinline__))
Definition: HomePatch.C:3383
std::vector< int > noconstList
Definition: HomePatch.h:451
ForceList f[Results::maxNumForces]
Definition: Patch.h:214
void loweAndersenFinish()
Definition: HomePatch.C:4875
void pad(char *s, int len)
Definition: dcdlib.C:105
void addRattleForce(const BigReal invdt, Tensor &wc)
Definition: HomePatch.C:3774
int32 PatchID
Definition: NamdTypes.h:277
int numMlBuf
Definition: HomePatch.h:570
void useSequencer(Sequencer *sequencerPtr)
Definition: HomePatch.C:301
void doMarginCheck()
Definition: HomePatch.C:5715
void recvCheckpointStore(CheckpointAtomsMsg *msg)
Definition: HomePatch.C:5345
void recvExchangeMsg(ExchangeAtomsMsg *msg)
Definition: HomePatch.C:5396
double BigReal
Definition: common.h:123
void exchangeAtoms(int scriptTask)
Definition: HomePatch.C:5364