A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::GrantedTimeWindowMpiInterface Class Reference

Interface between ns-3 and MPI. More...

#include <granted-time-window-mpi-interface.h>

+ Inheritance diagram for ns3::GrantedTimeWindowMpiInterface:
+ Collaboration diagram for ns3::GrantedTimeWindowMpiInterface:

Public Member Functions

virtual void Destroy ()
 Delete all buffers. More...
 
virtual void Disable ()
 Terminates the MPI environment by calling MPI_Finalize This function must be called after Destroy () It also resets m_initialized, m_enabled. More...
 
virtual void Enable (int *pargc, char ***pargv)
 
virtual uint32_t GetSize ()
 
virtual uint32_t GetSystemId ()
 
virtual bool IsEnabled ()
 
virtual void SendPacket (Ptr< Packet > p, const Time &rxTime, uint32_t node, uint32_t dev)
 
- Public Member Functions inherited from ns3::ParallelCommunicationInterface
virtual ~ParallelCommunicationInterface ()
 Destructor. More...
 

Static Public Member Functions

static uint32_t GetRxCount ()
 
static uint32_t GetTxCount ()
 
static TypeId GetTypeId (void)
 
static void ReceiveMessages ()
 Check for received messages complete. More...
 
static void TestSendComplete ()
 Check for completed sends. More...
 

Static Private Attributes

static bool m_enabled = false
 
static bool m_initialized = false
 
static std::list< SentBufferm_pendingTx
 
static char ** m_pRxBuffers
 
static MPI_Requestm_requests
 
static uint32_t m_rxCount = 0
 
static uint32_t m_sid = 0
 
static uint32_t m_size = 1
 
static uint32_t m_txCount = 0
 

Additional Inherited Members

- Private Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
 Object (const Object &o)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Private Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Private Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 
- Static Private Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Private Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Private Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Detailed Description

Interface between ns-3 and MPI.

Implements the interface used by the singleton parallel controller to interface between NS3 and the communications layer being used for inter-task packet transfers.

Definition at line 91 of file granted-time-window-mpi-interface.h.

Member Function Documentation

void ns3::GrantedTimeWindowMpiInterface::Destroy ( void  )
virtual

Delete all buffers.

Implements ns3::ParallelCommunicationInterface.

Definition at line 102 of file granted-time-window-mpi-interface.cc.

References GetSize(), m_pendingTx, m_pRxBuffers, m_requests, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

void ns3::GrantedTimeWindowMpiInterface::Disable ( )
virtual

Terminates the MPI environment by calling MPI_Finalize This function must be called after Destroy () It also resets m_initialized, m_enabled.

Implements ns3::ParallelCommunicationInterface.

Definition at line 314 of file granted-time-window-mpi-interface.cc.

References m_enabled, m_initialized, NS_FATAL_ERROR, and NS_LOG_FUNCTION_NOARGS.

void ns3::GrantedTimeWindowMpiInterface::Enable ( int *  pargc,
char ***  pargv 
)
virtual
Parameters
pargcnumber of command line arguments
pargvcommand line arguments

Sets up MPI interface

Implements ns3::ParallelCommunicationInterface.

Definition at line 164 of file granted-time-window-mpi-interface.cc.

References GetSize(), m_enabled, m_initialized, m_pRxBuffers, m_requests, m_sid, m_size, ns3::MAX_MPI_MSG_SIZE, NS_FATAL_ERROR, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

uint32_t ns3::GrantedTimeWindowMpiInterface::GetRxCount ( )
static
Returns
received count in packets

Definition at line 119 of file granted-time-window-mpi-interface.cc.

References m_rxCount.

Referenced by ns3::DistributedSimulatorImpl::Run().

+ Here is the caller graph for this function:

uint32_t ns3::GrantedTimeWindowMpiInterface::GetSize ( )
virtual
Returns
MPI size (number of systems)

Implements ns3::ParallelCommunicationInterface.

Definition at line 142 of file granted-time-window-mpi-interface.cc.

References ns3::Simulator::GetImplementation(), m_initialized, and m_size.

Referenced by Destroy(), and Enable().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::GrantedTimeWindowMpiInterface::GetSystemId ( void  )
virtual
Returns
MPI rank

Implements ns3::ParallelCommunicationInterface.

Definition at line 131 of file granted-time-window-mpi-interface.cc.

