A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
remote-channel-bundle-manager.h
Go to the documentation of this file.
1/*
2 * Copyright 2013. Lawrence Livermore National Security, LLC.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Steven Smith <smith84@llnl.gov>
18 *
19 */
20
27#ifndef NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
28#define NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
29
30#include <ns3/nstime.h>
31#include <ns3/ptr.h>
32
33#include <unordered_map>
34
35namespace ns3
36{
37
38class RemoteChannelBundle;
39
48{
49 public:
56 static Ptr<RemoteChannelBundle> Find(uint32_t systemId);
57
66 static Ptr<RemoteChannelBundle> Add(uint32_t systemId);
67
72 static std::size_t Size();
73
78 static void InitializeNullMessageEvents();
79
84 static Time GetSafeTime();
85
87 static void Destroy();
88
89 private:
94 {
95 }
96
101 {
102 }
103
108 typedef std::unordered_map<uint32_t, Ptr<RemoteChannelBundle>> RemoteChannelMap;
111
116 static bool g_initialized;
117};
118
119} // namespace ns3
120
121#endif
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Singleton for managing the RemoteChannelBundles for each process.
static Time GetSafeTime()
Get the safe time across all channels in this bundle.
static Ptr< RemoteChannelBundle > Find(uint32_t systemId)
Get the bundle corresponding to a remote rank.
~RemoteChannelBundleManager()
Private dtor to prevent destruction outside of singleton pattern.
static void InitializeNullMessageEvents()
Setup initial Null Message events for every RemoteChannelBundle.
static RemoteChannelMap g_remoteChannelBundles
The remote channel bundles.
static Ptr< RemoteChannelBundle > Add(uint32_t systemId)
Add RemoteChannelBundle from this task to MPI task on other side of the link.
std::unordered_map< uint32_t, Ptr< RemoteChannelBundle > > RemoteChannelMap
Container for all remote channel bundles for this task.
static std::size_t Size()
Get the number of ns-3 channels in this bundle.
static void Destroy()
Destroy the singleton.
RemoteChannelBundleManager()
Private ctor to prevent creation outside of singleton pattern.
static bool g_initialized
Protect manager class from being initialized twice or incorrect ordering of method calls.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Every class exported by the ns3 library is enclosed in the ns3 namespace.