cmpicomm.h

00001 //=========================================================================
00002 //  CMPICOMM.H - part of
00003 //
00004 //                  OMNeT++/OMNEST
00005 //           Discrete System Simulation in C++
00006 //
00007 //  Author: Andras Varga, 2003
00008 //          Dept. of Electrical and Computer Systems Engineering,
00009 //          Monash University, Melbourne, Australia
00010 //
00011 //=========================================================================
00012 
00013 /*--------------------------------------------------------------*
00014   Copyright (C) 2003-2008 Andras Varga
00015   Copyright (C) 2006-2008 OpenSim Ltd.
00016 
00017   This file is distributed WITHOUT ANY WARRANTY. See the file
00018   `license' for details on this and other legal matters.
00019 *--------------------------------------------------------------*/
00020 
00021 #ifdef WITH_MPI
00022 
00023 #ifndef __CMPICOMM_H__
00024 #define __CMPICOMM_H__
00025 
00026 #include "cparsimcomm.h"
00027 
00028 NAMESPACE_BEGIN
00029 
00030 class cMPICommBuffer;
00031 
00037 class SIM_API cMPICommunications : public cParsimCommunications
00038 {
00039   protected:
00040     cMPICommBuffer *recycledBuffer;
00041     int numPartitions;
00042     int myRank;
00043 
00044   protected:
00048     virtual cMPICommBuffer *doCreateCommBuffer();
00049 
00050   public:
00054     cMPICommunications();
00055 
00059     virtual ~cMPICommunications();
00060 
00066     virtual void init();
00067 
00071     virtual void shutdown();
00072 
00076     virtual int getNumPartitions() const;
00077 
00081     virtual int getProcId() const;
00082 
00086     virtual cCommBuffer *createCommBuffer();
00087 
00091     virtual void recycleCommBuffer(cCommBuffer *buffer);
00092 
00096     virtual void send(cCommBuffer *buffer, int tag, int destination);
00097 
00101     virtual void broadcast(cCommBuffer *buffer, int tag);
00102 
00107     virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId);
00108 
00114     virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer,  int& receivedTag, int& sourceProcId);
00116 };
00117 
00118 NAMESPACE_END
00119 
00120 
00121 #endif
00122 
00123 #endif
Generated on Tue Dec 2 11:16:32 2014 for OMNeT++ Parallel Simulation Support by  doxygen 1.6.3