[ndnSIM] Simulating multithreaded applications.

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu Oct 20 13:15:14 PDT 2016


More detailed explanation:

Some people have been working on that:

http://mailman.isi.edu/pipermail/ns-developers/2009-July/006197.html <http://mailman.isi.edu/pipermail/ns-developers/2009-July/006197.html>
https://www.nsnam.org/doxygen/classns3_1_1_system_thread.html <https://www.nsnam.org/doxygen/classns3_1_1_system_thread.html>

However, when you have a simulation scenario and you do Simulator::Run, the thread that handles this operation will have an event queue, where all events will be scheduled and the ns3 library maintains global state. Even if you manage to make it work, all the threads will access the same shared state and data (and most probably the output of the simulation will not make sense):

http://stackoverflow.com/questions/35543906/parallel-simulations-using-ns3-and-stdthread <http://stackoverflow.com/questions/35543906/parallel-simulations-using-ns3-and-stdthread>

So, overall, while it might be possible, it is not recommended, since you have to partition the accessed memory and the data on your own:

https://www.nsnam.org/workshops/wns3-2010/parallelization.pdf <https://www.nsnam.org/workshops/wns3-2010/parallelization.pdf>

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA


> On Oct 20, 2016, at 10:16 AM, Spyridon (Spyros) Mastorakis <mastorakis at CS.UCLA.EDU> wrote:
> 
> Hi Anil,
> 
> unfortunately, NS3 is single threaded and is based on scheduling and executing events….
> 
> I do not think that something like that is possible. You can use MPI to parallelize simulations, but this is just for performance optimization purposes.
> 
> Hope that this helps.
> 
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> Internet Research Laboratory
> Computer Science Department
> UCLA
> 
> 
>> On Oct 20, 2016, at 10:13 AM, Anil Jangam <anilj.mailing at gmail.com <mailto:anilj.mailing at gmail.com>> wrote:
>> 
>> Hi.
>> 
>> Is there any special care to be taken while porting an already written multithreaded application into ndnSIM? 
>> 
>> I did not find any specific mention of it in the guide here:
>> http://ndnsim.net/2.1/guide-to-simulate-real-apps.html <http://ndnsim.net/2.1/guide-to-simulate-real-apps.html>
>> 
>> /anil.
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20161020/f034e103/attachment.html>


More information about the ndnSIM mailing list