cparsimcomm.h Source File

API: cparsimcomm.h Source File
API
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
22namespace omnetpp {
23
24class cCommBuffer;
25
26#define PARSIM_ANY_TAG -1
27
28
39class SIM_API cParsimCommunications : public cObject
40{
41 public:
46
49
52 virtual void init(int numPartitions) = 0;
53
57 virtual void shutdown() = 0;
59
61
64 virtual int getNumPartitions() const = 0;
65
69 virtual int getProcId() const = 0;
70
73
77
81 virtual void recycleCommBuffer(cCommBuffer *buffer) = 0;
82
86 virtual void send(cCommBuffer *buffer, int tag, int destination) = 0;
87
92 virtual void broadcast(cCommBuffer *buffer, int tag);
93
98 virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
99
105 virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
107};
108
109} // namespace omnetpp
110
111
112#endif
113
Buffer for the communications layer of parallel simulation.
Definition ccommbuffer.h:42
cObject()
Definition cobject.h:124
Basic communications layer for parallel simulation. It provides an abstraction layer above MPI,...
Definition cparsimcomm.h:40
virtual void recycleCommBuffer(cCommBuffer *buffer)=0
virtual int getProcId() const =0
virtual int getNumPartitions() const =0
virtual void init(int numPartitions)=0
virtual ~cParsimCommunications()
Definition cparsimcomm.h:45
virtual void broadcast(cCommBuffer *buffer, int tag)
virtual cCommBuffer * createCommBuffer()=0
virtual void send(cCommBuffer *buffer, int tag, int destination)=0
virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)=0
virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int &receivedTag, int &sourceProcId)=0