hoomd-blue
hoomd-blue copied to clipboard
Reimplement MPCD solvent forces
Description
This PR adds back the ability to apply a body force on the solvent. The force is a class that is attached to a streaming method.
This PR also removes the complicated machinery that was in place to do GPU polymorphism, which barely worked with CUDA and did not work with ROCm. Instead, classes are now templated.
This PR should be merged after #1691.
Motivation and context
Solvent forces are an important feature for people using MPCD. This also fixes a long-time issue with polymorphism that prevented hoomd.mpcd from compiling for AMD GPUs.
Resolves #663
How has this been tested?
The force API and streaming method are tested at the Python level. The forces themselves are tested by a reimplemented C++ test.
Change log
N/A, but it could be noted that GPUPolymorph
was removed. As far as I know, it has only been used in one spot in the MPCD code, and it has some pretty severe limitations with compilation.
Checklist:
- [X] I have reviewed the Contributor Guidelines.
- [X] I agree with the terms of the HOOMD-blue Contributor Agreement.
- [X] My name is on the list of contributors (
sphinx-doc/credits.rst
) in the pull request source branch.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Not stale
I applied Tommy's suggestion on the unit tests and replied on the other one, so this should be ready to merge!
Have you tested mpcd on an AMD GPU?
I unfortunately don't have access to an AMD GPU. I removed Jens' comment about MPCD not working with AMD GPUs because I remember that issue was related to device polymorphism, which is removed in this PR. (Jens had added CMake code to stop compilation of MPCD for AMD with HIP.)
@joaander unless you want to hold off due to the comment about AMD above, could you merge this when you get a chance? Thanks!
I will build the mpcd-v4 branch and run tests on Frontier when I get a chance. I would like to do that before merging mpcd-v4 into a trunk branch.
That would be great, thanks! If possible, let's do that as the final step before merging as there may be one or two more C++ refactorings if I have time.
I'll add this to the checklist in #775 .