NAMD
GlobalMasterServer.C
Go to the documentation of this file.
1 
7 /*
8  Forwards atoms to master node for force evaluation.
9 */
10 
11 #include "ComputeGlobalMsgs.h"
12 #include "ComputeMgr.h"
13 #include "NamdTypes.h"
14 #include "InfoStream.h"
15 #include "Node.h"
16 #include "SimParameters.h"
17 #include "Molecule.h"
18 #include "PatchMap.h"
19 //#define DEBUGM
20 #define MIN_DEBUG_LEVEL 1
21 #include "Debug.h"
22 #include <stdlib.h>
23 #include <vector>
24 #include <algorithm>
25 
26 using namespace std;
28  int atomID;
29  int index;
30 };
32  DebugM(3,"Adding client\n");
33  clientList.add(newClient);
34  newClient->setLattice(&lattice);
35  DebugM(2,"Added.\n");
36 }
37 
39  DebugM(3,"Storing data (" << msg->aid.size() << " positions) on master\n");
40 
41  if ( msg->step != -1 ) step = msg->step;
42 
43  /* get the beginning and end of the lists */
44  AtomIDList::iterator a_i = msg->aid.begin();
45  AtomIDList::iterator a_e = msg->aid.end();
46  PositionList::iterator p_i = msg->p.begin();
47  PositionList::iterator g_i = msg->gcom.begin();
48  PositionList::iterator g_e = msg->gcom.end();
49  BigRealList::iterator gm_i = msg->gmass.begin();
50 
51  /* iterate over each member of the atom lists */
52  for ( ; a_i != a_e; ++a_i, ++p_i ) {
53  receivedAtomIDs.add(*a_i);
54  receivedAtomPositions.add(*p_i);
55  }
56 
57  /* iterate over each member of "total force" lists */
58  a_e = msg->fid.end();
59  ForceList::iterator f_i=msg->tf.begin();
60  for (a_i=msg->fid.begin() ; a_i!=a_e; ++a_i,++f_i) {
61  receivedForceIDs.add(*a_i);
62  receivedTotalForces.add(*f_i);
63  }
64 
65  /* iterate over each member of the group position list */
66  int i=0;
67  for ( ; g_i != g_e; ++g_i, ++gm_i ) {
68  DebugM(1,"Received center of mass "<<*g_i<<"\n");
69  if(i >= totalGroupsRequested) NAMD_bug("Received too many groups.");
70  receivedGroupPositions[i] += (*g_i);
71  receivedGroupMasses[i] += (*gm_i);
72  i++;
73  }
74  if(i!=totalGroupsRequested) NAMD_bug("Received too few groups.");
75 
76  /* iterate over each member of group total force lists */
77  int ntf = msg->gtf.size();
78  if ( ntf && ntf != receivedGroupTotalForces.size() ) NAMD_bug("Received wrong number of group forces.");
79  ForceList::iterator gf_i=msg->gtf.begin();
80  ForceList::iterator gf_e=msg->gtf.end();
81  for ( i=0 ; gf_i != gf_e; ++gf_i, ++i ) {
82  receivedGroupTotalForces[i] += (*gf_i);
83  }
84 
85  // Get values of the GridForce objects
86  int ngov = msg->gridobjvalue.size();
87  IntList::iterator goi_i = msg->gridobjindex.begin();
89  BigRealList::iterator gov_e = msg->gridobjvalue.end();
90  for ( i=0 ; gov_i != gov_e; gov_i++, goi_i++, i++ ) {
91  receivedGridObjIndices[i] = (*goi_i);
92  receivedGridObjValues[i] += (*gov_i);
93  }
94  if (ngov && ngov != receivedGridObjValues.size()) {
95  NAMD_bug("Received wrong number of grid objects.");
96  }
97 
98  if ( msg->lat.size() ) {
99  if ( latticeCount ) {
100  NAMD_bug("GlobalMasterServer::recvData received lattice twice.");
101  }
102  lattice = msg->lat[0];
103  latticeCount = 1;
104  }
105 
106  recvCount += msg->count;
107  recvPatchesCount += msg->patchcount;
109 
110  /* done with the message, delete it */
111  delete msg;
112 
113  /* check whether we've gotten all the expected messages */
114 
115  DebugM(3, "received " << recvCount << " atom messages and "
116  << recvPatchesCount << " patch messages (out of " << numPatches
117  << " patches) from the ComputeGlobals\n" << endi);
118 
119  int numNeededPatches = totalGridObjsRequested ? numPatches : 0;
120  if (firstTime) numNeededPatches = 0;
121 
122  if (recvCount > numDataSenders + numForceSenders + 1) {
123  NAMD_bug("GlobalMasterServer::recvData recvCount too high.");
124  }
125 
126  if (recvPatchesCount > numPatches) {
127  NAMD_bug("GlobalMasterServer::recvData too many patches received.");
128  }
129 
130  if ((recvCount == numDataSenders + numForceSenders + 1) &&
131  (recvPatchesCount == numNeededPatches)) {
132 
133  if ( ! latticeCount ) {
134  NAMD_bug("GlobalMasterServer::recvData did not receive lattice.");
135  }
136 
137  DebugM(3, "Received all needed data\n" << endi);
138 
139 #ifdef DEBUGM
140  for (size_t ig = 0; ig < receivedGroupMasses.size(); ig++) {
141  // The groups' positions will be normalized later, in callClients()
142  DebugM(3, "Group mass " << ig << " = "
143  << receivedGroupMasses[ig] << "\n" << endi);
144  }
145  for (size_t ig = 0; ig < receivedGridObjValues.size(); ig++) {
146  DebugM(3, "Grid object " << receivedGridObjIndices[ig] << " = "
147  << receivedGridObjValues[ig] << "\n" << endi);
148  }
149 #endif
150 
151  int oldTotalGroupsRequested = totalGroupsRequested;
152 
153  int resendCoordinates = callClients();
154 
155  if (resendCoordinates) {
156  DebugM(3, "resendCoordinates\n" << endi);
157  }
158 
159  /* now restart */
160  step = -1;
161  receivedAtomIDs.resize(0);
162  receivedAtomPositions.resize(0);
163  receivedGroupPositions.resize(totalGroupsRequested);
164  receivedGroupPositions.setall(Vector(0,0,0));
165  receivedGroupMasses.resize(totalGroupsRequested);
166  receivedGroupMasses.setall(0);
167  receivedGridObjIndices.resize(totalGridObjsRequested);
168  receivedGridObjIndices.setall(-1);
169  receivedGridObjValues.resize(totalGridObjsRequested);
170  receivedGridObjValues.setall(0);
171  latticeCount = 0;
172  recvCount = 0;
173  recvPatchesCount = 0;
174  if ( resendCoordinates ) {
175  recvCount += numForceSenders;
176  } else {
177  receivedGroupTotalForces.resize(totalGroupsRequested);
178  receivedGroupTotalForces.setall(0);
179  receivedForceIDs.resize(0);
180  receivedTotalForces.resize(0);
181  }
182  }
183 }
184 
185 void GlobalMasterServer::resetAtomList(AtomIDList &atomsRequested) {
186  atomsRequested.resize(0);
187 
188  /* iterate over all of the masters */
189  GlobalMaster **m_i = clientList.begin();
190  GlobalMaster **m_e = clientList.end();
191  while(m_i != m_e) {
192  /* add all of the atoms in this master */
193  int i;
194  for(i=0;i<(*m_i)->requestedAtoms().size();i++) {
195  atomsRequested.add((*m_i)->requestedAtoms()[i]);
196  }
197 
198  /* go to next master */
199  m_i++;
200  }
201 
202  /* remove duplicates */
203  sort(atomsRequested.begin(), atomsRequested.end());
204  AtomIDList::iterator it = unique(atomsRequested.begin(), atomsRequested.end());
205  atomsRequested.resize( distance(atomsRequested.begin(), it) );
206 }
207 
208 void GlobalMasterServer::resetGroupList(AtomIDList &groupsRequested,
209  int *numGroups) {
210  DebugM(3,"Rebuilding the group list\n");
211  groupsRequested.resize(0);
212  *numGroups = 0;
213 
214  /* iterate over all of the masters */
215  GlobalMaster **m_i = clientList.begin();
216  GlobalMaster **m_e = clientList.end();
217  while(m_i != m_e) {
218 
219  /* add all of the groups requested by this master */
220  int i;
221  GlobalMaster *master = *m_i;
222  for(i=0;i<master->requestedGroups().size();i++) {
223  /* add all of the atoms in this group, then add a -1 */
224  int j;
225  const AtomIDList &atoms_in_group = master->requestedGroups()[i];
226  (*numGroups) ++;
227  DebugM(1,"adding group "<<*numGroups<<"\n");
228  for(j=0;j<atoms_in_group.size();j++) {
229  groupsRequested.add(atoms_in_group[j]); // add an atom
230  }
231  DebugM(1,"here\n");
232  groupsRequested.add(-1); // add a -1 to separate the groups (yuck)
233  }
234 
235  /* go to next master */
236  m_i++;
237  }
238 }
239 
240 void GlobalMasterServer::resetForceList(AtomIDList &atomsForced,
241  ForceList &forces,
242  ForceList &groupForces) {
243  DebugM(1,"Restting forces\n");
244  atomsForced.resize(0);
245  forces.resize(0);
246  groupForces.resize(0);
247  lastAtomsForced.resize(0);
248  lastForces.resize(0);
249 
250  /* iterate over all of the masters */
251  GlobalMaster **m_i = clientList.begin();
252  GlobalMaster **m_e = clientList.end();
253  while(m_i != m_e) {
254  (*m_i)->check(); // just in case!
255 
256  /* add all of the atoms in this master */
257  int i;
258  DebugM(1,"Adding atom forces\n");
259  for(i=0;i<(*m_i)->forcedAtoms().size();i++) {
260  atomsForced.add((*m_i)->forcedAtoms()[i]);
261  forces.add((*m_i)->appliedForces()[i]);
262  lastAtomsForced.add((*m_i)->forcedAtoms()[i]);
263  lastForces.add((*m_i)->appliedForces()[i]);
264  }
265 
266  /* add all of the group forces for this master */
267  DebugM(1,"Adding "<<(*m_i)->requestedGroups().size()<<" group forces\n");
268  for(i=0;i<(*m_i)->groupForces().size();i++) {
269  groupForces.add((*m_i)->groupForces()[i]);
270  }
271 
272  /* go to next master */
273  DebugM(1,"Next master...\n");
274  m_i++;
275  }
276  DebugM(1,"Done restting forces\n");
277 }
278 
279 void GlobalMasterServer::resetGridObjList(IntList &gridObjsRequested) {
280  gridObjsRequested.resize(0);
281 
282  for (GlobalMaster **m_i = clientList.begin(); m_i != clientList.end();
283  m_i++) {
284  // add all of the grids requested by this master
285  GlobalMaster *master = *m_i;
286  for (size_t i = 0; i < master->requestedGridObjs().size(); i++) {
287  gridObjsRequested.add(master->requestedGridObjs()[i]);
288  }
289  }
290 
291  // remove duplicates
292  sort(gridObjsRequested.begin(), gridObjsRequested.end());
293  IntList::iterator it = unique(gridObjsRequested.begin(), gridObjsRequested.end());
294  gridObjsRequested.resize( distance(gridObjsRequested.begin(), it) );
295  totalGridObjsRequested = gridObjsRequested.size();
296 }
297 
298 void GlobalMasterServer::resetGridObjForceList(BigRealList &gridObjForces)
299 {
300  gridObjForces.resize(totalGridObjsRequested);
301  gridObjForces.setall(0.0);
302 
303  GlobalMaster **m_i = clientList.begin();
304  GlobalMaster **m_e = clientList.end();
305  bool have_forces = false;
306  while (m_i != m_e) {
307  size_t i;
308  GlobalMaster *master = *m_i;
309  for(i = 0; i < master->gridObjForces().size(); i++) {
310  have_forces = true;
311  gridObjForces[i] += master->gridObjForces()[i];
312  }
313  m_i++;
314  }
315  if (!have_forces) {
316  gridObjForces.resize(0);
317  }
318 }
319 
320 struct atomID_less {
321  bool operator ()(position_index const& a, position_index const& b) const {
322  if (a.atomID < b.atomID) return true;
323  if (a.atomID > b.atomID) return false;
324 
325  return false;
326 }
327 };
328 
329 int GlobalMasterServer::callClients() {
330  DebugM(3,"Calling clients\n");
331  bool forceSendActive = false;
332  {
333  GlobalMaster **m_i = clientList.begin();
334  GlobalMaster **m_e = clientList.end();
335  for ( ; m_i != m_e; ++m_i ) {
336  if ( (*m_i)->changedAtoms() ) firstTime = 1;
337  if ( (*m_i)->changedGroups() ) firstTime = 1;
338  if ( (*m_i)->requestedTotalForces() ) forceSendActive = true;
339  (*m_i)->clearChanged();
340  }
341  }
342 
343  if(firstTime) {
344 
345  /* the first time we just get the requested atom ids from the
346  clients and send messages to the compute globals requesting
347  those atoms, so they can have coordinates for the first time
348  step. */
349  DebugM(1,"first time.\n");
351  resetAtomList(msg->newaid); // add any atom IDs made in constructors
352  // resetForceList(msg->aid,msg->f,msg->gforce); // same for forces
353  resetGroupList(msg->newgdef,&totalGroupsRequested);
354  msg->resendCoordinates = 1;
355  msg->reconfig = 1;
356  msg->totalforces = forceSendActive;
357  totalAtomsRequested = msg->newaid.size(); // record the atom total
358 
359  numDataSenders = totalAtomsRequested;
360  AtomIDList::iterator g_i = msg->newgdef.begin();
361  AtomIDList::iterator g_e = msg->newgdef.end();
362  Molecule *mol = Node::Object()->molecule;
363  for ( ; g_i != g_e; ++g_i ) {
364  if ( *g_i != -1 ) {
365  if (mol->atommass(*g_i) <= 0.001) {
366  iout << iWARN << "Atom " << (*g_i+1) << " has a near-zero mass, "
367  << "but it was requested for center-of-mass calculation.\n"
368  << endi;
369  }
370  ++numDataSenders;
371  }
372  }
373 
374  resetGridObjList(msg->newgridobjid);
375 
376  DebugM(3,"Sending configure ("<<totalAtomsRequested<<" atoms, "
377  <<totalGroupsRequested<<" groups, " << totalGridObjsRequested << " grids)\n");
378  myComputeManager->sendComputeGlobalResults(msg);
379 
380  firstTime = 0;
381  return 1;
382  }
383 
384  /* check to make sure we've got everything */
385  if(receivedAtomIDs.size() != totalAtomsRequested) {
386  DebugM(3,"Requested " << totalAtomsRequested << " atoms.\n");
387  NAMD_bug("Got the wrong number of atoms");
388  }
389  if(receivedGroupPositions.size() != totalGroupsRequested) {
390  DebugM(3,"Requested " << totalGroupsRequested << " groups.\n");
391  DebugM(3,"Got " << receivedGroupPositions.size() << " group positions.\n");
392  NAMD_bug("Got the wrong number of groups");
393  }
394  if(receivedGroupMasses.size() != totalGroupsRequested) {
395  DebugM(3,"Requested " << totalGroupsRequested << " groups.\n");
396  DebugM(3,"Got " << receivedGroupMasses.size() << " group masses.\n");
397  NAMD_bug("Got the wrong number of group masses");
398  }
399  if(receivedGridObjValues.size() != totalGridObjsRequested) {
400  DebugM(3,"Requested " << totalGridObjsRequested << " grid objects.\n");
401  DebugM(3,"Got " << receivedGridObjValues.size() << " grid object values.\n");
402  NAMD_bug("Got the wrong number of grid object values");
403  }
404 
405  /* get the beginning and end of the lists */
406  AtomIDList::iterator a_i = receivedAtomIDs.begin();
407  AtomIDList::iterator a_e = receivedAtomIDs.end();
408  PositionList::iterator p_i = receivedAtomPositions.begin();
409  PositionList::iterator g_i = receivedGroupPositions.begin();
410  PositionList::iterator g_e = receivedGroupPositions.end();
411  ForceList::iterator gtf_i = receivedGroupTotalForces.begin();
412  ForceList::iterator gtf_e = receivedGroupTotalForces.end();
413  IntList::iterator goi_i = receivedGridObjIndices.begin();
414  IntList::iterator goi_e = receivedGridObjIndices.end();
415  BigRealList::iterator gov_i = receivedGridObjValues.begin();
416  BigRealList::iterator gov_e = receivedGridObjValues.end();
417  AtomIDList::iterator forced_atoms_i = lastAtomsForced.begin();
418  AtomIDList::iterator forced_atoms_e = lastAtomsForced.end();
419  ForceList::iterator forces_i = lastForces.begin();
420  GlobalMaster **m_i = clientList.begin();
421  GlobalMaster **m_e = clientList.end();
422  AtomIDList::iterator f_i = receivedForceIDs.begin();
423  AtomIDList::iterator f_e = receivedForceIDs.end();
424 
425  /* renormalize group center of mass by group total mass */
426  ResizeArray<BigReal>::iterator gm_i = receivedGroupMasses.begin();
427  for ( ; g_i < g_e; ++g_i, ++gm_i ) { *g_i /= *gm_i; }
428  g_i = receivedGroupPositions.begin();
429  gm_i = receivedGroupMasses.begin();
430 
431  /* use these to check whether anything has changed for any master */
432  bool requested_atoms_changed=false;
433  bool requested_forces_changed=false;
434  bool requested_groups_changed=false;
435  bool requested_grids_changed=false;
436  forceSendActive = false;
437 
438  vector <position_index> positions;
439  for (int j = 0; a_i != a_e; ++a_i, ++j) {
440  position_index temp;
441  temp.atomID = *a_i;
442  temp.index = j;
443  positions.push_back(temp);
444  }
445  sort(positions.begin(), positions.end(), atomID_less());
446 
447  /* call each of the masters with the coordinates */
448  while(m_i != m_e) {
449  int num_atoms_requested, num_groups_requested, num_gridobjs_requested;
450 
451  /* get the masters information */
452  GlobalMaster *master = *m_i;
453  num_atoms_requested = master->requestedAtoms().size();
454  num_groups_requested = master->requestedGroups().size();
455  num_gridobjs_requested = master->requestedGridObjs().size();
456 
457  AtomIDList clientAtomIDs;
458  PositionList clientAtomPositions;
459  AtomIDList clientReceivedForceIDs;
460  ForceList clientReceivedTotalForces;
461 
462  if (num_atoms_requested) {
463  vector <int> rqAtoms;
464  for (int i = 0; i < master->requestedAtoms().size(); i++){
465  rqAtoms.push_back(master->requestedAtoms()[i]);
466  }
467  sort(rqAtoms.begin(), rqAtoms.end());
468  int j = 0;
469  for (int i = 0; i < positions.size(); i++){
470  if (positions[i].atomID == rqAtoms[j]){
471  clientAtomPositions.add(receivedAtomPositions[positions[i].index]);
472  clientAtomIDs.add(rqAtoms[j]);
473  --i; // rqAtoms may contain repeats
474  if ( ++j == num_atoms_requested ) break;
475  }
476  }
477  if ( j != num_atoms_requested ) NAMD_bug(
478  "GlobalMasterServer::callClients() did not find all requested atoms");
479  }
480 
481  AtomIDList::iterator ma_i = clientAtomIDs.begin();
482  AtomIDList::iterator ma_e = clientAtomIDs.end();
483  PositionList::iterator mp_i = clientAtomPositions.begin();
484  AtomIDList::iterator mf_i = clientReceivedForceIDs.begin();
485  AtomIDList::iterator mf_e = clientReceivedForceIDs.end();
486  ForceList::iterator mtf_i = clientReceivedTotalForces.begin();
487 
488  /* check to make sure we have some atoms left. This must work for
489  zero requested atoms, as well! */
490  // if(a_i+num_atoms_requested > a_e)
491  // NAMD_bug("GlobalMasterServer ran out of atom IDs!");
492 
493  /* update this master */
494  master->step = step;
495  master->processData(ma_i,ma_e,
496  mp_i,g_i,g_i+num_groups_requested,
497  gm_i,gm_i+num_groups_requested,
498  gtf_i,gtf_i+(numForceSenders?master->old_num_groups_requested:0),
499  goi_i, goi_e, gov_i, gov_e,
500  forced_atoms_i,forced_atoms_e,forces_i,
501  receivedForceIDs.begin(),receivedForceIDs.end(),receivedTotalForces.begin());
502 
503  a_i = receivedAtomIDs.begin();
504  p_i = receivedAtomPositions.begin();
505 //}
506 
507  /* check to see if anything changed */
508  if(master->changedAtoms()) {
509  requested_atoms_changed = true;
510  }
511  if(master->changedForces()) {
512  requested_forces_changed = true;
513  }
514  if(master->changedGroups()) {
515  requested_groups_changed = true;
516  }
517  if(master->changedGridObjs()) {
518  requested_grids_changed = true;
519  }
520  master->clearChanged();
521  if(master->requestedTotalForces()) forceSendActive = true;
522 
523  /* go to next master */
524  m_i++;
525 
526  g_i += num_groups_requested;
527  gm_i += num_groups_requested;
528  if ( numForceSenders ) gtf_i += master->old_num_groups_requested;
529  master->old_num_groups_requested = master->requestedGroups().size(); // include changes
530  }
531 
532  if ( numForceSenders && gtf_i != gtf_e ) NAMD_bug("GlobalMasterServer::callClients bad group total force count");
533 
534  /* make a new message */
536 
537  /* build an atom list, if necessary */
538  if(requested_atoms_changed || requested_groups_changed || requested_grids_changed) {
539  resetAtomList(msg->newaid); // add all of the atom IDs
540  totalAtomsRequested = msg->newaid.size();
541  msg->reconfig = 1; // request a reconfig
542  resetGroupList(msg->newgdef,&totalGroupsRequested); // add all of the group IDs
543  numDataSenders = totalAtomsRequested;
544  AtomIDList::iterator g_i = msg->newgdef.begin();
545  AtomIDList::iterator g_e = msg->newgdef.end();
546  Molecule *mol = Node::Object()->molecule;
547  for ( ; g_i != g_e; ++g_i ) {
548  if ( *g_i != -1 ) {
549  if (mol->atommass(*g_i) <= 0.001) {
550  iout << iWARN << "Atom " << (*g_i+1) << " has a near-zero mass, "
551  << "but it was requested for center-of-mass calculation.\n"
552  << endi;
553  }
554  ++numDataSenders;
555  }
556  }
557  resetGridObjList(msg->newgridobjid);
558  }
559 
560  msg->totalforces = forceSendActive;
561  numForceSenders = (forceSendActive ? numDataSenders : 0);
562  resetForceList(msg->aid,msg->f,msg->gforce); // could this be more efficient?
563  resetGridObjForceList(msg->gridobjforce); // ain't touching the one above...
564 
565  /* get group acceleration by renormalizing group net force by group total mass */
566  ForceList::iterator gf_i = msg->gforce.begin();
567  ForceList::iterator gf_e = msg->gforce.end();
568  gm_i = receivedGroupMasses.begin();
569  for ( ; gf_i < gf_e; ++gf_i, ++gm_i ) { *gf_i /= *gm_i; }
570 
571  /* now send the results */
572  DebugM(3,"Sending results ("<<totalAtomsRequested<<" atoms requested, "
573  <<totalGroupsRequested<<" groups requested, "
574  <<msg->f.size()<<" forces set)\n");
575  myComputeManager->sendComputeGlobalResults(msg);
576  DebugM(3,"Sent.\n");
577  return 0;
578 }
579 
581  int theNumDataSenders) {
582  DebugM(3,"Constructing GlobalMasterServer\n");
583  myComputeManager = m;
584  numDataSenders = 0; // theNumDataSenders;
585  numForceSenders = 0;
586  latticeCount = 0;
587  lattice = Node::Object()->simParameters->lattice;
588  recvCount = 0; /* we haven't gotten any messages yet */
589  recvPatchesCount = 0;
590  firstTime = 1; /* XXX temporary */
591  step = -1;
592  totalAtomsRequested = 0;
593  totalGroupsRequested = 0;
594  forceSendEnabled = 0;
595  if ( Node::Object()->simParameters->tclForcesOn ) forceSendEnabled = 1;
596  if ( Node::Object()->simParameters->colvarsOn ) forceSendEnabled = 1;
597  DebugM(3,"done constructing\n");
598 }
599 
601  GlobalMaster *m_i = *clientList.begin();
602  GlobalMaster *m_e = *clientList.end();
603 
604  /* delete each of the masters */
605  while(m_i != m_e) {
606  delete m_i;
607  m_i++;
608  }
609 }
610 
611 
612 
static Node * Object()
Definition: Node.h:86
int old_num_groups_requested
Definition: GlobalMaster.h:56
static PatchMap * Object()
Definition: PatchMap.h:27
BigRealList gridobjvalue
Partial values of the GridForce objects from this message.
Definition: Vector.h:64
SimParameters * simParameters
Definition: Node.h:178
static __thread float4 * forces
bool changedAtoms()
Definition: GlobalMaster.C:107
#define DebugM(x, y)
Definition: Debug.h:59
bool requestedTotalForces()
Definition: GlobalMaster.h:69
std::ostream & iWARN(std::ostream &s)
Definition: InfoStream.C:108
#define iout
Definition: InfoStream.h:87
const ResizeArray< AtomIDList > & requestedGroups()
Definition: GlobalMaster.C:149
void processData(AtomIDList::iterator a_i, AtomIDList::iterator a_e, PositionList::iterator p_i, PositionList::iterator g_i, PositionList::iterator g_e, BigRealList::iterator gm_i, BigRealList::iterator gm_e, ForceList::iterator gtf_i, ForceList::iterator gtf_e, IntList::iterator goi_i, IntList::iterator goi_e, BigRealList::iterator gov_i, BigRealList::iterator gov_e, AtomIDList::iterator last_atoms_forced_i, AtomIDList::iterator last_atoms_forced_e, ForceList::iterator last_forces_i, AtomIDList::iterator, AtomIDList::iterator, ForceList::iterator)
Definition: GlobalMaster.C:16
void setLattice(const Lattice *lat)
Definition: GlobalMaster.h:77
bool changedForces()
Definition: GlobalMaster.C:111
bool changedGridObjs()
Definition: GlobalMaster.C:119
void NAMD_bug(const char *err_msg)
Definition: common.C:123
iterator end(void)
Definition: ResizeArray.h:37
ResizeArray< Lattice > lat
IntList gridobjindex
Indices of the GridForce objects contained in this message.
void setall(const Elem &elem)
Definition: ResizeArray.h:90
bool changedGroups()
Definition: GlobalMaster.C:115
__global__ void const int const TileList *__restrict__ TileExcl *__restrict__ const int *__restrict__ const int const float2 *__restrict__ cudaTextureObject_t const int *__restrict__ const float3 const float3 const float3 const float4 *__restrict__ const float cudaTextureObject_t cudaTextureObject_t float const PatchPairRecord *__restrict__ const int *__restrict__ const int2 *__restrict__ const unsigned int *__restrict__ unsigned int *__restrict__ int *__restrict__ int *__restrict__ TileListStat *__restrict__ const BoundingBox *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ float *__restrict__ const int numPatches
void recvData(ComputeGlobalDataMsg *)
int add(const Elem &elem)
Definition: ResizeArray.h:97
void addClient(GlobalMaster *newClient)
BlockRadixSort::TempStorage sort
int numPatches(void) const
Definition: PatchMap.h:59
void resize(int i)
Definition: ResizeArray.h:84
void check() const
Definition: GlobalMaster.C:63
const BigRealList & gridObjForces()
Definition: GlobalMaster.C:145
int count
Numer of atoms processed for this message.
void clearChanged()
Definition: GlobalMaster.C:73
Real atommass(int anum) const
Definition: Molecule.h:1038
int size(void) const
Definition: ResizeArray.h:127
infostream & endi(infostream &s)
Definition: InfoStream.C:38
GlobalMasterServer(ComputeMgr *m, int theNumDataSenders)
const IntList & requestedGridObjs()
Definition: GlobalMaster.C:153
int patchcount
Number of patches processed for this message.
Molecule * molecule
Definition: Node.h:176
iterator begin(void)
Definition: ResizeArray.h:36
const AtomIDList & requestedAtoms()
Definition: GlobalMaster.C:123