-
Notifications
You must be signed in to change notification settings - Fork 41
Description
This is something I actually fixed in #1774 but the fix accidentally didn't make it into the v1.9 release.
Our protocols try/except around the reporter & sampler creation as well as the simulation running now. The idea is that in the finally step, we clean up any leftover objects, since those tend to be slow to be garbage collected (if at all) and can lead to memory bloating in executors like Alchemiscale.
Historically this was only around the simulation running, but now it's been extended to the sampler & reporter creation. However, because of this, there's a non-zero way that you can crash early (e.g. during sampler or integrator creation) and hit the finally block. This will then lead to an UnboundLocalError, since e.g. the sampler hasn't been created yet.