Recently doing ns-3 network simulation, but when the network topology is relatively large or high speed, the simulation efficiency is very low.
Learn how Ns-3 's MPI module can improve simulation efficiency and start learning.
The whole process is divided into two steps:
1. Install Openmpi under Linux system. You can refer to the following two articles:
http://blog.csdn.net/jacketinsysu/article/details/44840611
Http://www.linuxidc.com/Linux/2015-04/116448.htm
After I have operated on these two articles, running MPIRUN-NP 4 Hello_c can succeed, but when you reopen the terminal and run again, the following error occurs
Mpirun:error while loading shared libraries:libopen-rte.so.20:cannot open Shared object file:no such file or directory
After trying, you can solve the following methods:
Update the file/sbin/ldconfig-v with the command, otherwise the problem remains.
2. Successfully run the simple-distributed.cc file in ns-3
Command 1:sudo gedit/etc/profile open the file and join the ns-3 path:
Finally, the last two behaviors of this file:
Export Ld_library_path= $LD _library_path:/usr/local/lib
Export Ld_library_path= $LD _library_path:/home/jing/m_allfile/project/sourceinsight/ns3sourcefile/ ns-allinone-3.25/ns-3.25
The first line of the path is the Ubuntu system installation Openmpi path;
The path of the second behavior ns-3.
Command 2:source/etc/profile
Update source
Command 3:sudo/sbin/ldconfig-v
Then, you can run the ns-3 simple-distributed.cc file:
Command:MPIRUN-NP 2./waf--run scratch/simple-distributed
Results: At time 1.02264s packet sink received bytes from 10.1.1.1 ports 49153 total Rx bytes
At time 1.0235s packet sink received bytes from 10.1.2.1 ports 49153 total Rx bytes
At time 1.02437s packet sink received bytes from 10.1.3.1 ports 49153 total Rx bytes
At time 1.02524s packet sink received bytes from 10.1.4.1 ports 49153 total Rx bytes
End---
Ubuntu installation Openmpi && ns-3 MPI