Skip to content

Conversation

@sleweke-bayer
Copy link
Contributor

@sleweke-bayer sleweke-bayer commented Feb 21, 2025

Adds a timeout implemented as a callback.
The timeout is exposed as an API method and as a field in the file format (/input/solver/TIMEOUT).

Fixes #351

Adds a timeout for simulations that is implemented as a callback.
Notifications are now also sent whenever a linear system is solved,
which occurs during Newton iteration.

The timeout is exposed via the C-API.
Adds a dedicated return code for situations where the
underlying simulator has not been initialized before
calling the API method.
@jbreue16
Copy link
Contributor

I guess the next step is for @schmoelder to test this?

Add a MultiCallback that calls multiple sub-callbacks. Moves callback
handling to the Driver to avoid duplication.
@schmoelder
Copy link
Contributor

Hey, first of all, thanks again for adding this feature and sorry for taking so long to test and review it.

Admittedly, the modification of the C-API has made things a bit more cumbersome than expected, leading to a segfault in CADET-Python.

Maybe I misunderstood @sleweke-bayer, but I was under the impression that this change would still be backward compatible, meaning older versions of CADET-Python should still be able to use it, right?

If that's not the case, I propose we revert the changes to the C-API and, for now, only allow specifying a timeout via the configuration.

Once we have a better system to maintain different versions of the C-API without crashing everything, we can still add this feature again later.

But I might be wrong. Hopefully, this didn't cause too much work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Support timeout for running simulations with C-API

4 participants