ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | Static Public Member Functions | Friends | List of all members
CommunicationBuffer Class Reference

#include <CommunicationBuffer.h>

Public Member Functions

size_t getDynamicSize ()
 
void clear ()
 
void resizeForAppendingLeavingMolecules (unsigned long numMols)
 
void resizeForAppendingHaloMolecules (unsigned long numMols)
 
void resizeForAppendingForceMolecules (unsigned long numMols)
 
unsigned char * getDataForSending ()
 
size_t getNumElementsForSending ()
 
void resizeForRawBytes (unsigned long numBytes)
 
void addLeavingMolecule (size_t indexOfMolecule, const Molecule &m)
 
void addHaloMolecule (size_t indexOfMolecule, const Molecule &m)
 
void addForceMolecule (size_t indexOfMolecule, const Molecule &m)
 
void readLeavingMolecule (size_t indexOfMolecule, Molecule &m) const
 
void readHaloMolecule (size_t indexOfMolecule, Molecule &m) const
 
void readForceMolecule (size_t indexOfMolecule, Molecule &m) const
 
void resizeForReceivingMolecules (unsigned long &numLeaving, unsigned long &numHalo)
 
void resizeForReceivingMolecules (unsigned long &numForces)
 
size_t getNumHalo () const
 
size_t getNumLeaving () const
 
size_t getNumForces () const
 

Static Public Member Functions

static MPI_Datatype getMPIDataType ()
 

Friends

class CommunicationBufferTest
 

Detailed Description

This class enables to send only position-data when sending HALO molecules and all data, when sending LEAVING molecules. Sends two integers first, telling how many LEAVING and how many HALO molecules are being sent, and then all the data.

Converts all to CHAR internally.

TODO: test how this will work when going to Big Endian/Little Endian architectures, due to CHAR conversion.

Stores two unsigned long integers, then leaving molecules, then halo molecules.


The documentation for this class was generated from the following files: