diff --git a/src/mpi/examples/nms-p2p-nix-distributed.cc b/src/mpi/examples/nms-p2p-nix-distributed.cc index 24063fe9d..905018f3b 100644 --- a/src/mpi/examples/nms-p2p-nix-distributed.cc +++ b/src/mpi/examples/nms-p2p-nix-distributed.cc @@ -70,25 +70,12 @@ main (int argc, char *argv[]) typedef std::vector vectorOfNetDeviceContainer; typedef std::vector vectorOfVectorOfNetDeviceContainer; - // Enable parallel simulator with the command line arguments - MpiInterface::Enable (&argc, &argv); - - SinkTracer::Init (); - SystemWallClockMs t0; // Total time SystemWallClockMs t1; // Setup time SystemWallClockMs t2; // Run time/ t0.Start (); t1.Start (); - uint32_t systemId = MpiInterface::GetSystemId (); - uint32_t systemCount = MpiInterface::GetSize (); - - RANK0COUT (" ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << std::endl); - - GlobalValue::Bind ("SimulatorImplementationType", - StringValue ("ns3::DistributedSimulatorImpl")); - uint32_t nCN = 2; uint32_t nLANClients = 10; bool single = 0; @@ -110,6 +97,20 @@ main (int argc, char *argv[]) cmd.Parse (argc,argv); + // Enable parallel simulator with the command line arguments + MpiInterface::Enable (&argc, &argv); + + SinkTracer::Init (); + + uint32_t systemId = MpiInterface::GetSystemId (); + uint32_t systemCount = MpiInterface::GetSize (); + + RANK0COUT (" ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << std::endl); + + GlobalValue::Bind ("SimulatorImplementationType", + StringValue ("ns3::DistributedSimulatorImpl")); + + if (nCN < 2) { RANK0COUT ("Number of total CNs (" << nCN << ") lower than minimum of 2" diff --git a/src/mpi/examples/simple-distributed-mpi-comm.cc b/src/mpi/examples/simple-distributed-mpi-comm.cc index 822fc0c9e..e1cbc53b6 100644 --- a/src/mpi/examples/simple-distributed-mpi-comm.cc +++ b/src/mpi/examples/simple-distributed-mpi-comm.cc @@ -127,7 +127,7 @@ main (int argc, char *argv[]) bool testing = false; // Parse command line - CommandLine cmd; + CommandLine cmd(__FILE__); cmd.AddValue ("nix", "Enable the use of nix-vector or global routing", nix); cmd.AddValue ("nullmsg", "Enable the use of null-message synchronization (instead of granted time window)", nullmsg); cmd.AddValue ("tracing", "Enable pcap tracing", tracing);