[Ns-bugs] [Bug 631] RealtimeSimulatorImpl not compatible with python bindings

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Mon Jul 13 06:02:39 PDT 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=631





--- Comment #10 from Mathieu Lacage <mathieu.lacage at sophia.inria.fr>  2009-07-13 09:02:38 EDT ---
(In reply to comment #9)
> > what I wanted to point out but forgot to is that it should be perfectly
> > possible to add a Simulator::SetMonitoringCallback (Callback<void> cb);
> > which is called regularly by the simulation code and you could call
> > PyErr_CheckSignals from that callback. [other variants on this theme are easy
> > to code]
> 
> Calling PyErr_CheckSignals for _every_ scheduler iteration is bad for
> performance, because you also have to acquire the Python GIL (Global
> Interpreter Lock).  The current code does this every 100 events by default.

I would expect you (callee) to implement a counter and avoid costly checks
based on the value of this counter.

> Also without RunOne you will make me jump through hoops in order to get
> real-time visualization to work (assuming I will have time one day to port
> ns-3-pyviz to ns-3-dev).  Not nice.

Ok, so, what are the requirements of ns-3-pyviz ? What would be the problem if
you used the above-mentioned callback to perform regular runs of the GTK/QT
mainloop ?

> > The key here is that it allows the simulator code much more leeway in doing
> > what it needs to do.
> > 
> 
> All I ask is to keep the default (and most important one!) scheduler to work as
> before.  Forget about parallel/realtime/whatever, those are cool but not
> exactly what most people are going to use.  I think you are giving it excessive
> importance.  No offense intended to whoever is putting hard work into
> implementing them! :)

If these simulators can't implement all the methods from
src/simulator/simulator.h, then, yes, people will not use them very much but
this is a self-fulfilling profecy. 

What I am trying to do is to make sure _every_ simulator can replace the other
simulators (it's not the case, already). And I am not talking about removing
functionality to do this. I am merely trying to find out what is the proper API
we can expose which gives you the functionality you need and which is
implementable correctly by every simulator.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list