Marcello-Sega / pytim

a python package for the interfacial analysis of molecular simulations
https://marcello-sega.github.io/pytim/
GNU General Public License v3.0
78 stars 34 forks source link

MDAnalysis 2.0.0 issues #356

Closed rowanwalker96 closed 2 years ago

rowanwalker96 commented 2 years ago

Hi there,

I'm finding that when I upgrade my MDAnalysis package to the latest version 2.0.0 pytim stops working for me. It imports fine but pytim.ITIM hangs when called on a Universe.

Creating a conda environment with the previous MDAnalysis version 1.1.1 seemingly solves the issue: conda create -n new_env -c conda-forge mdanalysis=1.1 pytim

I would like to be able to use the latest version of MDAnalysis as Universes can now be pickled paving the way to easier parallel analyses. Do you know if this would be true of a Universe that has first been analysed with pytim.ITIM?

Cheers, Rowan

Marcello-Sega commented 2 years ago

Hi and thank you for letting me know. I will look into this and get back to you as soon as possible.

M

On Sat 22. Jan 2022 at 16:07, Rowan Walker @.**@.>> wrote:

Hi there,

I'm finding that when I upgrade my MDAnalysis package to the latest version 2.0.0 pytim stops working for me. It imports fine but pytim.ITIM hangs when called on a Universe.

Creating a conda environment with the previous MDAnalysis version 1.1.1 seemingly solves the issue: conda create -n new_env -c conda-forge mdanalysis=1.1 pytim

I would like to be able to use the latest version of MDAnalysis as Universes can now be pickled paving the way to easier parallel analyses. Do you know if this would be true of a Universe that has first been analysed with pytim.ITIM?

Cheers, Rowan

— Reply to this email directly, view it on GitHubhttps://github.com/Marcello-Sega/pytim/issues/356, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADRZD53QV5WQVFOIZY4DXTUXLB2TANCNFSM5MSCQV7Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.***>



Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Volker Rieke Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr. Astrid Lambrecht, Prof. Dr. Frauke Melchior


Marcello-Sega commented 2 years ago

So, a quick test with MDAnalysis 2.0.0 does not show any problem for me:

In [1]: import MDAnalysis as mda
   ...: import pytim
   ...: from pytim.datafiles import LJ_GRO,LJ_SHORT_XTC
   ...: print('mda version:',mda.__version__)
   ...: u = mda.Universe(LJ_GRO,LJ_SHORT_XTC)
   ...: inter = pytim.ITIM(u)
   ...: for ts in u.trajectory[:2]:
   ...:     print(inter.layers[0,0].n_atoms)
   ...: 
   ...: 
mda version: 2.0.0
1227
1184

This is with the latest commit from the master branch.

Could you post a minimal example that triggers the issue? Then it would be easier for me to understand what's going wrong. Let me know also which version of pytim you are using.

Marcello-Sega commented 2 years ago

In the meantime, I fixed some issues with MDA 2.0.0. They went unnoticed because Travis dropped support. Now I switched to CircleCI and automated testing should be back on track.

Please check your issue also with v0.9.0 from the GitHub repo. I will soon provide packages for PyPI and Conda.

Marcello-Sega commented 2 years ago

PyPI and Anaconda packages for v0.9.0 are now available

rowanwalker96 commented 2 years ago

Thanks so much for getting back to me! The issue is resolved with the v0.9.0 PyPI package. Conda-forge channel still shows v0.8.4, will this update soon?

The issue I had can be recreated with: conda create -n test -c conda-forge mdanalysis pytim=0.8.4

then if I ctrl-C out of pytim.ITIM hanging:

`

import pytim from pytim.datafiles import WATER_GRO import MDAnalysis as mda u = mda.Universe(WATER_GRO) inter = pytim.ITIM(u,max_layers=4) ^CTraceback (most recent call last): File "", line 1, in File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/site-packages/pytim/itim.py", line 226, in init self._assign_layers() File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/site-packages/pytim/itim.py", line 390, in _assign_layers for index, group in enumerate(queue[uplow].get()): File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/multiprocessing/queues.py", line 103, in get res = self._recv_bytes() File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/multiprocessing/connection.py", line 221, in recv_bytes buf = self._recv_bytes(maxlength) File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/multiprocessing/connection.py", line 419, in _recv_bytes buf = self._recv(4) File "/u/mk/ptch0465/softwaresrc/anaconda3/envs/test/lib/python3.9/multiprocessing/connection.py", line 384, in _recv chunk = read(handle, remaining) KeyboardInterrupt`

Marcello-Sega commented 2 years ago

OK, thanks for the details, that was clearly a problem with multiproc, which, apparently, was triggered only using conda. At the moment I have no idea why that happened, but I will make sure to test the conda packages in the future to avoid problems like this, thanks a lot for reporting the issue!

About the package, I see v0.9.0 already available on https://anaconda.org/conda-forge/pytim But it might well be that from your location you are accessing another mirror, try to wait a bit and refresh the page.

~If it's ok with you, I would then close the issue, let me know.~

Marcello-Sega commented 2 years ago

BTW, it would be great if you could report on any successful/unsuccessful experience with parallel analysis.

rowanwalker96 commented 2 years ago

Ok so unfortunately the multiproc issue is still occuring with the v0.9.0 package downloaded with conda

If I create a conda environment and then instead install pytim v0.9.0 with the PyPI package there are no issues. Parallel analyses (such as those outlined here: https://yuxuanzhuang.github.io/UserGuide/examples/analysis/custom_parallel_analysis.html#Parallelization-in-a-split-apply-combine-fashion) on a Universe that has first been analysed with pytim.ITIM are also successful. I will play around further and get back to you.

Marcello-Sega commented 2 years ago

OK. I'd suggest first trying with multiproc disabled, e.g.

inter = pytim.ITIM(u,max_layers=4, multiproc=False)

to check that there are no other issues.

Marcello-Sega commented 2 years ago

Maybe related to this issue ?

rowanwalker96 commented 2 years ago

my mistake sorry, conda v0.9.0 package is working fine, my new conda environment was still using a previous PyPI 0.8.4 version

thanks again, happy to close the issue, if I find anything interesting re parallel analysis I will let you know :)

Marcello-Sega commented 2 years ago

great, thanks!