-
Notifications
You must be signed in to change notification settings - Fork 676
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
Limit numpy thread usage for Transformation
classes
#2950
Merged
IAlibay
merged 33 commits into
MDAnalysis:develop
from
yuxuanzhuang:trans_single_thread
Apr 10, 2021
Merged
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b8441ff
add threadlimit deco
604fa1b
add threadlimit deco
yuxuanzhuang 0ed46f9
add dep
yuxuanzhuang b41a739
runtime change
yuxuanzhuang 3941281
context mananger instead of decor
yuxuanzhuang 326e105
working decor
yuxuanzhuang b4daa8d
create TransformationBase and thread limit
yuxuanzhuang d686f06
travis threadpool
yuxuanzhuang af6bab8
deco to context due to picklibility
yuxuanzhuang 5f985e9
pep
yuxuanzhuang efbc3f8
docs
yuxuanzhuang ded5f84
Merge remote-tracking branch 'mda_origin/develop' into trans_single_t…
yuxuanzhuang e2cd996
change to kwargs
yuxuanzhuang f084d33
add test for transformation base
yuxuanzhuang 67aeda2
changelog
yuxuanzhuang d363c0b
appveyor
yuxuanzhuang 34d370e
travis threadpool for arm
yuxuanzhuang 01570c4
remove deco threadlimit
yuxuanzhuang 383b1f5
doc for transformation
yuxuanzhuang 317e5e2
merge to dev
yuxuanzhuang 0fb4d85
typo
yuxuanzhuang 9365e5f
merge to develop
yuxuanzhuang 353bfa9
make threadpoolctl a requirement
yuxuanzhuang fdd8f52
base documentation
yuxuanzhuang edb5ef5
doc for transformation fix
yuxuanzhuang 7884210
box dimension rework
yuxuanzhuang 636ae12
add threadpoolctl to azure
yuxuanzhuang 1ea51df
add threadpoolctl to gh ci
yuxuanzhuang 197deb9
merge to develop
yuxuanzhuang e2ca135
add threadpoolctl to ppc64le
yuxuanzhuang aba771f
cov notimplement error transformation
yuxuanzhuang 890e2b3
add note for maxthread=1
yuxuanzhuang 17d4cb4
changelog for threadpooltcl
yuxuanzhuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,6 +202,8 @@ | |
import functools | ||
from functools import wraps | ||
import textwrap | ||
from contextlib import ContextDecorator | ||
from threadpoolctl import threadpool_limits | ||
|
||
import mmtf | ||
import numpy as np | ||
|
@@ -2353,3 +2355,11 @@ def check_box(box): | |
if np.all(box[3:] == 90.): | ||
return 'ortho', box[:3] | ||
return 'tri_vecs', triclinic_vectors(box) | ||
|
||
|
||
class threadpool_limits_decorator(threadpool_limits, ContextDecorator): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm probably missing something very obvious, is this being used anywhere anymore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, not really. It turns out to be not that useful in this case. |
||
def __enter__(self): | ||
return self | ||
|
||
def __exit__(self, *exc): | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threadpoolctl isn't a core dependency, so as it is, it will fail when running on minimal dependencies.