-
Notifications
You must be signed in to change notification settings - Fork 667
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
Adopt a reader for live-streamed Interactive MD (IMD) version 3 trajectories #4827
Comments
Thank you for the detailed proposal. I am in favor of moving the light-weight IMDReader into MDAnalysis.coordinates as part of our effort to make MDAnalysis fully streaming capable. What are additional dependencies that would come with IMDReader, i.e., which packages outside the standard dependencies that MDAnalysis already pulls in? Do we already have a conda-forge package for IMDClient? |
For quick overview, see @ljwoods2 's presentation 03-Streaming_MDAnalysis_Functionality-Woods.ipynb from the IMD Streaming Workshop. |
@orbeckst We wouldn't be introducing any new dependencies- the imdclient package uses nothing except numpy arrays and the python standard library. In the future, we may want to rewrite parts of the IMDClient in cython (if needed after benchmarking), but that's nothing new. @hcho38 is currently working on conda, will check in with him |
Here is the link to the conda-forge recipe: https://github.com/hcho38/imd-staged-recipes/tree/develop Here is the link to the pull request: conda-forge/staged-recipes#28554 @ljwoods2 @amruthesht can you guys leave a comment on the PR confirming you are willing to be listed as one of the maintainers? |
Thank you for getting the conda-forge package up, @hcho38 ! |
It looks like with the IMDReader you'll have to pull It seems like |
Just a side note, I love |
@jaclark5 Good point with As for generalizing the |
@yuxuanzhuang I like the idea of being able to serve any (even prewritten) trajectories via IMD, so I'm open to this idea. As-is, it's fairly test-specific (with methods like Opened Becksteinlab/imdclient#48 for this |
Hi all, sorry it has taken me so long to get to this, and thanks for the comments @jaclark5 and @yuxuanzhuang. I agree with basically everything said so far. The rapid iteration part of developing the IMDReader is largely over and I think adopting a base class + IMDReader into core is the right move, allowing generalisation, tight integration and make streaming a first class citizen. As already pointed out I think it seems to be a fairly clean break, with minimal deps introduced. I am happy to go ahead with this as the plan. I think the main work for core will be in deciding on a path forward for #4828 A few points
|
Apologies I'm just coming off the holiday break and have not had a lot of time to think this through yet. I agree that handling trajectory streams is a v3.0 target for MDAnalysis, but I'm also starting to feel like this is exactly the use case for having MDAKits - nothing presented here seems to indicate that we need to have this in core, and everthing is somewhat optional. If it's not too much to ask, could someone possibly lay out what advantages we gain from having this in core over just having this as an optional MDAKit that folks need to install alongisde the core library? |
Is your feature request related to a problem?
Streaming trajectories directly into MDAnalysis is one of the MDA 3.0 milestones. Specifically, streaming a trajectory directly from a simulation engine into MDA enables a few keys things that aren't otherwise possible:
The Interactive MD (IMD) version 3 protocol, which builds on the IMDv2 protocol already implemented in GROMACS, NAMD, and LAMMPS, is the most effective way to achieve this "in-situ" analysis since it requires only minimal changes from the working IMDv2 implementations made to work with VMD.
MDAnalysis can quickly gain the ability to read a trajectory via this protocol using the reader API by adopting the code in imdclient, an MDAKit built in a collaboration between @orbeckst and @HeydenLabASU.
Already, we have a working implementation in GROMACS, LAMMPS, and NAMD (private) which are integration tested against the IMDClient in the imdclient repo:
Describe the solution you'd like
MDAnalysis adopts the IMDReader, brings on imdclient as an optional dependency
I propose that the core MDAnalysis codebase adopt the IMDReader as a trajectory reader with imdclient (which contains the IMDClient) as an optional dependency for MDAnalysis exactly in the same way
h5py
is an optional dependency that allows using theH5MDReader
The
IMDClient
handles the protocol communication at a binary level, wrapping it with a simple API:get_imdframe()
: returns a singularIMDFrame
(similar to aTimestep
) of data from the simulation engineget_imdsessioninfo()
: returns the data the user can expect in eachIMDFrame
stop()
: ensures socket cleanup occursThe
IMDReader
is just essentially a wrapper/adapter for theIMDClient
which makes it compatible with the MDAnalysis reader API.This way of structuring the code allows offloading the complicated simulation engine integration tests (which include docker containers and take quite a while to run) to the imdclient MDAKit dependency and allows other people outside of MDAnalysis to use the IMDv3 protocol without needing the
IMDReader
.Currently, both the
IMDReader
andIMDClient
are in the imdclient MDAKit for development purposes.Protocol + integration tests go in the imdclient MDAKit, but reader API tests go in MDAnalysis
I also propose splitting up the tests into lightweight reader api tests that work with a "dummy" simulation engine (https://github.com/Becksteinlab/imdclient/blob/main/imdclient/tests/test_imdreader.py) and the more complicated protocol and simulation engine integration tests (protocol https://github.com/Becksteinlab/imdclient/blob/main/imdclient/tests/test_imdclient.py) (integration https://github.com/Becksteinlab/imdclient/blob/main/imdclient/tests/base.py).
MDAnalysis can adopt the lightweight tests that are relevant to MDAnalysis, and the imdclient MDAKit can keep everything else.
Summary
Things that move to MDAnalysis:
Things that stay in imdclient, the proposed dependency:
Describe alternatives you've considered
Keep the
IMDReader
in the imdclient repository, never adopting it in the main codebase.The text was updated successfully, but these errors were encountered: