OMNeT++ Simulation Library  6.0.3
cParsimCommunications Class Referenceabstract

#include <cparsimcomm.h>

Description

Basic communications layer for parallel simulation. It provides an abstraction layer above MPI, PVM, shared-memory communications, etc.

This is an interface: functionality is added by specific subclasses for MPI, PVM, etc.

Inheritance diagram for cParsimCommunications:
cObject

Public Member Functions

virtual ~cParsimCommunications ()
 
Lifecycle of communications library
virtual void init (int numPartitions)=0
 
virtual void shutdown ()=0
 
virtual int getNumPartitions () const =0
 
virtual int getProcId () const =0
 
Buffers, send, receive
virtual cCommBuffercreateCommBuffer ()=0
 
virtual void recycleCommBuffer (cCommBuffer *buffer)=0
 
virtual void send (cCommBuffer *buffer, int tag, int destination)=0
 
virtual void broadcast (cCommBuffer *buffer, int tag)
 
virtual bool receiveBlocking (int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)=0
 
virtual bool receiveNonblocking (int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)=0
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
virtual const char * getName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
virtual std::string getClassAndFullName () const
 
virtual std::string getClassAndFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::string str () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual cObjectdup () const
 
virtual void parsimPack (cCommBuffer *buffer) const
 
virtual void parsimUnpack (cCommBuffer *buffer)
 
virtual cObjectgetOwner () const
 
virtual bool isOwnedObject () const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

◆ ~cParsimCommunications()

virtual ~cParsimCommunications ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ init()

virtual void init ( int  numPartitions)
pure virtual

Initialize the communications library.

◆ shutdown()

virtual void shutdown ( )
pure virtual

Shutdown the communications library.

◆ getNumPartitions()

virtual int getNumPartitions ( ) const
pure virtual

Returns total number of partitions.

◆ getProcId()

virtual int getProcId ( ) const
pure virtual

Returns id of this partition, an integer in the range 0..getNumPartitions()-1.

◆ createCommBuffer()

virtual cCommBuffer* createCommBuffer ( )
pure virtual

Creates an empty buffer that can be used to send/receive data

◆ recycleCommBuffer()

virtual void recycleCommBuffer ( cCommBuffer buffer)
pure virtual

Recycle communication buffer after use. May be used to implement pooling, etc.

◆ send()

virtual void send ( cCommBuffer buffer,
int  tag,
int  destination 
)
pure virtual

Sends packed data with given tag to destination.

◆ broadcast()

virtual void broadcast ( cCommBuffer buffer,
int  tag 
)
virtual

Broadcasts packed data with given tag to all partitions. This default implementation just simply sends the data to every other partition.

◆ receiveBlocking()

virtual bool receiveBlocking ( int  filtTag,
cCommBuffer buffer,
int &  receivedTag,
int &  sourceProcId 
)
pure virtual

Receives packed data with given tag from given destination. Normally returns true; false is returned if blocking was interrupted by the user.

◆ receiveNonblocking()

virtual bool receiveNonblocking ( int  filtTag,
cCommBuffer buffer,
int &  receivedTag,
int &  sourceProcId 
)
pure virtual

Receives packed data with given tag from given destination. Call is non-blocking – it returns true if something has been received, false otherwise.


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