mtp, mpi: Fix clang-tidy warnings
This commit is contained in:
@@ -163,7 +163,7 @@ main(int argc, char* argv[])
|
||||
Time simulationEndTime = Seconds(5);
|
||||
DataRate bottleneckBandwidth("10Mbps"); // value of x as shown in the above network topology
|
||||
Time bottleneckDelay = MilliSeconds(40);
|
||||
DataRate regLinkBandwidth = DataRate(4 * bottleneckBandwidth.GetBitRate());
|
||||
DataRate regLinkBandwidth(4 * bottleneckBandwidth.GetBitRate());
|
||||
Time regLinkDelay = MilliSeconds(5);
|
||||
DataRate maxPacingRate("4Gbps");
|
||||
|
||||
@@ -326,9 +326,7 @@ main(int argc, char* argv[])
|
||||
monitor->CheckForLostPackets();
|
||||
Ptr<Ipv4FlowClassifier> classifier = DynamicCast<Ipv4FlowClassifier>(flowmon.GetClassifier());
|
||||
FlowMonitor::FlowStatsContainer stats = monitor->GetFlowStats();
|
||||
for (std::map<FlowId, FlowMonitor::FlowStats>::const_iterator i = stats.begin();
|
||||
i != stats.end();
|
||||
++i)
|
||||
for (auto i = stats.begin(); i != stats.end(); ++i)
|
||||
{
|
||||
Ipv4FlowClassifier::FiveTuple t = classifier->FindFlow(i->first);
|
||||
|
||||
|
||||
@@ -163,10 +163,10 @@ NS_LOG_COMPONENT_DEFINE("TcpValidation");
|
||||
|
||||
// These variables are declared outside of main() so that they can
|
||||
// be used in trace sinks.
|
||||
std::atomic<uint32_t> g_firstBytesReceived (0); //!< First received packet size.
|
||||
std::atomic<uint32_t> g_secondBytesReceived (0); //!< Second received packet size.
|
||||
std::atomic<uint32_t> g_marksObserved (0); //!< Number of marked packets observed.
|
||||
std::atomic<uint32_t> g_dropsObserved (0); //!< Number of dropped packets observed.
|
||||
std::atomic<uint32_t> g_firstBytesReceived(0); //!< First received packet size.
|
||||
std::atomic<uint32_t> g_secondBytesReceived(0); //!< Second received packet size.
|
||||
std::atomic<uint32_t> g_marksObserved(0); //!< Number of marked packets observed.
|
||||
std::atomic<uint32_t> g_dropsObserved(0); //!< Number of dropped packets observed.
|
||||
std::string g_validate = ""; //!< Empty string disables validation.
|
||||
bool g_validationFailed = false; //!< True if validation failed.
|
||||
|
||||
@@ -748,7 +748,7 @@ main(int argc, char* argv[])
|
||||
firstTcpTypeId = TcpDctcp::GetTypeId();
|
||||
Config::SetDefault("ns3::CoDelQueueDisc::CeThreshold", TimeValue(ceThreshold));
|
||||
Config::SetDefault("ns3::FqCoDelQueueDisc::CeThreshold", TimeValue(ceThreshold));
|
||||
if (queueUseEcn == false)
|
||||
if (!queueUseEcn)
|
||||
{
|
||||
std::cout << "Warning: using DCTCP with queue ECN disabled" << std::endl;
|
||||
}
|
||||
@@ -935,7 +935,7 @@ main(int argc, char* argv[])
|
||||
proto->SetAttribute("SocketType", TypeIdValue(secondTcpTypeId));
|
||||
}
|
||||
|
||||
// InternetStackHelper will install a base TrafficControLayer on the node,
|
||||
// InternetStackHelper will install a base TrafficControlLayer on the node,
|
||||
// but the Ipv4AddressHelper below will install the default FqCoDelQueueDisc
|
||||
// on all single device nodes. The below code overrides the configuration
|
||||
// that is normally done by the Ipv4AddressHelper::Install() method by
|
||||
|
||||
@@ -52,15 +52,16 @@ class Distribution
|
||||
{
|
||||
public:
|
||||
// load a distribution from a CDF file
|
||||
Distribution(string filename = "src/mtp/examples/web-search.txt")
|
||||
Distribution(const string filename)
|
||||
{
|
||||
ifstream fin;
|
||||
fin.open(filename);
|
||||
while (!fin.eof())
|
||||
{
|
||||
double x, cdf;
|
||||
double x;
|
||||
double cdf;
|
||||
fin >> x >> cdf;
|
||||
m_cdf.push_back(std::make_pair(x, cdf));
|
||||
m_cdf.emplace_back(x, cdf);
|
||||
}
|
||||
fin.close();
|
||||
|
||||
@@ -68,7 +69,7 @@ class Distribution
|
||||
}
|
||||
|
||||
// expectation value of the distribution
|
||||
double Expectation()
|
||||
double Expectation() const
|
||||
{
|
||||
double ex = 0;
|
||||
for (uint32_t i = 1; i < m_cdf.size(); i++)
|
||||
@@ -106,22 +107,20 @@ class Distribution
|
||||
class TrafficGenerator
|
||||
{
|
||||
public:
|
||||
TrafficGenerator(string cdfFile,
|
||||
uint32_t hostTotal,
|
||||
double dataRate,
|
||||
double incastRatio,
|
||||
vector<uint32_t> victims)
|
||||
TrafficGenerator(const string cdfFile,
|
||||
const uint32_t hostTotal,
|
||||
const double dataRate,
|
||||
const double incastRatio,
|
||||
const vector<uint32_t> victims)
|
||||
: m_currentTime(0),
|
||||
m_incastRatio(incastRatio),
|
||||
m_hostTotal(hostTotal),
|
||||
m_victims(victims),
|
||||
m_flowCount(0),
|
||||
m_flowSizeTotal(0),
|
||||
m_distribution(cdfFile)
|
||||
{
|
||||
m_distribution = Distribution(cdfFile);
|
||||
|
||||
m_currentTime = 0;
|
||||
m_averageInterval = m_distribution.Expectation() * 8 / dataRate;
|
||||
m_incastRatio = incastRatio;
|
||||
m_hostTotal = hostTotal;
|
||||
m_victims = victims;
|
||||
|
||||
m_flowCount = 0;
|
||||
m_flowSizeTotal = 0;
|
||||
m_uniformRand = CreateObject<UniformRandomVariable>();
|
||||
m_expRand = CreateObject<ExponentialRandomVariable>();
|
||||
}
|
||||
@@ -129,7 +128,8 @@ class TrafficGenerator
|
||||
// get one flow with incremental time and random src, dst and size
|
||||
tuple<double, uint32_t, uint32_t, uint32_t> GetFlow()
|
||||
{
|
||||
uint32_t src, dst;
|
||||
uint32_t src;
|
||||
uint32_t dst;
|
||||
if (m_uniformRand->GetValue(0, 1) < m_incastRatio)
|
||||
{
|
||||
dst = m_victims[m_uniformRand->GetInteger(0, m_victims.size() - 1)];
|
||||
@@ -151,22 +151,22 @@ class TrafficGenerator
|
||||
return make_tuple(m_currentTime, src, dst, flowSize);
|
||||
}
|
||||
|
||||
double GetActualDataRate()
|
||||
double GetActualDataRate() const
|
||||
{
|
||||
return m_flowSizeTotal / m_currentTime * 8;
|
||||
}
|
||||
|
||||
double GetAvgFlowSize()
|
||||
double GetAvgFlowSize() const
|
||||
{
|
||||
return m_distribution.Expectation();
|
||||
}
|
||||
|
||||
double GetActualAvgFlowSize()
|
||||
double GetActualAvgFlowSize() const
|
||||
{
|
||||
return m_flowSizeTotal / (double)m_flowCount;
|
||||
}
|
||||
|
||||
uint32_t GetFlowCount()
|
||||
uint32_t GetFlowCount() const
|
||||
{
|
||||
return m_flowCount;
|
||||
}
|
||||
@@ -463,10 +463,17 @@ StartSimulation()
|
||||
uint64_t eventCount = Simulator::GetEventCount();
|
||||
if (conf::flowmon)
|
||||
{
|
||||
uint64_t dropped = 0, totalTx = 0, totalRx = 0, totalTxBytes = 0, flowCount = 0,
|
||||
finishedFlowCount = 0;
|
||||
uint64_t dropped = 0;
|
||||
uint64_t totalTx = 0;
|
||||
uint64_t totalRx = 0;
|
||||
uint64_t totalTxBytes = 0;
|
||||
uint64_t flowCount = 0;
|
||||
uint64_t finishedFlowCount = 0;
|
||||
double totalThroughput = 0;
|
||||
Time totalFct(0), totalFinishedFct(0), totalDelay(0);
|
||||
Time totalFct(0);
|
||||
Time totalFinishedFct(0);
|
||||
Time totalDelay(0);
|
||||
|
||||
flowMonitor->CheckForLostPackets();
|
||||
for (auto& p : flowMonitor->GetFlowStats())
|
||||
{
|
||||
@@ -490,6 +497,7 @@ StartSimulation()
|
||||
flowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
double avgFct = (double)totalFct.GetMicroSeconds() / flowCount;
|
||||
double avgFinishedFct = (double)totalFinishedFct.GetMicroSeconds() / finishedFlowCount;
|
||||
double avgDelay = (double)totalDelay.GetMicroSeconds() / totalRx;
|
||||
@@ -542,7 +550,10 @@ main(int argc, char* argv[])
|
||||
uint32_t nAgg = conf::k / 2; // number of aggregation switch in a pod
|
||||
uint32_t nEdge = conf::k / 2; // number of edge switch in a pod
|
||||
uint32_t nHost = conf::k / 2; // number of hosts under a switch
|
||||
NodeContainer core[nGroup], agg[nPod], edge[nPod], host[nPod][nEdge];
|
||||
NodeContainer core[nGroup];
|
||||
NodeContainer agg[nPod];
|
||||
NodeContainer edge[nPod];
|
||||
NodeContainer host[nPod][nEdge];
|
||||
|
||||
// create nodes
|
||||
for (uint32_t i = 0; i < nGroup; i++)
|
||||
|
||||
@@ -51,15 +51,16 @@ class Distribution
|
||||
{
|
||||
public:
|
||||
// load a distribution from a CDF file
|
||||
Distribution(string filename = "src/mtp/examples/web-search.txt")
|
||||
Distribution(const string filename)
|
||||
{
|
||||
ifstream fin;
|
||||
fin.open(filename);
|
||||
while (!fin.eof())
|
||||
{
|
||||
double x, cdf;
|
||||
double x;
|
||||
double cdf;
|
||||
fin >> x >> cdf;
|
||||
m_cdf.push_back(std::make_pair(x, cdf));
|
||||
m_cdf.emplace_back(x, cdf);
|
||||
}
|
||||
fin.close();
|
||||
|
||||
@@ -67,7 +68,7 @@ class Distribution
|
||||
}
|
||||
|
||||
// expectation value of the distribution
|
||||
double Expectation()
|
||||
double Expectation() const
|
||||
{
|
||||
double ex = 0;
|
||||
for (uint32_t i = 1; i < m_cdf.size(); i++)
|
||||
@@ -105,22 +106,20 @@ class Distribution
|
||||
class TrafficGenerator
|
||||
{
|
||||
public:
|
||||
TrafficGenerator(string cdfFile,
|
||||
uint32_t hostTotal,
|
||||
double dataRate,
|
||||
double incastRatio,
|
||||
vector<uint32_t> victims)
|
||||
TrafficGenerator(const string cdfFile,
|
||||
const uint32_t hostTotal,
|
||||
const double dataRate,
|
||||
const double incastRatio,
|
||||
const vector<uint32_t> victims)
|
||||
: m_currentTime(0),
|
||||
m_incastRatio(incastRatio),
|
||||
m_hostTotal(hostTotal),
|
||||
m_victims(victims),
|
||||
m_flowCount(0),
|
||||
m_flowSizeTotal(0),
|
||||
m_distribution(cdfFile)
|
||||
{
|
||||
m_distribution = Distribution(cdfFile);
|
||||
|
||||
m_currentTime = 0;
|
||||
m_averageInterval = m_distribution.Expectation() * 8 / dataRate;
|
||||
m_incastRatio = incastRatio;
|
||||
m_hostTotal = hostTotal;
|
||||
m_victims = victims;
|
||||
|
||||
m_flowCount = 0;
|
||||
m_flowSizeTotal = 0;
|
||||
m_uniformRand = CreateObject<UniformRandomVariable>();
|
||||
m_expRand = CreateObject<ExponentialRandomVariable>();
|
||||
}
|
||||
@@ -128,7 +127,8 @@ class TrafficGenerator
|
||||
// get one flow with incremental time and random src, dst and size
|
||||
tuple<double, uint32_t, uint32_t, uint32_t> GetFlow()
|
||||
{
|
||||
uint32_t src, dst;
|
||||
uint32_t src;
|
||||
uint32_t dst;
|
||||
if (m_uniformRand->GetValue(0, 1) < m_incastRatio)
|
||||
{
|
||||
dst = m_victims[m_uniformRand->GetInteger(0, m_victims.size() - 1)];
|
||||
@@ -150,22 +150,22 @@ class TrafficGenerator
|
||||
return make_tuple(m_currentTime, src, dst, flowSize);
|
||||
}
|
||||
|
||||
double GetActualDataRate()
|
||||
double GetActualDataRate() const
|
||||
{
|
||||
return m_flowSizeTotal / m_currentTime * 8;
|
||||
}
|
||||
|
||||
double GetAvgFlowSize()
|
||||
double GetAvgFlowSize() const
|
||||
{
|
||||
return m_distribution.Expectation();
|
||||
}
|
||||
|
||||
double GetActualAvgFlowSize()
|
||||
double GetActualAvgFlowSize() const
|
||||
{
|
||||
return m_flowSizeTotal / (double)m_flowCount;
|
||||
}
|
||||
|
||||
uint32_t GetFlowCount()
|
||||
uint32_t GetFlowCount() const
|
||||
{
|
||||
return m_flowCount;
|
||||
}
|
||||
@@ -467,10 +467,17 @@ StartSimulation()
|
||||
uint64_t eventCount = Simulator::GetEventCount();
|
||||
if (conf::flowmon)
|
||||
{
|
||||
uint64_t dropped = 0, totalTx = 0, totalRx = 0, totalTxBytes = 0, flowCount = 0,
|
||||
finishedFlowCount = 0;
|
||||
uint64_t dropped = 0;
|
||||
uint64_t totalTx = 0;
|
||||
uint64_t totalRx = 0;
|
||||
uint64_t totalTxBytes = 0;
|
||||
uint64_t flowCount = 0;
|
||||
uint64_t finishedFlowCount = 0;
|
||||
double totalThroughput = 0;
|
||||
Time totalFct(0), totalFinishedFct(0), totalDelay(0);
|
||||
Time totalFct(0);
|
||||
Time totalFinishedFct(0);
|
||||
Time totalDelay(0);
|
||||
|
||||
flowMonitor->CheckForLostPackets();
|
||||
for (auto& p : flowMonitor->GetFlowStats())
|
||||
{
|
||||
@@ -494,6 +501,7 @@ StartSimulation()
|
||||
flowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
double avgFct = (double)totalFct.GetMicroSeconds() / flowCount;
|
||||
double avgFinishedFct = (double)totalFinishedFct.GetMicroSeconds() / finishedFlowCount;
|
||||
double avgDelay = (double)totalDelay.GetMicroSeconds() / totalRx;
|
||||
@@ -546,7 +554,10 @@ main(int argc, char* argv[])
|
||||
uint32_t nAgg = conf::k / 2; // number of aggregation switch in a pod
|
||||
uint32_t nEdge = conf::k / 2; // number of edge switch in a pod
|
||||
uint32_t nHost = conf::k / 2; // number of hosts under a switch
|
||||
NodeContainer core[nGroup], agg[nPod], edge[nPod], host[nPod][nEdge];
|
||||
NodeContainer core[nGroup];
|
||||
NodeContainer agg[nPod];
|
||||
NodeContainer edge[nPod];
|
||||
NodeContainer host[nPod][nEdge];
|
||||
|
||||
// create nodes
|
||||
for (uint32_t i = 0; i < nGroup; i++)
|
||||
|
||||
@@ -225,7 +225,8 @@ GrantedTimeWindowMpiInterface::SendPacket(Ptr<Packet> p,
|
||||
|
||||
#ifdef NS3_MTP
|
||||
while (g_sending.exchange(true, std::memory_order_acquire))
|
||||
;
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
SentBuffer sendBuf;
|
||||
|
||||
@@ -178,8 +178,7 @@ HybridSimulatorImpl::Remove(const EventId& id)
|
||||
if (id.GetUid() == EventId::DESTROY)
|
||||
{
|
||||
// destroy events.
|
||||
for (std::list<EventId>::iterator i = m_destroyEvents.begin(); i != m_destroyEvents.end();
|
||||
i++)
|
||||
for (auto i = m_destroyEvents.begin(); i != m_destroyEvents.end(); i++)
|
||||
{
|
||||
if (*i == id)
|
||||
{
|
||||
@@ -209,13 +208,11 @@ HybridSimulatorImpl::IsExpired(const EventId& id) const
|
||||
if (id.GetUid() == EventId::DESTROY)
|
||||
{
|
||||
// destroy events.
|
||||
if (id.PeekEventImpl() == 0 || id.PeekEventImpl()->IsCancelled())
|
||||
if (id.PeekEventImpl() == nullptr || id.PeekEventImpl()->IsCancelled())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
for (std::list<EventId>::const_iterator i = m_destroyEvents.begin();
|
||||
i != m_destroyEvents.end();
|
||||
i++)
|
||||
for (auto i = m_destroyEvents.begin(); i != m_destroyEvents.end(); i++)
|
||||
{
|
||||
if (*i == id)
|
||||
{
|
||||
@@ -374,7 +371,7 @@ HybridSimulatorImpl::Partition()
|
||||
if (m_minLookahead == TimeStep(0))
|
||||
{
|
||||
std::vector<Time> delays;
|
||||
for (NodeContainer::Iterator it = nodes.Begin(); it != nodes.End(); it++)
|
||||
for (auto it = nodes.Begin(); it != nodes.End(); it++)
|
||||
{
|
||||
Ptr<Node> node = *it;
|
||||
if (node->GetSystemId() == m_myId)
|
||||
@@ -398,7 +395,7 @@ HybridSimulatorImpl::Partition()
|
||||
}
|
||||
}
|
||||
std::sort(delays.begin(), delays.end());
|
||||
if (delays.size() == 0)
|
||||
if (delays.empty())
|
||||
{
|
||||
m_minLookahead = TimeStep(0);
|
||||
}
|
||||
@@ -414,7 +411,7 @@ HybridSimulatorImpl::Partition()
|
||||
}
|
||||
|
||||
// perform a BFS on the whole network topo to assign each node a localSystemId
|
||||
for (NodeContainer::Iterator it = nodes.Begin(); it != nodes.End(); it++)
|
||||
for (auto it = nodes.Begin(); it != nodes.End(); it++)
|
||||
{
|
||||
Ptr<Node> node = *it;
|
||||
if (!visited[node->GetId()] && node->GetSystemId() == m_myId)
|
||||
|
||||
@@ -49,15 +49,16 @@ class Distribution
|
||||
{
|
||||
public:
|
||||
// load a distribution from a CDF file
|
||||
Distribution(string filename = "src/mtp/examples/web-search.txt")
|
||||
Distribution(const string filename)
|
||||
{
|
||||
ifstream fin;
|
||||
fin.open(filename);
|
||||
while (!fin.eof())
|
||||
{
|
||||
double x, cdf;
|
||||
double x;
|
||||
double cdf;
|
||||
fin >> x >> cdf;
|
||||
m_cdf.push_back(std::make_pair(x, cdf));
|
||||
m_cdf.emplace_back(x, cdf);
|
||||
}
|
||||
fin.close();
|
||||
|
||||
@@ -65,7 +66,7 @@ class Distribution
|
||||
}
|
||||
|
||||
// expectation value of the distribution
|
||||
double Expectation()
|
||||
double Expectation() const
|
||||
{
|
||||
double ex = 0;
|
||||
for (uint32_t i = 1; i < m_cdf.size(); i++)
|
||||
@@ -103,22 +104,20 @@ class Distribution
|
||||
class TrafficGenerator
|
||||
{
|
||||
public:
|
||||
TrafficGenerator(string cdfFile,
|
||||
uint32_t hostTotal,
|
||||
double dataRate,
|
||||
double incastRatio,
|
||||
vector<uint32_t> victims)
|
||||
TrafficGenerator(const string cdfFile,
|
||||
const uint32_t hostTotal,
|
||||
const double dataRate,
|
||||
const double incastRatio,
|
||||
const vector<uint32_t> victims)
|
||||
: m_currentTime(0),
|
||||
m_incastRatio(incastRatio),
|
||||
m_hostTotal(hostTotal),
|
||||
m_victims(victims),
|
||||
m_flowCount(0),
|
||||
m_flowSizeTotal(0),
|
||||
m_distribution(cdfFile)
|
||||
{
|
||||
m_distribution = Distribution(cdfFile);
|
||||
|
||||
m_currentTime = 0;
|
||||
m_averageInterval = m_distribution.Expectation() * 8 / dataRate;
|
||||
m_incastRatio = incastRatio;
|
||||
m_hostTotal = hostTotal;
|
||||
m_victims = victims;
|
||||
|
||||
m_flowCount = 0;
|
||||
m_flowSizeTotal = 0;
|
||||
m_uniformRand = CreateObject<UniformRandomVariable>();
|
||||
m_expRand = CreateObject<ExponentialRandomVariable>();
|
||||
}
|
||||
@@ -126,7 +125,8 @@ class TrafficGenerator
|
||||
// get one flow with incremental time and random src, dst and size
|
||||
tuple<double, uint32_t, uint32_t, uint32_t> GetFlow()
|
||||
{
|
||||
uint32_t src, dst;
|
||||
uint32_t src;
|
||||
uint32_t dst;
|
||||
if (m_uniformRand->GetValue(0, 1) < m_incastRatio)
|
||||
{
|
||||
dst = m_victims[m_uniformRand->GetInteger(0, m_victims.size() - 1)];
|
||||
@@ -148,22 +148,22 @@ class TrafficGenerator
|
||||
return make_tuple(m_currentTime, src, dst, flowSize);
|
||||
}
|
||||
|
||||
double GetActualDataRate()
|
||||
double GetActualDataRate() const
|
||||
{
|
||||
return m_flowSizeTotal / m_currentTime * 8;
|
||||
}
|
||||
|
||||
double GetAvgFlowSize()
|
||||
double GetAvgFlowSize() const
|
||||
{
|
||||
return m_distribution.Expectation();
|
||||
}
|
||||
|
||||
double GetActualAvgFlowSize()
|
||||
double GetActualAvgFlowSize() const
|
||||
{
|
||||
return m_flowSizeTotal / (double)m_flowCount;
|
||||
}
|
||||
|
||||
uint32_t GetFlowCount()
|
||||
uint32_t GetFlowCount() const
|
||||
{
|
||||
return m_flowCount;
|
||||
}
|
||||
@@ -443,10 +443,17 @@ StartSimulation()
|
||||
uint64_t eventCount = Simulator::GetEventCount();
|
||||
if (conf::flowmon)
|
||||
{
|
||||
uint64_t dropped = 0, totalTx = 0, totalRx = 0, totalTxBytes = 0, flowCount = 0,
|
||||
finishedFlowCount = 0;
|
||||
uint64_t dropped = 0;
|
||||
uint64_t totalTx = 0;
|
||||
uint64_t totalRx = 0;
|
||||
uint64_t totalTxBytes = 0;
|
||||
uint64_t flowCount = 0;
|
||||
uint64_t finishedFlowCount = 0;
|
||||
double totalThroughput = 0;
|
||||
Time totalFct(0), totalFinishedFct(0), totalDelay(0);
|
||||
Time totalFct(0);
|
||||
Time totalFinishedFct(0);
|
||||
Time totalDelay(0);
|
||||
|
||||
flowMonitor->CheckForLostPackets();
|
||||
for (auto& p : flowMonitor->GetFlowStats())
|
||||
{
|
||||
@@ -470,6 +477,7 @@ StartSimulation()
|
||||
flowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
double avgFct = (double)totalFct.GetMicroSeconds() / flowCount;
|
||||
double avgFinishedFct = (double)totalFinishedFct.GetMicroSeconds() / finishedFlowCount;
|
||||
double avgDelay = (double)totalDelay.GetMicroSeconds() / totalRx;
|
||||
@@ -508,7 +516,10 @@ main(int argc, char* argv[])
|
||||
uint32_t nAgg = conf::k / 2; // number of aggregation switch in a pod
|
||||
uint32_t nEdge = conf::k / 2; // number of edge switch in a pod
|
||||
uint32_t nHost = conf::k / 2; // number of hosts under a switch
|
||||
NodeContainer core[nGroup], agg[nPod], edge[nPod], host[nPod][nEdge];
|
||||
NodeContainer core[nGroup];
|
||||
NodeContainer agg[nPod];
|
||||
NodeContainer edge[nPod];
|
||||
NodeContainer host[nPod][nEdge];
|
||||
|
||||
// create nodes
|
||||
for (uint32_t i = 0; i < nGroup; i++)
|
||||
|
||||
@@ -33,18 +33,18 @@ namespace ns3
|
||||
NS_LOG_COMPONENT_DEFINE("LogicalProcess");
|
||||
|
||||
LogicalProcess::LogicalProcess()
|
||||
: m_systemId(0),
|
||||
m_systemCount(0),
|
||||
m_stop(false),
|
||||
m_uid(EventId::UID::VALID),
|
||||
m_currentContext(Simulator::NO_CONTEXT),
|
||||
m_currentUid(0),
|
||||
m_currentTs(0),
|
||||
m_eventCount(0),
|
||||
m_pendingEventCount(0),
|
||||
m_events(nullptr),
|
||||
m_lookAhead(TimeStep(0))
|
||||
{
|
||||
m_systemId = 0;
|
||||
m_systemCount = 0;
|
||||
m_uid = EventId::UID::VALID;
|
||||
m_stop = false;
|
||||
m_currentContext = Simulator::NO_CONTEXT;
|
||||
m_currentUid = 0;
|
||||
m_currentTs = 0;
|
||||
m_eventCount = 0;
|
||||
m_pendingEventCount = 0;
|
||||
m_events = 0;
|
||||
m_lookAhead = TimeStep(0);
|
||||
}
|
||||
|
||||
LogicalProcess::~LogicalProcess()
|
||||
@@ -82,7 +82,7 @@ LogicalProcess::CalculateLookAhead()
|
||||
{
|
||||
m_lookAhead = Time::Max() / 2 - TimeStep(1);
|
||||
NodeContainer c = NodeContainer::GetGlobal();
|
||||
for (NodeContainer::Iterator iter = c.Begin(); iter != c.End(); ++iter)
|
||||
for (auto iter = c.Begin(); iter != c.End(); ++iter)
|
||||
{
|
||||
#ifdef NS3_MPI
|
||||
if (((*iter)->GetSystemId() >> 16) != m_systemId)
|
||||
@@ -241,8 +241,7 @@ LogicalProcess::ScheduleWithContext(LogicalProcess* remote,
|
||||
else
|
||||
{
|
||||
ev.key.m_uid = EventId::UID::INVALID;
|
||||
remote->m_mailbox[m_systemId].push_back(
|
||||
std::make_tuple(m_currentTs, m_systemId, m_uid, ev));
|
||||
remote->m_mailbox[m_systemId].emplace_back(m_currentTs, m_systemId, m_uid, ev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,16 +287,9 @@ LogicalProcess::Remove(const EventId& id)
|
||||
bool
|
||||
LogicalProcess::IsExpired(const EventId& id) const
|
||||
{
|
||||
if (id.PeekEventImpl() == 0 || id.GetTs() < m_currentTs ||
|
||||
return id.PeekEventImpl() == nullptr || id.GetTs() < m_currentTs ||
|
||||
(id.GetTs() == m_currentTs && id.GetUid() <= m_currentUid) ||
|
||||
id.PeekEventImpl()->IsCancelled())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
id.PeekEventImpl()->IsCancelled();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -233,7 +233,8 @@ MtpInterface::ProcessOneRound()
|
||||
|
||||
// logical process barriar synchronization
|
||||
while (g_finishedSystemCount.load(std::memory_order_acquire) != g_systemCount)
|
||||
;
|
||||
{
|
||||
};
|
||||
|
||||
// stage 2: process the public LP
|
||||
g_systems[0].ProcessOneRound();
|
||||
@@ -256,7 +257,8 @@ MtpInterface::ProcessOneRound()
|
||||
|
||||
// logical process barriar synchronization
|
||||
while (g_finishedSystemCount.load(std::memory_order_acquire) != g_systemCount)
|
||||
;
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
void
|
||||
@@ -324,7 +326,8 @@ MtpInterface::ThreadFunc(void* arg)
|
||||
if (index >= g_systemCount)
|
||||
{
|
||||
while (g_systemIndex.load(std::memory_order_acquire) >= g_systemCount)
|
||||
;
|
||||
{
|
||||
};
|
||||
continue;
|
||||
}
|
||||
LogicalProcess* system = &g_systems[g_sortedSystemIndices[index]];
|
||||
|
||||
Reference in New Issue
Block a user