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 ParallelCommunicationInterface * | g_parallelCommunicationInterface = 0 |
Static instance of the instantiated parallel controller. More... | |
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.
|
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().
|
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.
|
static |
Sets up parallel communication interface.
pargc | number of command line arguments |
pargv | command 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.
|
static |
When running a sequential simulation this will return a size of 1.
Definition at line 54 of file mpi-interface.cc.
References g_parallelCommunicationInterface, and ns3::ParallelCommunicationInterface::GetSize().
Referenced by ns3::NullMessageSimulatorImpl::CalculateLookAhead(), ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::DistributedSimulatorImpl::DistributedSimulatorImpl(), ns3::NullMessageSimulatorImpl::NullMessageSimulatorImpl(), and ns3::GrantedTimeWindowMpiInterface::ReceiveMessages().
|
static |
When running a sequential simulation this will return a systemID of 0.
Definition at line 45 of file mpi-interface.cc.
References g_parallelCommunicationInterface, and ns3::ParallelCommunicationInterface::GetSystemId().
Referenced by ns3::NullMessageSimulatorImpl::CalculateLookAhead(), ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::DistributedSimulatorImpl::DistributedSimulatorImpl(), ns3::GlobalRouteManagerImpl::InitializeRoutes(), ns3::PointToPointHelper::Install(), and ns3::NullMessageSimulatorImpl::NullMessageSimulatorImpl().
|
static |
Definition at line 63 of file mpi-interface.cc.
References g_parallelCommunicationInterface, and ns3::ParallelCommunicationInterface::IsEnabled().
Referenced by ns3::PointToPointHelper::Install().
|
static |
p | packet to send |
rxTime | received time at destination node |
node | destination node |
dev | destination 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().
|
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().