A Discrete-Event Network Simulator
API
mpi-interface.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright 2013. Lawrence Livermore National Security, LLC.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Steven Smith <smith84@llnl.gov>
19 */
20
27#ifndef NS3_MPI_INTERFACE_H
28#define NS3_MPI_INTERFACE_H
29
30#include <ns3/nstime.h>
31#include <ns3/packet.h>
32
33#include "mpi.h"
34
35namespace ns3 {
41class ParallelCommunicationInterface;
42
58{
59public:
63 static void Destroy ();
71 static uint32_t GetSystemId ();
81 static uint32_t GetSize ();
87 static bool IsEnabled ();
114 static void Enable (int* pargc, char*** pargv);
122 static void Enable (MPI_Comm communicator);
129 static void Disable ();
140 static void SendPacket (Ptr<Packet> p, const Time &rxTime, uint32_t node, uint32_t dev);
141
151 static MPI_Comm GetCommunicator();
152
153private:
154
158 static void SetParallelSimulatorImpl (void);
159
164};
165
166} // namespace ns3
167
168#endif /* NS3_MPI_INTERFACE_H */
Singleton used to interface to the communications infrastructure when running NS3 in parallel.
Definition: mpi-interface.h:58
static ParallelCommunicationInterface * g_parallelCommunicationInterface
Static instance of the instantiated parallel controller.
static MPI_Comm GetCommunicator()
Return the communicator used to run ns-3.
static void SendPacket(Ptr< Packet > p, const Time &rxTime, uint32_t node, uint32_t dev)
Send a packet to a remote node.
static bool IsEnabled()
Returns enabled state of parallel environment.
static void Destroy()
Deletes storage used by the parallel environment.
static void SetParallelSimulatorImpl(void)
Common enable logic.
static uint32_t GetSystemId()
Get the id number of this rank.
static uint32_t GetSize()
Get the number of ranks used by ns-3.
static void Disable()
Clean up the ns-3 parallel communications interface.
static void Enable(int *pargc, char ***pargv)
Setup the parallel communication interface.
Pure virtual base class for the interface between ns-3 and the parallel communication layer being use...
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
Every class exported by the ns3 library is enclosed in the ns3 namespace.