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

#include <mpi-interface.h>

+ Collaboration diagram for ns3::MpiInterface:

Static Public Member Functions

static void Destroy ()
static void Disable ()
static void Enable (int *pargc, char ***pargv)
static uint32_t GetRxCount ()
static uint32_t GetSize ()
static uint32_t GetSystemId ()
static uint32_t GetTxCount ()
static bool IsEnabled ()
static void ReceiveMessages ()
static void SendPacket (Ptr< Packet > p, const Time &rxTime, uint32_t node, uint32_t dev)
static void TestSendComplete ()

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

Detailed Description

Interface between ns-3 and MPI

Definition at line 89 of file mpi-interface.h.

Member Function Documentation

void ns3::MpiInterface::Destroy ( void  )
static

Delete all buffers

Definition at line 87 of file mpi-interface.cc.

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

+ Here is the call graph for this function:

void ns3::MpiInterface::Disable ( )
static

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

Definition at line 288 of file mpi-interface.cc.

References m_enabled, m_initialized, and NS_FATAL_ERROR.

Referenced by main().

+ Here is the caller graph for this function:

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

Sets up MPI interface

Definition at line 147 of file mpi-interface.cc.

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

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 102 of file mpi-interface.cc.

References m_rxCount.

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

+ Here is the caller graph for this function:

uint32_t ns3::MpiInterface::GetSize ( )
static
Returns
MPI size (number of systems)

Definition at line 125 of file mpi-interface.cc.

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

Referenced by ns3::DistributedSimulatorImpl::CalculateLookAhead(), Destroy(), ns3::DistributedSimulatorImpl::DistributedSimulatorImpl(), Enable(), main(), and ReceiveMessages().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32_t ns3::MpiInterface::GetSystemId ( void  )
static
Returns
MPI rank

Definition at line 114 of file mpi-interface.cc.

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

Referenced by ns3::GlobalRouteManagerImpl::InitializeRoutes(), ns3::PointToPointHelper::Install(), and main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 108 of file mpi-interface.cc.

References m_txCount.

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

+ Here is the caller graph for this function:

bool ns3::MpiInterface::IsEnabled ( )
static
Returns
true if using MPI

Definition at line 136 of file mpi-interface.cc.

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

Referenced by ns3::PointToPointHelper::Install().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::MpiInterface::ReceiveMessages ( )
static
void ns3::MpiInterface::SendPacket ( Ptr< Packet p,
const Time rxTime,
uint32_t  node,
uint32_t  dev 
)
static
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

Definition at line 172 of file mpi-interface.cc.

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

+ Here is the call graph for this function:

void ns3::MpiInterface::TestSendComplete ( )
static

Check for completed sends

Definition at line 266 of file mpi-interface.cc.

References m_pendingTx, and NS_FATAL_ERROR.

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

+ Here is the caller graph for this function:

Member Data Documentation

bool ns3::MpiInterface::m_enabled = false
staticprivate

Definition at line 157 of file mpi-interface.h.

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

bool ns3::MpiInterface::m_initialized = false
staticprivate

Definition at line 156 of file mpi-interface.h.

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

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

Definition at line 166 of file mpi-interface.h.

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

char** ns3::MpiInterface::m_pRxBuffers
staticprivate

Definition at line 163 of file mpi-interface.h.

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

MPI_Request* ns3::MpiInterface::m_requests
staticprivate

Definition at line 160 of file mpi-interface.h.

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

uint32_t ns3::MpiInterface::m_rxCount = 0
staticprivate

Definition at line 152 of file mpi-interface.h.

Referenced by GetRxCount(), and ReceiveMessages().

uint32_t ns3::MpiInterface::m_sid = 0
staticprivate

Definition at line 148 of file mpi-interface.h.

Referenced by Enable(), and GetSystemId().

uint32_t ns3::MpiInterface::m_size = 1
staticprivate

Definition at line 149 of file mpi-interface.h.

Referenced by Enable(), and GetSize().

uint32_t ns3::MpiInterface::m_txCount = 0
staticprivate

Definition at line 155 of file mpi-interface.h.

Referenced by GetTxCount(), and SendPacket().


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