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.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::RemoteChannelBundle.
14
*/
15
16
#ifndef NS3_REMOTE_CHANNEL_BUNDLE
17
#define NS3_REMOTE_CHANNEL_BUNDLE
18
19
#include "
null-message-simulator-impl.h
"
20
21
#include "ns3/channel.h"
22
#include "ns3/pointer.h"
23
#include "ns3/ptr.h"
24
25
#include <unordered_map>
26
27
namespace
ns3
28
{
29
30
/**
31
* @ingroup mpi
32
*
33
* @brief Collection of ns-3 channels between local and remote nodes.
34
*
35
* An instance exists for each remote system that the local system is
36
* in communication with. These are created and managed by the
37
* RemoteChannelBundleManager class. Stores time information for each
38
* bundle.
39
*/
40
class
RemoteChannelBundle
:
public
Object
41
{
42
public
:
43
/**
44
* Register this type.
45
* @return The object TypeId.
46
*/
47
static
TypeId
GetTypeId
();
48
49
/** Default constructor. */
50
RemoteChannelBundle
();
51
52
/**
53
* Construct and assign system Id.
54
* @param [in] remoteSystemId The system id.
55
*/
56
RemoteChannelBundle
(
const
uint32_t
remoteSystemId);
57
58
/** Destructor. */
59
~RemoteChannelBundle
()
override
60
{
61
}
62
63
/**
64
* Add a channel to this bundle.
65
* @param channel to add to the bundle
66
* @param delay time for the channel (usually the latency)
67
*/
68
void
AddChannel
(
Ptr<Channel>
channel,
Time
delay);
69
70
/**
71
* Get the system Id for this side.
72
* @return SystemID for remote side of this bundle
73
*/
74
uint32_t
GetSystemId
()
const
;
75
76
/**
77
* Get the current guarantee time for this bundle.
78
* @return guarantee time
79
*/
80
Time
GetGuaranteeTime
()
const
;
81
82
/**
83
* Set the guarantee time for the bundle. This should be called
84
* after a packet or Null Message received.
85
*
86
* @param time The guarantee time.
87
*/
88
void
SetGuaranteeTime
(
Time
time);
89
90
/**
91
* Get the minimum delay along any channel in this bundle
92
* @return The minimum delay.
93
*/
94
Time
GetDelay
()
const
;
95
96
/**
97
* Set the event ID of the Null Message send event currently scheduled
98
* for this channel.
99
*
100
* @param [in] id The null message event id.
101
*/
102
void
SetEventId
(
EventId
id
);
103
104
/**
105
* Get the event ID of the Null Message send event for this bundle
106
* @return The null message event id.
107
*/
108
EventId
GetEventId
()
const
;
109
110
/**
111
* Get the number of ns-3 channels in this bundle
112
* @return The number of channels.
113
*/
114
std::size_t
GetSize
()
const
;
115
116
/**
117
* Send Null Message to the remote task associated with this bundle.
118
* Message will be delivered at current simulation time + the time
119
* passed in.
120
*
121
* @param time The delay from now when the null message should be received.
122
*/
123
void
Send
(
Time
time);
124
125
/**
126
* Output for debugging purposes.
127
*
128
* @param [in,out] out The stream.
129
* @param [in] bundle The bundle to print.
130
* @return The stream.
131
*/
132
friend
std::ostream&
operator<<
(std::ostream& out,
ns3::RemoteChannelBundle
& bundle);
133
134
private
:
135
/** Remote rank. */
136
uint32_t
m_remoteSystemId
;
137
138
/**
139
* Container of channels that are connected from nodes in this MPI task
140
* to nodes in a remote rank.
141
*/
142
typedef
std::unordered_map<uint32_t, Ptr<Channel>>
ChannelMap
;
143
ChannelMap
m_channels
;
/**< ChannelId to Channel map */
144
145
/**
146
* Guarantee time for the incoming Channels from MPI task remote_rank.
147
* No PacketMessage will ever arrive on any incoming channel
148
* in this bundle with a ReceiveTime less than this.
149
* Initialized to StartTime.
150
*/
151
Time
m_guaranteeTime
;
152
153
/**
154
* Delay for this Channel bundle, which is
155
* the min link delay over all incoming channels;
156
*/
157
Time
m_delay
;
158
159
/** Event scheduled to send Null Message for this bundle. */
160
EventId
m_nullEventId
;
161
};
162
163
}
// namespace ns3
164
165
#endif
ns3::EventId
An identifier for simulation events.
Definition
event-id.h:44
ns3::Object::Object
Object()
Constructor.
Definition
object.cc:96
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:67
ns3::RemoteChannelBundle
Collection of ns-3 channels between local and remote nodes.
Definition
remote-channel-bundle.h:41
ns3::RemoteChannelBundle::ChannelMap
std::unordered_map< uint32_t, Ptr< Channel > > ChannelMap
Container of channels that are connected from nodes in this MPI task to nodes in a remote rank.
Definition
remote-channel-bundle.h:142
ns3::RemoteChannelBundle::m_delay
Time m_delay
Delay for this Channel bundle, which is the min link delay over all incoming channels;.
Definition
remote-channel-bundle.h:157
ns3::RemoteChannelBundle::GetSize
std::size_t GetSize() const
Get the number of ns-3 channels in this bundle.
Definition
remote-channel-bundle.cc:96
ns3::RemoteChannelBundle::GetDelay
Time GetDelay() const
Get the minimum delay along any channel in this bundle.
Definition
remote-channel-bundle.cc:78
ns3::RemoteChannelBundle::SetGuaranteeTime
void SetGuaranteeTime(Time time)
Set the guarantee time for the bundle.
Definition
remote-channel-bundle.cc:70
ns3::RemoteChannelBundle::GetGuaranteeTime
Time GetGuaranteeTime() const
Get the current guarantee time for this bundle.
Definition
remote-channel-bundle.cc:64
ns3::RemoteChannelBundle::~RemoteChannelBundle
~RemoteChannelBundle() override
Destructor.
Definition
remote-channel-bundle.h:59
ns3::RemoteChannelBundle::RemoteChannelBundle
RemoteChannelBundle()
Default constructor.
Definition
remote-channel-bundle.cc:36
ns3::RemoteChannelBundle::operator<<
friend std::ostream & operator<<(std::ostream &out, ns3::RemoteChannelBundle &bundle)
Output for debugging purposes.
Definition
remote-channel-bundle.cc:108
ns3::RemoteChannelBundle::SetEventId
void SetEventId(EventId id)
Set the event ID of the Null Message send event currently scheduled for this channel.
Definition
remote-channel-bundle.cc:84
ns3::RemoteChannelBundle::m_channels
ChannelMap m_channels
ChannelId to Channel map.
Definition
remote-channel-bundle.h:143
ns3::RemoteChannelBundle::m_guaranteeTime
Time m_guaranteeTime
Guarantee time for the incoming Channels from MPI task remote_rank.
Definition
remote-channel-bundle.h:151
ns3::RemoteChannelBundle::m_remoteSystemId
uint32_t m_remoteSystemId
Remote rank.
Definition
remote-channel-bundle.h:136
ns3::RemoteChannelBundle::AddChannel
void AddChannel(Ptr< Channel > channel, Time delay)
Add a channel to this bundle.
Definition
remote-channel-bundle.cc:51
ns3::RemoteChannelBundle::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
remote-channel-bundle.cc:27
ns3::RemoteChannelBundle::GetEventId
EventId GetEventId() const
Get the event ID of the Null Message send event for this bundle.
Definition
remote-channel-bundle.cc:90
ns3::RemoteChannelBundle::m_nullEventId
EventId m_nullEventId
Event scheduled to send Null Message for this bundle.
Definition
remote-channel-bundle.h:160
ns3::RemoteChannelBundle::GetSystemId
uint32_t GetSystemId() const
Get the system Id for this side.
Definition
remote-channel-bundle.cc:58
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition
nstime.h:96
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Send
void Send()
Send a packet.
null-message-simulator-impl.h
Declaration of class ns3::NullMessageSimulatorImpl.
src
mpi
model
remote-channel-bundle.h
Generated on
for ns-3 by
1.15.0