A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
remote-channel-bundle.cc
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 * Implementation of class ns3::RemoteChannelBundle.
14 */
15
17
20
21#include <ns3/simulator.h>
22
23namespace ns3
24{
25
26TypeId
28{
29 static TypeId tid = TypeId("ns3::RemoteChannelBundle")
31 .SetGroupName("Mpi")
32 .AddConstructor<RemoteChannelBundle>();
33 return tid;
34}
35
37 : m_remoteSystemId(UINT32_MAX),
38 m_guaranteeTime(0),
39 m_delay(Time::Max())
40{
41}
42
44 : m_remoteSystemId(remoteSystemId),
45 m_guaranteeTime(0),
46 m_delay(Time::Max())
47{
48}
49
50void
52{
53 m_channels[channel->GetId()] = channel;
54 m_delay = ns3::Min(m_delay, delay);
55}
56
62
63Time
68
69void
76
77Time
79{
80 return m_delay;
81}
82
83void
88
94
95std::size_t
97{
98 return m_channels.size();
99}
100
101void
106
107std::ostream&
108operator<<(std::ostream& out, ns3::RemoteChannelBundle& bundle)
109{
110 out << "RemoteChannelBundle Rank = " << bundle.m_remoteSystemId
111 << ", GuaranteeTime = " << bundle.m_guaranteeTime << ", Delay = " << bundle.m_delay
112 << std::endl;
113
114 for (const auto& element : bundle.m_channels)
115 {
116 out << "\t" << element.second << std::endl;
117 }
118
119 return out;
120}
121
122} // namespace ns3
#define Max(a, b)
An identifier for simulation events.
Definition event-id.h:45
static void SendNullMessage(const Time &guaranteeUpdate, Ptr< RemoteChannelBundle > bundle)
Send a Null Message to across the specified bundle.
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
Collection of ns-3 channels between local and remote nodes.
Time m_delay
Delay for this Channel bundle, which is the min link delay over all incoming channels;.
std::size_t GetSize() const
Get the number of ns-3 channels in this bundle.
Time GetDelay() const
Get the minimum delay along any channel in this bundle.
void SetGuaranteeTime(Time time)
Set the guarantee time for the bundle.
Time GetGuaranteeTime() const
Get the current guarantee time for this bundle.
RemoteChannelBundle()
Default constructor.
void SetEventId(EventId id)
Set the event ID of the Null Message send event currently scheduled for this channel.
void Send(Time time)
Send Null Message to the remote task associated with this bundle.
ChannelMap m_channels
ChannelId to Channel map.
Time m_guaranteeTime
Guarantee time for the incoming Channels from MPI task remote_rank.
uint32_t m_remoteSystemId
Remote rank.
void AddChannel(Ptr< Channel > channel, Time delay)
Add a channel to this bundle.
static TypeId GetTypeId()
Register this type.
EventId GetEventId() const
Get the event ID of the Null Message send event for this bundle.
EventId m_nullEventId
Event scheduled to send Null Message for this bundle.
uint32_t GetSystemId() const
Get the system Id for this side.
static Time Now()
Return the current simulation virtual time.
Definition simulator.cc:197
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Definition int64x64.h:217
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
Declaration of classes ns3::NullMessageSentBuffer and ns3::NullMessageMpiInterface.
Declaration of class ns3::NullMessageSimulatorImpl.
Declaration of class ns3::RemoteChannelBundle.