References ns3::Simulator::GetImplementation(), m_initialized, and m_sid.

+ Here is the call graph for this function:

uint32_t ns3::GrantedTimeWindowMpiInterface::GetTxCount ( )
static
Returns
transmitted count in packets

Definition at line 125 of file granted-time-window-mpi-interface.cc.

References m_txCount.

Referenced by ns3::DistributedSimulatorImpl::Run().

+ Here is the caller graph for this function:

TypeId ns3::GrantedTimeWindowMpiInterface::GetTypeId ( void  )
static

Definition at line 93 of file granted-time-window-mpi-interface.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

bool ns3::GrantedTimeWindowMpiInterface::IsEnabled ( )
virtual
Returns
true if using MPI

Implements ns3::ParallelCommunicationInterface.

Definition at line 153 of file granted-time-window-mpi-interface.cc.

References ns3::Simulator::GetImplementation(), m_enabled, and m_initialized.

+ Here is the call graph for this function:

void ns3::GrantedTimeWindowMpiInterface::ReceiveMessages ( )
static
void ns3::GrantedTimeWindowMpiInterface::SendPacket ( Ptr< Packet p,
const Time rxTime,
uint32_t  node,
uint32_t  dev 
)
virtual
Parameters
ppacket to send
rxTimereceived time at destination node
nodedestination node
devdestination device

Serialize and send a packet to the specified node and net device

Implements ns3::ParallelCommunicationInterface.

Definition at line 191 of file granted-time-window-mpi-interface.cc.

References ns3::Time::GetInteger(), ns3::NodeList::GetNode(), ns3::Packet::GetSerializedSize(), ns3::Node::GetSystemId(), ns3::Time::GetTimeStep(), m_pendingTx, m_txCount, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::Packet::Serialize().

+ Here is the call graph for this function:

void ns3::GrantedTimeWindowMpiInterface::TestSendComplete ( )
static

Check for completed sends.

Definition at line 290 of file granted-time-window-mpi-interface.cc.

References current, m_pendingTx, NS_FATAL_ERROR, and NS_LOG_FUNCTION_NOARGS.

Referenced by ns3::DistributedSimulatorImpl::Run().

+ Here is the caller graph for this function:

Member Data Documentation

bool ns3::GrantedTimeWindowMpiInterface::m_enabled = false
staticprivate

Definition at line 161 of file granted-time-window-mpi-interface.h.

Referenced by Disable(), Enable(), and IsEnabled().

bool ns3::GrantedTimeWindowMpiInterface::m_initialized = false
staticprivate

Definition at line 160 of file granted-time-window-mpi-interface.h.

Referenced by Disable(), Enable(), GetSize(), GetSystemId(), and IsEnabled().

std::list< SentBuffer > ns3::GrantedTimeWindowMpiInterface::m_pendingTx
staticprivate

Definition at line 170 of file granted-time-window-mpi-interface.h.

Referenced by Destroy(), SendPacket(), and TestSendComplete().

char** ns3::GrantedTimeWindowMpiInterface::m_pRxBuffers
staticprivate

Definition at line 167 of file granted-time-window-mpi-interface.h.

Referenced by Destroy(), Enable(), and ReceiveMessages().

MPI_Request* ns3::GrantedTimeWindowMpiInterface::m_requests
staticprivate

Definition at line 164 of file granted-time-window-mpi-interface.h.

Referenced by Destroy(), Enable(), and ReceiveMessages().

uint32_t ns3::GrantedTimeWindowMpiInterface::m_rxCount = 0
staticprivate

Definition at line 156 of file granted-time-window-mpi-interface.h.

Referenced by GetRxCount(), and ReceiveMessages().

uint32_t ns3::GrantedTimeWindowMpiInterface::m_sid = 0
staticprivate

Definition at line 152 of file granted-time-window-mpi-interface.h.

Referenced by Enable(), and GetSystemId().

uint32_t ns3::GrantedTimeWindowMpiInterface::m_size = 1
staticprivate

Definition at line 153 of file granted-time-window-mpi-interface.h.

Referenced by Enable(), and GetSize().

uint32_t ns3::GrantedTimeWindowMpiInterface::m_txCount = 0
staticprivate

Definition at line 159 of file granted-time-window-mpi-interface.h.

Referenced by GetTxCount(), and SendPacket().


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