Skip to content
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

Fix data race in sascorer.py #2744

Merged
merged 1 commit into from
Oct 31, 2019
Merged

Fix data race in sascorer.py #2744

merged 1 commit into from
Oct 31, 2019

Conversation

skearnes
Copy link
Contributor

When using SA_Score in a parallel setting, I sometimes get random failures due to calculateScore reading from an intermediate value of _fscores. This PR avoids updating the global variable until the loaded features are ready for use.

Copy link
Contributor

@bp-kelley bp-kelley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This certainly is the easiest solution. I'd be tempted to refactor into a better lazy initialization, but the cost of doing this work more than once isn't very high.

@greglandrum greglandrum added this to the 2019_09_2 milestone Oct 31, 2019
@greglandrum greglandrum merged commit 2630959 into rdkit:master Oct 31, 2019
@greglandrum
Copy link
Member

Thanks @skearnes !

@skearnes skearnes deleted the sascore branch October 31, 2019 17:18
greglandrum pushed a commit that referenced this pull request Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants