A Discrete-Event Network Simulator
API
bench-scheduler.cc File Reference
#include <iomanip>
#include <iostream>
#include <fstream>
#include <vector>
#include <string.h>
#include "ns3/core-module.h"
+ Include dependency graph for bench-scheduler.cc:

Go to the source code of this file.

Classes

class  Bench
 Benchmark instance which can do a single run. More...
 

Macros

#define DEB(x)   if (g_debug) { LOGME (x); }
 Log debugging output. More...
 
#define LOG(x)   std::cout << x << std::endl
 Log to std::cout. More...
 
#define LOGME(x)   LOG (g_me << x)
 Log with program name prefix. More...
 

Functions

Ptr< RandomVariableStreamGetRandomStream (std::string filename)
 Create a RandomVariableStream to generate next event delays. More...
 
void Run (ObjectFactory &factory, uint32_t pop, uint32_t total, uint32_t runs, Ptr< RandomVariableStream > eventStream, bool calRev)
 Perform the runs for a single scheduler type. More...
 

Variables

bool g_debug = false
 Flag to write debugging output. More...
 
int g_fwidth = 6
 Output field width for numeric data. More...
 
std::string g_me
 Name of this program. More...
 

Macro Definition Documentation

◆ DEB

#define DEB (   x)    if (g_debug) { LOGME (x); }

Log debugging output.

Definition at line 41 of file bench-scheduler.cc.

◆ LOG

#define LOG (   x)    std::cout << x << std::endl

Log to std::cout.

Definition at line 37 of file bench-scheduler.cc.

◆ LOGME

#define LOGME (   x)    LOG (g_me << x)

Log with program name prefix.

Definition at line 39 of file bench-scheduler.cc.

Function Documentation

◆ GetRandomStream()

Ptr< RandomVariableStream > GetRandomStream ( std::string  filename)

Create a RandomVariableStream to generate next event delays.

If the filename parameter is empty a default exponential time distribution will be used, with mean delay of 100 ns.

If the filename is - standard input will be used.

Parameters
[in]filenameThe delay interval source file name.
Returns
The RandomVariableStream.

Definition at line 180 of file bench-scheduler.cc.

References LOG, and ns3::ObjectBase::SetAttribute().

+ Here is the call graph for this function:

◆ Run()

void Run ( ObjectFactory factory,
uint32_t  pop,
uint32_t  total,
uint32_t  runs,
Ptr< RandomVariableStream eventStream,
bool  calRev 
)

Perform the runs for a single scheduler type.

This will create and set the scheduler, then execute a priming run followed by the number of data runs requsted.

Output will be in the form of a table showing performance for each run.

Parameters
[in]factoryFactory pre-configured to create the desired Scheduler.
[in]popThe event population size.
[in]totalThe total number of events to execute.
[in]runsThe number of replications.
[in]eventStreamThe random stream of event delays.
[in]calRevFor the CalendarScheduler, whether to set the Reverse attribute.

Definition at line 248 of file bench-scheduler.cc.

References DEB, g_fwidth, ns3::TypeId::GetName(), ns3::ObjectFactory::GetTypeId(), LOG, Bench::RunBench(), Bench::SetPopulation(), Bench::SetRandomStream(), and Bench::SetTotal().

