Hi there!
I'm playing aroung with distributed simulation in ns-3, I read the documentation and I've already execute the simple-distribution.cc examples comes in ns-3, then I tried to extend this scenario without any result... Always had an error, so I decided to create a very simple scenario, let's say a "hello world" and doesn't work neither. This is the code:
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mpi-interface.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "ns3/ipv4-static-routing-helper.h"
#include "ns3/ipv4-list-routing-helper.h"
#include "ns3/point-to-point-helper.h"
#include "ns3/internet-stack-helper.h"
#include "ns3/ipv4-nix-vector-helper.h"
#include "ns3/ipv4-address-helper.h"
#include "ns3/on-off-helper.h"
#include "ns3/packet-sink-helper.h"
#ifdef NS3_MPI
#include <mpi.h>
#endif
using namespace ns3;
NS_LOG_COMPONENT_DEFINE ("hwmpi");
int main (int argc, char *argv[])
{
#ifdef NS3_MPI
GlobalValue::Bind ("SimulatorImplementationType", StringValue ("ns3::DistributedSimulatorImpl"));
// Enable parallel simulator with the command line arguments
MpiInterface::Enable (&argc, &argv);
std::cout << " System Count " << MpiInterface::GetSize () << std::endl;
NodeContainer nodes;
nodes.Create (5, 0);
NodeContainer nodes1;
nodes1.Create (5, 1);
NodeContainer nodes2;
nodes2.Create (5, 2);
// Exit the MPI execution environment
MpiInterface::Disable ();
return 0;
#else
NS_FATAL_ERROR ("Can't use distributed simulator without MPI compiled in");
#endif
}
And my command to execute that is:
mpirun -np 4 ./waf --run filenameThe error is something about shared memory...
OSError: [Errno 2] No such file or directory
OSError: [Errno 2] No such file or directoryunable to create shared memory BTL coordinating strucure :: size 134217728I read about it but I can't to understand what I'm doing wrong... BTW my OpenMPI version is 1.8.5 and the ns-3 is version 3.22
Any help will be welcome,
Cheers,
~V