OMNeT++ Parallel Simulation Support  5.4.1
cmpicomm.h
1 //=========================================================================
2 // CMPICOMM.H - part of
3 //
4 // OMNeT++/OMNEST
5 // Discrete System Simulation in C++
6 //
7 // Author: Andras Varga, 2003
8 // Dept. of Electrical and Computer Systems Engineering,
9 // Monash University, Melbourne, Australia
10 //
11 //=========================================================================
12 
13 /*--------------------------------------------------------------*
14  Copyright (C) 2003-2017 Andras Varga
15  Copyright (C) 2006-2017 OpenSim Ltd.
16 
17  This file is distributed WITHOUT ANY WARRANTY. See the file
18  `license' for details on this and other legal matters.
19 *--------------------------------------------------------------*/
20 
21 #ifdef WITH_MPI
22 
23 #ifndef __OMNETPP_CMPICOMM_H
24 #define __OMNETPP_CMPICOMM_H
25 
26 #include "omnetpp/cparsimcomm.h"
27 
28 namespace omnetpp {
29 
30 class cMPICommBuffer;
31 
37 class SIM_API cMPICommunications : public cParsimCommunications
38 {
39  protected:
40  cMPICommBuffer *recycledBuffer;
41  int numPartitions;
42  int myRank;
43 
44  protected:
48  virtual cMPICommBuffer *doCreateCommBuffer();
49 
50  public:
54  cMPICommunications();
55 
59  virtual ~cMPICommunications();
60 
66  virtual void init() override;
67 
71  virtual void shutdown() override;
72 
76  virtual int getNumPartitions() const override;
77 
81  virtual int getProcId() const override;
82 
86  virtual cCommBuffer *createCommBuffer() override;
87 
91  virtual void recycleCommBuffer(cCommBuffer *buffer) override;
92 
96  virtual void send(cCommBuffer *buffer, int tag, int destination) override;
97 
101  virtual void broadcast(cCommBuffer *buffer, int tag) override;
102 
107  virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) override;
108 
114  virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) override;
116 };
117 
118 } // namespace omnetpp
119 
120 
121 #endif
122 
123 #endif
Definition: cadvlinkdelaylookahead.h:26