Referenced by DsdvManetExample::CaseRun(), BatteryLifetimeTest::ConstantLoadTest(), BasicEnergyDepletionTest::DepletionTestCase(), UanTest::DoOnePhyTest(), ChainRegressionTest::DoRun(), Bug772ChainTest::DoRun(), ThreeGppHttpObjectTestCase::DoRun(), TcpEndPointBug2211Test::DoRun(), TcpSynConnectionFailedTest::DoRun(), LteCellSelectionTestCase::DoRun(), LtePrimaryCellChangeTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteSecondaryCellHandoverTestCase::DoRun(), LteSecondaryCellSelectionTestCase::DoRun(), LteUeMeasurementsPiecewiseTestCase1::DoRun(), LteUeMeasurementsPiecewiseTestCase2::DoRun(), LteUeMeasurementsPiecewiseTestCase3::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), HwmpRtableTest::DoRun(), HwmpProactiveRegressionTest::DoRun(), HwmpReactiveRegressionTest::DoRun(), HwmpSimplestRegressionTest::DoRun(), HwmpDoRfRegressionTest::DoRun(), PeerManagementProtocolRegressionTest::DoRun(), FlameRegressionTest::DoRun(), FlameRtableTest::DoRun(), Ns2MobilityHelperTest::DoRun(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), UdpEchoClientSetFillTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), OutdoorRandomWalkTestCase::DoRun(), ThreeGppV2vUrbanLosNlosvChCondModelTestCase::DoRun(), ThreeGppV2vHighwayLosNlosvChCondModelTestCase::DoRun(), SimulatorEventsTestCase::DoRun(), SimulatorTemplateTestCase::DoRun(), ThreadedSimulatorEventsTestCase::DoRun(), TimerTemplateTestCase::DoRun(), DsrSendBuffTest::DoRun(), BasicEnergyHarvesterTestCase::DoRun(), LiIonEnergyTestCase::DoRun(), DhcpTestCase::DoRun(), RadvdTestCase::DoRun(), GlobalRouteManagerImplTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), Ipv4DeduplicationTest::DoRun(), Ipv4DeduplicationPerformanceTest::DoRun(), Ipv4FragmentationTest::DoRun(), LinkTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), Ipv4PacketInfoTagTest::DoRun(), Ipv4RipSplitHorizonStrategyTest::DoRun(), Ipv6DadTest::DoRun(), DualStackTestCase::DoRun(), Ipv6FragmentationTest::DoRun(), Ipv6PacketInfoTagTest::DoRun(), Ipv6RipngSplitHorizonStrategyTest::DoRun(), DynamicNeighborCacheTest::DoRun(), ChannelTest::DoRun(), NetDeviceContainerTest::DoRun(), InterfaceContainerTest::DoRun(), FlushTest::DoRun(), DuplicateTest::DoRun(), DynamicPartialTest::DoRun(), TcpBicIncrementTest::DoRun(), TcpBicDecrementTest::DoRun(), TcpDctcpToLinuxReno::DoRun(), TcpHtcpIncrementTest::DoRun(), TcpLedbatToNewReno::DoRun(), TcpLedbatIncrementTest::DoRun(), TcpLedbatDecrementTest::DoRun(), TcpRateLinuxBasicTest::DoRun(), TcpRateLinuxWithBufferTest::DoRun(), TcpTestCase::DoRun(), TimestampValueTestCase::DoRun(), TcpTxBufferTestCase::DoRun(), UdpSocketLoopbackTest::DoRun(), Udp6SocketLoopbackTest::DoRun(), LrWpanAckTestCase::DoRun(), LrWpanCcaTestCase::DoRun(), LrWpanCollisionTestCase::DoRun(), LrWpanEdTestCase::DoRun(), LrWpanErrorDistanceTestCase::DoRun(), LrWpanDataIfsTestCase::DoRun(), TestRxOffWhenIdleAfterCsmaFailure::DoRun(), TestActiveScanPanDescriptors::DoRun(), LrWpanSlottedCsmacaTestCase::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), CarrierAggregationConfigTestCase::DoRun(), CarrierAggregationTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LteCqiGenerationTestCase::DoRun(), LteCqiGenerationDlPowerControlTestCase::DoRun(), LteDownlinkPowerControlTestCase::DoRun(), LteDownlinkPowerControlRrcConnectionReconfigurationTestCase::DoRun(), LteDownlinkDataSinrTestCase::DoRun(), LteDownlinkCtrlSinrTestCase::DoRun(), LenaFdBetFfMacSchedulerTestCase1::DoRun(), LenaFdBetFfMacSchedulerTestCase2::DoRun(), LenaFdMtFfMacSchedulerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteHardFrTestCase::DoRun(), LteStrictFrTestCase::DoRun(), LteStrictFrAreaTestCase::DoRun(), LteSoftFrAreaTestCase::DoRun(), LteSoftFfrAreaTestCase::DoRun(), LteEnhancedFfrAreaTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LenaHarqTestCase::DoRun(), LteInterferenceHardFrTestCase::DoRun(), LteInterferenceStrictFrTestCase::DoRun(), LteInterferenceTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteLinkAdaptationTestCase::DoRun(), LenaMimoTestCase::DoRun(), LtePathlossModelSystemTestCase::DoRun(), LenaPfFfMacSchedulerTestCase1::DoRun(), LenaPfFfMacSchedulerTestCase2::DoRun(), LenaDataPhyErrorModelTestCase::DoRun(), LenaDlCtrlPhyErrorModelTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LteRlcAmE2eTestCase::DoRun(), LteRlcAmTransmitterOneSduTestCase::DoRun(), LteRlcAmTransmitterSegmentationTestCase::DoRun(), LteRlcAmTransmitterConcatenationTestCase::DoRun(), LteRlcAmTransmitterReportBufferStatusTestCase::DoRun(), LteRlcUmE2eTestCase::DoRun(), LteRlcUmTransmitterOneSduTestCase::DoRun(), LteRlcUmTransmitterSegmentationTestCase::DoRun(), LteRlcUmTransmitterConcatenationTestCase::DoRun(), LteRlcUmTransmitterReportBufferStatusTestCase::DoRun(), LenaRrFfMacSchedulerTestCase::DoRun(), LenaTdBetFfMacSchedulerTestCase1::DoRun(), LenaTdBetFfMacSchedulerTestCase2::DoRun(), LenaTdMtFfMacSchedulerTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaTtaFfMacSchedulerTestCase::DoRun(), LteUeMeasurementsTestCase::DoRun(), LteUplinkOpenLoopPowerControlTestCase::DoRun(), LteUplinkClosedLoopPowerControlAbsoluteModeTestCase::DoRun(), LteUplinkClosedLoopPowerControlAccumulatedModeTestCase::DoRun(), LteUplinkDataSinrTestCase::DoRun(), LteUplinkSrsSinrTestCase::DoRun(), LteEnbAntennaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverDelayTestCase::DoRun(), LteRrcConnectionEstablishmentTestCase::DoRun(), LteRrcConnectionEstablishmentErrorTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), WaypointLazyNotifyFalse::DoRun(), WaypointLazyNotifyTrue::DoRun(), WaypointInitialPositionIsWaypoint::DoRun(), WaypointMobilityModelViaHelper::DoRun(), MobilityTraceTestCase::DoRun(), SteadyStateRandomWaypointTest::DoRun(), WaypointMobilityModelNotifyTest::DoRun(), WaypointMobilityModelAddWaypointTest::DoRun(), AbstractAnimationInterfaceTestCase::DoRun(), ErrorModelSimple::DoRun(), BurstErrorModelSimple::DoRun(), PacketSocketAppsTest::DoRun(), NixVectorRoutingTest::DoRun(), PointToPointTest::DoRun(), ThreeGppChannelConditionModelTestCase::DoRun(), V2vUrbanProbChCondModelTestCase::DoRun(), V2vHighwayProbChCondModelTestCase::DoRun(), SixlowpanFragmentationTest::DoRun(), SixlowpanIphcStatefulImplTest::DoRun(), SpectrumIdealPhyTestCase::DoRun(), SpectrumInterferenceTestCase::DoRun(), WaveformGeneratorTestCase::DoRun(), ThreeGppChannelMatrixComputationTest::DoRun(), ThreeGppChannelMatrixUpdateTest::DoRun(), ThreeGppSpectrumPropagationLossModelTest::DoRun(), ProbeTestCase1::DoRun(), CsmaBridgeTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaOneSubnetTestCase::DoRun(), CsmaPacketSocketTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), FqCobaltQueueDiscEcnMarking::DoRun(), FqCobaltQueueDiscL4sMode::DoRun(), FqCoDelQueueDiscECNMarking::DoRun(), FqCoDelQueueDiscL4sMode::DoRun(), FqPieQueueDiscL4sMode::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCaseP2P::DoRun(), Ns3TcpSocketTestCaseCsma::DoRun(), Ns3TcpStateTestCase::DoRun(), WifiAcMappingTest::DoRun(), Issue211Test::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), CobaltQueueDiscMarkTest::DoRun(), CobaltQueueDiscCeThresholdTest::DoRun(), CobaltQueueDiscEnhancedBlueTest::DoRun(), CoDelQueueDiscBasicDrop::DoRun(), CoDelQueueDiscBasicMark::DoRun(), TcFlowControlTestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), AcousticModemEnergyDepletionTestCase::DoRun(), ChannelCoordinationTestCase::DoRun(), ChannelRoutingTestCase::DoRun(), ChannelAccessTestCase::DoRun(), AnnexC_TestCase::DoRun(), OcbWifiMacTestCase::DoRun(), WifiChannelSwitchingTest::DoRun(), MultiLinkSetupTest::DoRun(), WifiPhyThresholdsWeakWifiSignalTest::DoRun(), WifiPhyThresholdsWeakForeignSignalTest::DoRun(), WifiPhyThresholdsStrongWifiSignalTest::DoRun(), WifiPhyThresholdsStrongForeignSignalTest::DoRun(), Ns3WimaxNetworkEntryTestCase::DoRun(), Ns3WimaxManagementConnectionsTestCase::DoRun(), Ns3WimaxSfCreationTestCase::DoRun(), BlockAckRecipientBufferTest::DoRun(), BlockAckAggregationDisabledTest::DoRun(), LargestIdlePrimaryChannelTest::DoRun(), SpectrumWifiPhyBasicTest::DoRun(), SpectrumWifiPhyListenerTest::DoRun(), PreservePacketsInAmpdus::DoRun(), WifiUseAvailBwTest::DoRun(), OfdmaAckSequenceTest::DoRun(), TestUlOfdmaPpduUid::DoRun(), TestMultipleHeTbPreambles::DoRun(), TestPhyPaddingExclusion::DoRun(), TestThresholdPreambleDetectionWithoutFrameCapture::DoRun(), TestThresholdPreambleDetectionWithFrameCapture::DoRun(), TestSimpleFrameCaptureModel::DoRun(), TestPhyHeadersReception::DoRun(), TestAmpduReception::DoRun(), TestUnsupportedModulationReception::DoRun(), WifiPrimaryChannelsTest::DoRun(), InterferenceHelperSequenceTest::DoRun(), DcfImmediateAccessBroadcastTestCase::DoRun(), Bug730TestCase::DoRun(), QosFragmentationTestCase::DoRun(), Bug2222TestCase::DoRun(), Bug2843TestCase::DoRun(), Bug2831TestCase::DoRun(), StaWifiMacScanningTestCase::DoRun(), Issue169TestCase::DoRun(), IdealRateManagerChannelWidthTest::DoRun(), IdealRateManagerMimoTest::DoRun(), WifiTxopTest::DoRun(), Ns3WimaxSimpleOFDMTestCase::DoRunOnce(), Ns3WimaxSFTypeTestCase::DoRunOnce(), Ns3WimaxSchedulingTestCase::DoRunOnce(), TimerTemplateTestCase::DoTeardown(), ChannelAccessManagerTest< TxopType >::EndTest(), experiment(), LteAggregationThroughputScaleTestCase::GetThroughput(), AodvExample::Run(), TracerouteExample::Run(), NeighborCacheExample::Run(), MeshTest::Run(), VanetRoutingExperiment::Run(), Experiment::Run(), RoutingExperiment::Run(), CollisionExperiment::Run(), InterferenceExperiment::Run(), PsrExperiment::Run(), NetAnimExperiment::Run(), AredQueueDiscTestCase::RunAredDiscTest(), Bench::RunBench(), CobaltQueueDiscDropTest::RunDropTest(), TestInterBssConstantObssPdAlgo::RunOne(), SpectrumWifiPhyFilterTest::RunOne(), WifiPhyCcaIndicationTest::RunOne(), TestDlOfdmaPhyTransmission::RunOne(), TestDlOfdmaPhyPuncturing::RunOne(), TestUlOfdmaPhyTransmission::RunOne(), TestUlOfdmaPowerControl::RunOne(), Issue40TestCase::RunOne(), WifiTest::RunOne(), PieQueueDiscTestCase::RunPieTest(), Bug2470TestCase::RunSubtest(), TbfQueueDiscTestCase::RunTbfTest(), ThreeGppShadowingTestCase::RunTest(), UdpSocketImplTest::SendData(), Ipv4ForwardingTest::SendData(), Ipv4GlobalRoutingSlash32TestCase::SendData(), Ipv4RawSocketImplTest::SendData(), Ipv4RipTest::SendData(), Ipv4RipCountToInfinityTest::SendData(), Ipv4StaticRoutingSlash32TestCase::SendData(), Ipv6ForwardingTest::SendData(), Ipv6RawSocketImplTest::SendData(), Ipv6RipngTest::SendData(), Ipv6RipngCountToInfinityTest::SendData(), SixlowpanHc1ImplTest::SendData(), SixlowpanIphcImplTest::SendData(), Ipv4RawSocketImplTest::SendData_IpHdr(), Ipv4HeaderTest::SendData_IpHdr_Dscp(), UdpSocketImplTest::SendDataTo(), Udp6SocketImplTest::SendDataTo(), WaveNetDeviceExample::SendIpExample(), WaveNetDeviceExample::SendWsaExample(), WaveNetDeviceExample::SendWsmpExample(), BasicEnergyUpdateTest::StateSwitchTest(), TestDeterministic(), TestDeterministicByTime(), TestProbabilistic(), PowerRateAdaptationTest::TestRrpaa(), and BatteryLifetimeTest::VariableLoadTest().

+ Here is the call graph for this function:

Variable Documentation

◆ g_debug

bool g_debug = false

Flag to write debugging output.

Definition at line 32 of file bench-scheduler.cc.

◆ g_fwidth

int g_fwidth = 6

Output field width for numeric data.

Definition at line 44 of file bench-scheduler.cc.

Referenced by Run(), and Bench::RunBench().

◆ g_me

std::string g_me

Name of this program.

Definition at line 35 of file bench-scheduler.cc.