A Discrete-Event Network Simulator
API
Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
ns3::GrantedTimeWindowMpiInterface Class Reference

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

#include "granted-time-window-mpi-interface.h"

+ Inheritance 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 ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Private Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default 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 operator. 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
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 
- Static Private Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. 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

◆ Destroy()

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.

◆ Disable()

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.

◆ Enable()

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.

◆ GetRxCount()

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().

◆ GetSize()

uint32_t ns3::GrantedTimeWindowMpiInterface::GetSize ( void  )
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().

◆ GetSystemId()

uint32_t ns3::GrantedTimeWindowMpiInterface::GetSystemId ( void  )
virtual

◆ GetTxCount()

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().

◆ GetTypeId()

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

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

References ns3::TypeId::SetParent().

◆ IsEnabled()

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.

◆ ReceiveMessages()

void ns3::GrantedTimeWindowMpiInterface::ReceiveMessages ( )
static

◆ SendPacket()

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().

◆ TestSendComplete()

void ns3::GrantedTimeWindowMpiInterface::TestSendComplete ( )
static

Check for completed sends.

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

References m_pendingTx, NS_FATAL_ERROR, and NS_LOG_FUNCTION_NOARGS.

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

Member Data Documentation

◆ m_enabled

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().

◆ m_initialized

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().

◆ m_pendingTx

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().

◆ m_pRxBuffers

char** ns3::GrantedTimeWindowMpiInterface::m_pRxBuffers
staticprivate

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

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

◆ m_requests

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().

◆ m_rxCount

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().

◆ m_sid

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().

◆ m_size

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().

◆ m_txCount

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: