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
Update mpcd initialization for v4 #1580
Conversation
CellList is not yet ported and C++ tests will segfault.
Please maintain equal performance for non-MPCD users and be aware of the Write as little or as detailed information in the change log and migration guide as you prefer. |
… and out of range values
Sounds good! We will check in #1538 and apply to MPCD since it was copied originally. For non-MPCD users, I think these changes will fully preserve performance since there is very little overhead to the empty MPCD data structures, similarly to the topology data structures. We can be even more aggressive than we currently are, though, and not allocate any MPCD data if there are no particles present in the snapshot. For MPCD users, I anticipate
( FYI: this is still a WIP, but we are getting closer. |
The flags BUILD_MPCD and BUILD_VALIDATION (which appears to only be used in mpcd) are undocumented either by HOOMD or by the command |
@cslominski |
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things to cleanup and then this is ready for review.
I accidentally merged trunk-major
in when I meant trunk-minor
. I think this did not add anything, and I still just need to merge in trunk-minor
and fix small merge conflicts.
|
Correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far on the C++ code, it looks like all the necessary changes have been made there!
Now, the python side of the code needs to be updated. Python classes need to be reorganized to use the new data structures for exposing properties in python. The names of the classes should also be capitalized and base classes should not have underscores before the class names.
After that, some basic tests can be written which make sure the python classes are functioning properly. I think some of the current C++ tests can be replaced by equivalent python tests, but that is an optional detail for later.
All suggestions have been applied! For your other comments:
Yes, this will be done in many additional pull requests. This PR only implements the particle data / initialization interfaces, as the rest of the code cannot be tested without this change. The next PR should be the
Yes, there is an entire suite of Python tests that was removed during the v3 port and needs to be copied over & updated: https://github.com/glotzerlab/hoomd-blue/tree/v2.9.7/hoomd/mpcd/test-py For example,
I do not plan to replace the C++ tests because (1) they are already written and (2) test some things that are critical for the algorithm to work correctly but are not (and should not be) exposed at the Python level. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! FWIW, I think the rest of the python stuff can be done in a single PR and doesn't need to be split up into a long series.
@joaander and I had discussed this a while ago, and we both think doing this in a few PRs will be easier to review. The MPCD python code & tests are probably a few thousand lines. Some of the MPCD objects also don't derive from any of the existing HOOMD classes, so new code will be needed there. I am of course planning to logically group changes into PRs when possible! |
Ok, whatever works. |
There is still one open review request from @klywang, but I think this PR is otherwise ready to merge! Does somebody need to manually trigger the validation tests? Maybe I can do that, but I'm not sure how. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have one change request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Description
Update snapshot and system data to new API, currently work in progress.
To be more consistent with the new initialization API, the MPCD snapshot data structure is integrated into the HOOMD snapshot data so that MPCD particle data is synced with the HOOMD system. We are going to move the MPCD
SystemData
into the HOOMDSystemDefinition
so that the the core data structures are also more closely synced during the simulation. This will simplify processes like initializing, replicating, etc.Motivation and context
It didn't work anymore. :)
This is the first step in #775. Additional PRs will follow to migrate other features. These PRs will all be targeted onto
mpcd-v4
as a staging branch, which is based offv4.0.0
. This branch can eventually be merged intotrunk-minor
in a feature release because v3 did not have MPCD as part of its API.How has this been tested?
Unit tests are being ported to pytest as features are moved.
Change log
Checklist:
sphinx-doc/credits.rst
) in the pull request source branch.