Simpatico  v1.10
GroupDistributor.h
1 #ifndef DDMD_GROUP_DISTRIBUTOR_H
2 #define DDMD_GROUP_DISTRIBUTOR_H
3 
4 /*
5 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <util/param/ParamComposite.h> // base class
12 #include <ddMd/chemistry/Group.h> // member
13 #include <ddMd/communicate/Buffer.h> // member data type
14 #include <util/containers/DArray.h> // member
15 
16 namespace DdMd
17 {
18 
19  class Domain;
20  class AtomStorage;
21  template <int N> class GroupStorage;
22 
23  using namespace Util;
24 
90  template <int N>
92  {
93 
94  public:
95 
100 
104  ~GroupDistributor();
105 
114  void associate(Domain& domain,
115  AtomStorage& atomStorage,
116  GroupStorage<N>& groupStorage,
117  Buffer& buffer);
118 
122  void setup();
123 
132  void setCapacity(int cacheCapacity);
133 
146  virtual void readParameters(std::istream& in);
147 
158  Group<N>* newPtr();
159 
166  void add();
167 
174  void send();
175 
181  void receive();
182 
183  protected:
184 
191  void allocate();
192 
193  private:
194 
197  DArray< Group<N> > cache_;
198 
200  Group<N>* newPtr_;
201 
203  Domain* domainPtr_;
204 
206  AtomStorage* atomStoragePtr_;
207 
209  GroupStorage<N>* groupStoragePtr_;
210 
212  Buffer* bufferPtr_;
213 
215  enum Buffer::BlockDataType sendType_;
216 
218  int nAtomRecv_;
219 
221  int nSentTotal_;
222 
224  int cacheCapacity_;
225 
227  int cacheSize_;
228 
232  void validate();
233 
234  };
235 
236 }
237 #endif
Parallel domain decomposition (DD) MD simulation.
void send(MPI::Comm &comm, T &data, int dest, int tag)
Send a single T value.
Definition: MpiSendRecv.h:97
BlockDataType
Enumeration of types of data to be sent in blocks.
Definition: Buffer.h:225
Utility classes for scientific computation.
Definition: accumulators.mod:1
A container for all the Group<N> objects on this processor.
A container for all the atoms and ghost atoms on this processor.
Buffer for interprocessor communication.
Definition: Buffer.h:217
Decomposition of the system into domains associated with processors.
Definition: Domain.h:31
Dynamically allocatable contiguous array template.
Definition: DArray.h:31
A group of covalently interacting atoms.
An object that can read multiple parameters from file.
Class template for distributing Group<N> objects among processors.