11 #include <util/param/ParamComposite.h> 12 #include <util/misc/Setable.h> 20 template <
int N>
class Group;
226 GROUP2, GROUP3, GROUP4, SPECIAL};
243 void readParameters(std::istream& in);
270 void allocate(
int atomCapacity,
int ghostCapacity);
278 void clearSendBuffer();
287 void beginSendBlock(
int sendType);
300 template <
typename T>
301 void pack(
const T& data);
306 void incrementSendSize();
322 void endSendBlock(
bool isComplete =
true);
337 bool beginRecvBlock();
350 template <
typename T>
351 void unpack(T& data);
356 void decrementRecvSize();
387 void sendRecv(MPI::Intracomm& comm,
int source,
int dest);
398 void send(MPI::Intracomm& comm,
int dest);
406 void recv(MPI::Intracomm& comm,
int source);
414 void bcast(MPI::Intracomm& comm,
int source);
429 virtual void computeStatistics(MPI::Intracomm& comm);
431 virtual void computeStatistics();
441 void outputStatistics(std::ostream& out);
446 void clearStatistics();
455 int sendSize()
const;
460 int recvSize()
const;
465 bool isAllocated()
const;
470 bool isInitialized()
const;
475 int atomCapacity()
const;
480 int ghostCapacity()
const;
486 int groupCapacity()
const;
493 char* sendBufferBegin_;
496 char* recvBufferBegin_;
499 char* sendBufferEnd_;
502 char* recvBufferEnd_;
505 char* sendBlockBegin_;
508 char* recvBlockBegin_;
562 template <
typename T>
565 if (sendPtr_ +
sizeof(data) > sendBufferEnd_) {
566 UTIL_THROW(
"Attempted write past end of send buffer");
568 T* ptr = (T *)sendPtr_;
571 sendPtr_ = (
char *)ptr;
577 template <
typename T>
580 if (recvPtr_ +
sizeof(data) > recvBufferEnd_) {
581 UTIL_THROW(
"Attempted read past end of recv buffer");
583 T* ptr = (T *)recvPtr_;
586 recvPtr_ = (
char *)ptr;
595 if (dataCapacity_ <= 0) {
int groupCapacity() const
Maximum number of group<N> objects for which space is available.
void recv(MPI::Comm &comm, T &data, int source, int tag)
Receive a single T value.
File containing preprocessor macros for error handling.
Parallel domain decomposition (DD) MD simulation.
void send(MPI::Comm &comm, T &data, int dest, int tag)
Send a single T value.
void unpack(T &data)
Function template unpacking one variable from the receive buffer.
BlockDataType
Enumeration of types of data to be sent in blocks.
Saving / output archive for binary ostream.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void bcast(MPI::Intracomm &comm, T &data, int root)
Broadcast a single T value.
void incrementSendSize()
Increment sendSize counter after packing an item (an Atom or Group).
Utility classes for scientific computation.
Buffer for interprocessor communication.
Saving archive for binary istream.
void decrementRecvSize()
Decrement recvSize counter after completely unpacking an item.
void pack(const T &data)
Function template for packing one variable into the send buffer.
A group of covalently interacting atoms.
An object that can read multiple parameters from file.