Bug 974 - Unexpected behavior when running Python simulations using ns3::RealtimeSimulatorImpl
Unexpected behavior when running Python simulations using ns3::RealtimeSimula...
Status: RESOLVED DUPLICATE of bug 631
Product: ns-3
Classification: Unclassified
Component: python bindings
pre-release
All All
: P5 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-05 08:37 EDT by alina
Modified: 2010-08-09 12:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alina 2010-08-05 08:37:09 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
Comment 1 Gustavo J. A. M. Carneiro 2010-08-05 12:38:36 EDT
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...
Comment 2 alina 2010-08-09 06:34:00 EDT
That would work.
Comment 3 Gustavo J. A. M. Carneiro 2010-08-09 12:42:34 EDT

*** This bug has been marked as a duplicate of bug 631 ***