Skip to content
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

use pickle of ag to transport information #65

Closed
wants to merge 8 commits into from
Closed

Conversation

kain88-de
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

"""helper function to actually setup dask graph"""
with timeit() as b_universe:
u = mda.Universe(top, traj)
agroups = [u.atoms[idx] for idx in indices]
agroups = [pickle.loads(idx) for idx in pickles]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E   RuntimeError: Couldn't find a suitable Universe to unpickle AtomGroup onto with Universe hash '63ae64d5-94f2-42e5-ad84-cb7f89970d36'.  Available hashes: 303e8959-6b17-49ee-9910-9528cf5ee0d5

@richardjgowers the simple pickle solution doesn't work. The universe Hash values are different for some reason.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kain88-de it's not actually hashing the Universe, it's just creating a uuid when the Universe is created. So when you create a new Universe from the same files it "hashes" different.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I also need to pickle the universe?

@richardjgowers
Copy link
Member

richardjgowers commented Sep 20, 2018 via email

@kain88-de
Copy link
Member Author

I have no idea how to use the anchor thingy. The documentation isn't clear on this.

@kain88-de
Copy link
Member Author

kain88-de commented Sep 20, 2018

So I cannot pickle a Universe object because the __setstate__ and __getstate__ functions are missing. This leaves the anchor thingy. If you can explain me how to use it I will give it a try.

@kain88-de
Copy link
Member Author

@richardjgowers

Anchor thingy works about 90% of the time to unpickle an atomgroup. Unfortunately, the results are really off now. Did I make a mistake in using the anchors? I guessed my usage from the code in MDAnalysis.

Also this looks like an error in MDAnalysis.

 RuntimeError: Couldn't find a suitable Universe to unpickle AtomGroup onto with Universe hash 'c66d4379-9abc-46d6-91da-b31dc1a37af0'.  Available hashes: c66d4379-9abc-46d6-91da-b31dc1a37af0

@richardjgowers
Copy link
Member

@kain88-de yeah that looks right. The tests look like they're failing because the trajectory isn't being used

That second one looks like a bug, maybe it's a bytes/str difference?

@kain88-de
Copy link
Member Author

kain88-de commented Sep 20, 2018 via email

@richardjgowers
Copy link
Member

richardjgowers commented Sep 20, 2018 via email

@kain88-de
Copy link
Member Author

Yeah but I don't understand how this would happen. In the old code where I use the indices of the atomgroups everything works and the universe is iterated as expected. Using the anchors and pickling of atomgroups it fails. I don't see how the atomgroups are not linked to the trajectory.

@kain88-de
Copy link
Member Author

looks like my rebase broke something

@richardjgowers
Copy link
Member

@kain88-de I'm going to catch up with people at the workshop to understand how dask works here, so hopefully I'll understand this enough to help out..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants