A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
mpi
model
remote-channel-bundle-manager.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
*/
21
22
#ifndef NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
23
#define NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
24
25
#include <ns3/nstime.h>
26
#include <ns3/ptr.h>
27
#include <map>
28
29
namespace
ns3
{
30
31
class
RemoteChannelBundle;
32
33
/*
34
* \ingroup mpi
35
*
36
* \brief Singleton for managing the RemoteChannelBundles for each process.
37
*
38
* Manages collective tasks associated with the bundle collection.
39
*/
40
class
RemoteChannelBundleManager
41
{
42
43
public
:
47
static
Ptr<RemoteChannelBundle>
Find
(uint32_t systemId);
48
53
static
Ptr<RemoteChannelBundle>
Add
(uint32_t systemId);
54
59
static
std::size_t
Size
(
void
);
60
65
static
void
InitializeNullMessageEvents
(
void
);
66
70
static
Time
GetSafeTime
(
void
);
71
75
static
void
Destroy
(
void
);
76
77
private
:
78
82
RemoteChannelBundleManager
()
83
{
84
}
85
86
~RemoteChannelBundleManager
()
87
{
88
}
89
90
/*
91
* Container for all remote channel bundles for this task.
92
*
93
* Would be more efficient to use unordered_map when C++11 is adopted for NS3.
94
*/
95
typedef
std::map<uint32_t, Ptr<RemoteChannelBundle> >
RemoteChannelMap
;
96
static
RemoteChannelMap
g_remoteChannelBundles
;
97
98
/*
99
* Protect manager class from being initialized twice or incorrect
100
* ordering of method calls.
101
*/
102
static
bool
g_initialized
;
103
};
104
105
}
// namespace ns3
106
107
#endif
ns3::RemoteChannelBundleManager::RemoteChannelMap
std::map< uint32_t, Ptr< RemoteChannelBundle > > RemoteChannelMap
Definition:
remote-channel-bundle-manager.h:95
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::RemoteChannelBundleManager
Definition:
remote-channel-bundle-manager.h:40
ns3::RemoteChannelBundleManager::g_remoteChannelBundles
static RemoteChannelMap g_remoteChannelBundles
Definition:
remote-channel-bundle-manager.h:96
ns3::RemoteChannelBundleManager::GetSafeTime
static Time GetSafeTime(void)
Definition:
remote-channel-bundle-manager.cc:87
ns3::RemoteChannelBundleManager::InitializeNullMessageEvents
static void InitializeNullMessageEvents(void)
Setup initial Null Message events for every RemoteChannelBundle.
Definition:
remote-channel-bundle-manager.cc:69
ns3::RemoteChannelBundleManager::g_initialized
static bool g_initialized
Definition:
remote-channel-bundle-manager.h:102
ns3::RemoteChannelBundleManager::Destroy
static void Destroy(void)
Destroy the singleton.
Definition:
remote-channel-bundle-manager.cc:104
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::RemoteChannelBundleManager::Find
static Ptr< RemoteChannelBundle > Find(uint32_t systemId)
Definition:
remote-channel-bundle-manager.cc:35
ns3::RemoteChannelBundleManager::Add
static Ptr< RemoteChannelBundle > Add(uint32_t systemId)
Add RemoteChannelBundle from this task to MPI task on other side of the link.
Definition:
remote-channel-bundle-manager.cc:50
ns3::RemoteChannelBundleManager::Size
static std::size_t Size(void)
Definition:
remote-channel-bundle-manager.cc:63
ns3::RemoteChannelBundleManager::~RemoteChannelBundleManager
~RemoteChannelBundleManager()
Definition:
remote-channel-bundle-manager.h:86
ns3::RemoteChannelBundleManager::RemoteChannelBundleManager
RemoteChannelBundleManager()
Private ctor to prevent creation outside of singleton pattern.
Definition:
remote-channel-bundle-manager.h:82
Generated on Wed Nov 7 2018 10:02:06 for ns-3 by
1.8.14