mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Freeze when letting model run

Open patrickkidd opened this issue 3 years ago • 4 comments

Describe the bug I am seeing freezes when letting a model run on it's own.

Expected behavior The model would continue to run at any number of agents and any frame rate.

To Reproduce It isn't yet clear how to reproduce this. I also can't figure out if it's frozen in the javascript or python interpreter. I've tried setting breakpoints in both and no success yet. So for now just posting in case others have observed this.

Model in question: https://github.com/patrickkidd/systems-models To run: $ python run.py --models mythematical

patrickkidd avatar May 19 '22 18:05 patrickkidd

Interesting. Have you tried letting the model run without the server? That way we can at least exclude the possibility that it is a model issue

Corvince avatar May 19 '22 20:05 Corvince

How would that work since each step makes a request to the server?

patrickkidd avatar May 19 '22 20:05 patrickkidd

I meant just a script a la

import MyModel 
model = MyModel()
while True:
    model.step()

But I haven't really looked at your model to see if you are doing something special with the server

Corvince avatar May 19 '22 20:05 Corvince

I suspect this is in the browser. The page won't redraw when it's stuck, and I can't get model.step() to freeze in a loop. Plus, model.step() doesn't hit any I/O so it would have to be an infinite loop, and I'm seeing this just as sporadically on the examples as well. Hitting pause in the server debugger steps out on the select() call which tells me tornado was waiting on the socket.

patrickkidd avatar May 20 '22 02:05 patrickkidd