MDAnalysis / waterdynamics

Analysis of water dynamics in molecular dynamics trajectories and water interactions with other molecules.
https://mdanalysis.org/waterdynamics
GNU General Public License v2.0
5 stars 4 forks source link

Parallel Computing of water dynamics analysis #24

Open robinzyb opened 1 year ago

robinzyb commented 1 year ago

Is your feature request related to a problem?

Dear developers, I would like to suggest adding parallel computing for water dynamics analysis. In https://docs.mdanalysis.org/2.4.1/_modules/MDAnalysis/analysis/waterdynamics.html#WaterOrientationalRelaxation. Especially, the water orientational relaxation.

Describe the solution you'd like

I would like to implement by myself if there are some coding conventions/instructions to follow for parallel computing in MDA

Describe alternatives you've considered

Additional context

yuxuanzhuang commented 1 year ago

Hi, just skimming through the code, there seem to be two parts that can be accelerated with parallel computing. 1) _selection_serial 2) _getMeanOnePoint.

For the second part, there's a tutorial about how to convert a per-frame analysis function into a parallel analysis class in (https://userguide.mdanalysis.org/dev/examples/analysis/custom_parallel_analysis.html). You could start from here.

robinzyb commented 1 year ago

thank you !

IAlibay commented 1 year ago

Overall the waterdynamics code needs to get refactored to use AnalysisBase. There is a lot that could be improved that we can't do right now because it doesn't adhere to our standard API.

orbeckst commented 1 year ago

I'd say until someone rewrites waterdynamics to follow the standard API, we will not have the capacity to parallelize the code.

robinzyb commented 4 months ago

hi, just to confirm. Is this the standard API you mentioned? https://docs.mdanalysis.org/stable/documentation_pages/analysis/base.html#writing-new-analysis-tools I recently got time to rewrite this functionality

orbeckst commented 4 months ago

Yes, exactly — derive from AnalysisBase.

robinzyb commented 4 months ago

Hello, the autocorrelation function is required in water orientation analysis. however, I only found a special version of autocorrelation function for survival probability. https://docs.mdanalysis.org/stable/documentation_pages/lib/correlations.html#autocorrelation-function

Is there a general autocorrelation function implemented elsewhere or not? If not, I can write one for 3-dim vector properties and put it in the MDAnalysis.lib.correlations

robinzyb commented 4 months ago

I found one from https://github.com/MDAnalysis/transport-analysis/blob/main/transport_analysis/velocityautocorr.py