hoomd-blue icon indicating copy to clipboard operation
hoomd-blue copied to clipboard

Reimplement MPCD solvent forces

Open mphoward opened this issue 1 year ago • 4 comments

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:

mphoward avatar Jan 31 '24 23:01 mphoward

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.

github-actions[bot] avatar Feb 21 '24 19:02 github-actions[bot]

Not stale

mphoward avatar Feb 21 '24 19:02 mphoward

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.)

mphoward avatar Mar 03 '24 03:03 mphoward

@joaander unless you want to hold off due to the comment about AMD above, could you merge this when you get a chance? Thanks!

mphoward avatar Mar 04 '24 20:03 mphoward

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.

joaander avatar Mar 05 '24 13:03 joaander

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 .

mphoward avatar Mar 05 '24 13:03 mphoward