markovmodel / PyEMMA

🚂 Python API for Emma's Markov Model Algorithms 🚂
http://pyemma.org
GNU Lesser General Public License v3.0
306 stars 119 forks source link

implied timescales with hmsm #1582

Open drdoppio opened 1 year ago

drdoppio commented 1 year ago

I want to calculate implied timescale using the hidden markov state model with version 2.5.12:

import pyemma.msm as msm nstates = 4 lags = [1,2,5,10,20,25,50] its = msm.timescales_hmsm(dtrajs, nstates, lags=lags, errors='bayes', nsamples=250, n_jobs=-1)

the calculation hangs at the beginning: estimating BayesianHMSM: 0%

clonker commented 1 year ago

Can you try setting n_jobs=1? Depending on your linear algebra system implementation, parallelizing timescales can sometimes mess with the internal parallelization of bayesian hmsm estimation.

drdoppio commented 1 year ago

Indeed it works with n_jobs=1. Even when njobs=2 the calculations halts. Thanks a lot for the answer.

mmfarrugia commented 1 year ago

I just found this as I was searching for any pyemms.msm.its related issues and thought I'd note that this also occurs when calling pyemma.msm.its with MLE MSM as well as Bayesian MSM (neither are HMSM):

its = pyemma.msm.its(cluster.dtrajs, lags=50, nits=5)

and

its = pyemma.msm.its(cluster.dtrajs, lags=50, nits=5, errors='bayes')

I found this when running the "00" pentapeptide tutorial so steps to reproduce are simply from the tutorial and using the pre-made pyemma conda environment (plus latest of mdshare and a couple minor changes to fix a numpy incompatibility which are described in ) on a distributed network.

However, adding the n_jobs=1 argument fixed my problem as well:

its = pyemma.msm.its(cluster.dtrajs, lags=50, nits=5, n_jobs=1)

Thank you!

mabianchet commented 1 year ago

Happen to me also

its = pyemma.msm.its(cluster.dtrajs, lags=50, nits=5, errors='bayes') in a linux box on Mac work fine...

The notebook 03-03 - MSM estimation and validation hangs forever, and also n_jobs=1 fix it!!

appears to be related to python multiprocessing

I upgrade to version '2.5.12+0.g5315b869.dirty', which addresses an issue with multiprocessing without luck...