Bugzilla – Bug 974
Unexpected behavior when running Python simulations using ns3::RealtimeSimulatorImpl
Last modified: 2010-08-09 12:42:34 EDT
By default the python binding for Simulator.Run() (See [1]) executes ns3::Simulator::RunOneEvent() inside a loop instead of directly invoking the ns3::Simulator::Run() method. This produces an unexpected behavior when using ns3::RealtimeSimulatorImpl because no time synchronization is done inside the loop. (See [2] "It is expected that if there are any realtime requirements, the responsibility for synchronizing with real time in an external event loop will be picked up by that loop.") One possible solution could be to invoke ns3::Simulator::Run() by default, but this will cause signals to be ignored by default also (See [3]). Another solution would be to provide the realtime synchronization inside the loop. [1] http://code.nsnam.org/ns-3-dev/file/48625d668186/bindings/python/ns3module_helpers.cc line 284 [2] http://code.nsnam.org/ns-3-dev/file/48625d668186/src/simulator/realtime-simulator-impl.cc line 490 [3] http://www.nsnam.org/bugzilla/show_bug.cgi?id=375
I think we should call Simulator::Run by default for when the scheduler is a real-time one. It will ignore signals, but at least it runs. It's complicated to catch signals reliably when threads are involved...
That would work.
*** This bug has been marked as a duplicate of bug 631 ***