-
Notifications
You must be signed in to change notification settings - Fork 639
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
PositionAverager Transformation ends up with wrong results with parallel analysis #2996
Comments
There are going to be some transformations that are not parallel-safe. It's great when we can make it work but that might not always be easy and require different algorithms. Can we just add a boolean attribute to the TransformationBase class |
Yes, I think this is precisely the case here. Position averaging is intrinsically history-dependent, and as such it'll not play nice with block parallelization. |
@yuxuanzhuang let's add |
Fixes #2996 ## Work done in this PR - Adds a TransformationBase class - TransformationBase uses threadpoolctl to allow the number of threads used to be limited in order to improve performance. - TransformationBase also includes a check for whether a transformation is parallelizable. - Refactors existing transformation classes to use TransformationBase.
I am not sure I agree with the way this was implemented. Later, if the user wants to control parallelization from the instantiation/run of an Analysis, PMDA and friends will/should provide ways to force serial behavior. What do you think? If you agree with a change, we're still in time to correct the API before |
I agree it is more pythonic to have it as a class attribute but given we don't yet have a definite API for parallel analysis nor is this |
First of all apologies that I mistakenly exemplified with the Analysis case, not the Transformations. Regarding Are there examples where the same transformation might be parallelizable or not, depending on intialization? I mean here the framewise parallelizability, but I guess we could discriminate multiple parallel possibilities if instead of a single attr we have this as a dict; i.e.: |
Expected behavior
The results are the same as serial analysis
Actual behavior
Due to the splitting approach, a new
PositionAverager
will be created for each block; no previous memory (self.coord_array
) is saved.Code to reproduce the behavior
Current version of MDAnalysis
python -c "import MDAnalysis as mda; print(mda.__version__)"
) 2.0.0-devpython -V
)? 3.8The text was updated successfully, but these errors were encountered: