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

Singleton used to interface to the communications infrastructure when running NS3 in parallel. More...

#include "mpi-interface.h"

Static Public Member Functions

static void Destroy ()
 Deletes storage used by the parallel environment. More...
 
static void Disable ()
 Terminates the parallel environment. More...
 
static void Enable (int *pargc, char ***pargv)
 Sets up parallel communication interface. More...
 
static uint32_t GetSize ()
 
static uint32_t GetSystemId ()
 
static bool IsEnabled ()
 
static void SendPacket (Ptr< Packet > p, const Time &rxTime, uint32_t node, uint32_t dev)
 

Static Private Attributes

static ParallelCommunicationInterfaceg_parallelCommunicationInterface = 0
 Static instance of the instantiated parallel controller. More...
 

Detailed Description

Singleton used to interface to the communications infrastructure when running NS3 in parallel.

Delegates the implementation to the specific parallel infrastructure being used. Implementation is defined in the ParallelCommunicationInterface virtual base class; this API mirrors that interface. This singleton is responsible for instantiating an instance of the communication interface based on SimulatorImplementationType attribute in ns3::GlobalValues. The attribute must be set before Enable is invoked.

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

Member Function Documentation

◆ Destroy()

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

Deletes storage used by the parallel environment.

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

References ns3::ParallelCommunicationInterface::Destroy(), g_parallelCommunicationInterface, and NS_ASSERT.

Referenced by ns3::NullMessageSimulatorImpl::Destroy(), and ns3::DistributedSimulatorImpl::Destroy().

◆ Disable()

void ns3::MpiInterface::Disable ( )
static

Terminates the parallel environment.

This function must be called after Destroy ()

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

References ns3::ParallelCommunicationInterface::Disable(), g_parallelCommunicationInterface, and NS_ASSERT.

◆ Enable()

void ns3::MpiInterface::Enable ( int *  pargc,
char ***  pargv 
)
static

Sets up parallel communication interface.

Parameters
pargcnumber of command line arguments
pargvcommand line arguments

SimulatorImplementationType attribute in ns3::GlobalValues must be set before Enable is invoked.

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

References ns3::GlobalValue::Bind(), ns3::ParallelCommunicationInterface::Enable(), g_parallelCommunicationInterface, ns3::StringValue::Get(), ns3::GlobalValue::GetValueByNameFailSafe(), and NS_LOG_WARN.

◆ GetSize()

uint32_t ns3::MpiInterface::GetSize ( void  )
static

◆ GetSystemId()

uint32_t ns3::MpiInterface::GetSystemId ( void  )
static

◆ IsEnabled()

bool ns3::MpiInterface::IsEnabled ( )
static
Returns
true if parallel communication is enabled

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

References g_parallelCommunicationInterface, and ns3::ParallelCommunicationInterface::IsEnabled().

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

◆ SendPacket()

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 112 of file mpi-interface.cc.

References g_parallelCommunicationInterface, NS_ASSERT, and ns3::ParallelCommunicationInterface::SendPacket().

Referenced by ns3::PointToPointRemoteChannel::TransmitStart().

Member Data Documentation

◆ g_parallelCommunicationInterface

ParallelCommunicationInterface * ns3::MpiInterface::g_parallelCommunicationInterface = 0
staticprivate

Static instance of the instantiated parallel controller.

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

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


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