OMNeT++ Simulation Library  5.6.1
cparsimcomm.h
1 //=========================================================================
2 // CPARSIMCOMM.H - part of
3 // OMNeT++/OMNEST
4 // Discrete System Simulation in C++
5 //
6 //=========================================================================
7 
8 /*--------------------------------------------------------------*
9  Copyright (C) 2003-2017 Andras Varga
10  Copyright (C) 2006-2017 OpenSim Ltd.
11 
12  This file is distributed WITHOUT ANY WARRANTY. See the file
13  `license' for details on this and other legal matters.
14 *--------------------------------------------------------------*/
15 
16 
17 #ifndef __OMNETPP_CPARSIMCOMM_H
18 #define __OMNETPP_CPARSIMCOMM_H
19 
20 #include "cobject.h"
21 
22 namespace omnetpp {
23 
24 class cCommBuffer;
25 
26 #define PARSIM_ANY_TAG -1
27 
28 
39 class SIM_API cParsimCommunications : public cObject
40 {
41  public:
46 
58  virtual void init() = 0;
59 
63  virtual void shutdown() = 0;
65 
67 
70  virtual int getNumPartitions() const = 0;
71 
75  virtual int getProcId() const = 0;
76 
82  virtual cCommBuffer *createCommBuffer() = 0;
83 
87  virtual void recycleCommBuffer(cCommBuffer *buffer) = 0;
88 
92  virtual void send(cCommBuffer *buffer, int tag, int destination) = 0;
93 
98  virtual void broadcast(cCommBuffer *buffer, int tag);
99 
104  virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
105 
111  virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
113 };
114 
115 } // namespace omnetpp
116 
117 
118 #endif
119 
virtual ~cParsimCommunications()
Definition: cparsimcomm.h:45
Root of the OMNeT++ class hierarchy. cObject is a lightweight class without any data members...
Definition: cobject.h:58
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
Definition: cabstracthistogram.h:21
Basic communications layer for parallel simulation. It provides an abstraction layer above MPI...
Definition: cparsimcomm.h:39