-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors in callbacks don't terminate simulation #140
Comments
In |
@roelof-groenewald I don't think that actually solves it, because the Instead my best guess is that the C callback wrappers need to check for some type of error code before continuing on with normal program flow after each callback completes. |
That makes sense. We can follow that same logic in the actual callback though (in
I tested that and it does kill the simulation. |
The best would be to add an argument ( |
That works for me. You should add a print of the full traceback too, not just the exception name, see eg https://stackoverflow.com/questions/9555133/e-printstacktrace-equivalent-in-python It's possible upstream will not appreciate it, now that I think about it, because it might not (likely doesn't?) work on multinode jobs. |
Surprisingly, the error in #139 persisted in large part because it didn't terminate simulations:
I saw commentary on the same thing here: hannorein/rebound#479
My thoughts are that a comment in that page, that C still needs to free everything etc., makes sense, but that we also don't want python errors to be ignored since they're integral - if we want them ignored, we should be careful with try/except clauses ourselves.
So I would like to figure out how to terminate simulations when this occurs.
FYI @KZhu-ME @roelof-groenewald
The text was updated successfully, but these errors were encountered: