Skip to content

Wrap GCMC push/pop pairs in try/finally to guard against crashes#131

Merged
lohedges merged 1 commit intodevelfrom
fix_loch_14
Mar 24, 2026
Merged

Wrap GCMC push/pop pairs in try/finally to guard against crashes#131
lohedges merged 1 commit intodevelfrom
fix_loch_14

Conversation

@lohedges
Copy link
Copy Markdown
Contributor

This PR is related to openbiosim/loch/#15:

When a GCMC simulation crashes mid-move, the paired pop() call after gcmc_sampler.push() is never reached, leaving the CUDA context stack unbalanced. All push/pop pairs around GCMC operations in both the repex and base runners are now wrapped in try/finally to guarantee the context is always popped, even when an exception propagates. This also adds the missing push/pop pairs to the base runner, which had GCMC move calls but no context management at all.

@lohedges lohedges added the bug Something isn't working label Mar 24, 2026
@lohedges lohedges merged commit dca175e into devel Mar 24, 2026
4 checks passed
@lohedges lohedges deleted the fix_loch_14 branch March 24, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant