A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Steven Smith <smith84@llnl.gov>
7
*
8
*/
9
10
/**
11
* \file
12
* \ingroup mpi
13
* Declaration of class ns3::RemoteChannelBundleManager.
14
*/
15
16
#ifndef NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
17
#define NS3_REMOTE_CHANNEL_BUNDLE_MANAGER
18
19
#include <ns3/nstime.h>
20
#include <ns3/ptr.h>
21
22
#include <unordered_map>
23
24
namespace
ns3
25
{
26
27
class
RemoteChannelBundle;
28
29
/**
30
* \ingroup mpi
31
*
32
* \brief Singleton for managing the RemoteChannelBundles for each process.
33
*
34
* Manages collective tasks associated with the bundle collection.
35
*/
36
class
RemoteChannelBundleManager
37
{
38
public
:
39
/**
40
* Get the bundle corresponding to a remote rank.
41
*
42
* \param [in] systemId The remote system id.
43
* \return The bundle for the specified system id.
44
*/
45
static
Ptr<RemoteChannelBundle>
Find
(
uint32_t
systemId);
46
47
/**
48
* Add RemoteChannelBundle from this task to MPI task
49
* on other side of the link.
50
* Can not be invoked after InitializeNullMessageEvents has been invoked.
51
*
52
* \param [in] systemId The remote system id.
53
* \return The newly added bundle.
54
*/
55
static
Ptr<RemoteChannelBundle>
Add
(
uint32_t
systemId);
56
57
/**
58
* Get the number of ns-3 channels in this bundle
59
* \return The number of channels.
60
*/
61
static
std::size_t
Size
();
62
63
/**
64
* Setup initial Null Message events for every RemoteChannelBundle.
65
* All RemoteChannelBundles should be added before this method is invoked.
66
*/
67
static
void
InitializeNullMessageEvents
();
68
69
/**
70
* Get the safe time across all channels in this bundle.
71
* \return The safe time.
72
*/
73
static
Time
GetSafeTime
();
74
75
/** Destroy the singleton. */
76
static
void
Destroy
();
77
78
private
:
79
/**
80
* Private ctor to prevent creation outside of singleton pattern.
81
*/
82
RemoteChannelBundleManager
()
83
{
84
}
85
86
/**
87
* Private dtor to prevent destruction outside of singleton pattern.
88
*/
89
~RemoteChannelBundleManager
()
90
{
91
}
92
93
/**
94
* Container for all remote channel bundles for this task.
95
*
96
*/
97
typedef
std::unordered_map<uint32_t, Ptr<RemoteChannelBundle>>
RemoteChannelMap
;
98
/** The remote channel bundles. */
99
static
RemoteChannelMap
g_remoteChannelBundles
;
100
101
/**
102
* Protect manager class from being initialized twice or incorrect
103
* ordering of method calls.
104
*/
105
static
bool
g_initialized
;
106
};
107
108
}
// namespace ns3
109
110
#endif
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::RemoteChannelBundleManager
Singleton for managing the RemoteChannelBundles for each process.
Definition
remote-channel-bundle-manager.h:37
ns3::RemoteChannelBundleManager::GetSafeTime
static Time GetSafeTime()
Get the safe time across all channels in this bundle.
Definition
remote-channel-bundle-manager.cc:81
ns3::RemoteChannelBundleManager::Find
static Ptr< RemoteChannelBundle > Find(uint32_t systemId)
Get the bundle corresponding to a remote rank.
Definition
remote-channel-bundle-manager.cc:31
ns3::RemoteChannelBundleManager::~RemoteChannelBundleManager
~RemoteChannelBundleManager()
Private dtor to prevent destruction outside of singleton pattern.
Definition
remote-channel-bundle-manager.h:89
ns3::RemoteChannelBundleManager::InitializeNullMessageEvents
static void InitializeNullMessageEvents()
Setup initial Null Message events for every RemoteChannelBundle.
Definition
remote-channel-bundle-manager.cc:65
ns3::RemoteChannelBundleManager::g_remoteChannelBundles
static RemoteChannelMap g_remoteChannelBundles
The remote channel bundles.
Definition
remote-channel-bundle-manager.h:99
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:46
ns3::RemoteChannelBundleManager::RemoteChannelMap
std::unordered_map< uint32_t, Ptr< RemoteChannelBundle > > RemoteChannelMap
Container for all remote channel bundles for this task.
Definition
remote-channel-bundle-manager.h:97
ns3::RemoteChannelBundleManager::Size
static std::size_t Size()
Get the number of ns-3 channels in this bundle.
Definition
remote-channel-bundle-manager.cc:59
ns3::RemoteChannelBundleManager::Destroy
static void Destroy()
Destroy the singleton.
Definition
remote-channel-bundle-manager.cc:96
ns3::RemoteChannelBundleManager::RemoteChannelBundleManager
RemoteChannelBundleManager()
Private ctor to prevent creation outside of singleton pattern.
Definition
remote-channel-bundle-manager.h:82
ns3::RemoteChannelBundleManager::g_initialized
static bool g_initialized
Protect manager class from being initialized twice or incorrect ordering of method calls.
Definition
remote-channel-bundle-manager.h:105
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:94
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
mpi
model
remote-channel-bundle-manager.h
Generated on Fri Nov 8 2024 13:59:04 for ns-3 by
1.11.0