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

Pair hpmc angular step potential #1728

Merged
merged 29 commits into from
Mar 18, 2024
Merged

Pair hpmc angular step potential #1728

merged 29 commits into from
Mar 18, 2024

Conversation

melodyyzh
Copy link
Contributor

@melodyyzh melodyyzh commented Feb 26, 2024

Description

This PR adds angular step potential to the hpmc pair potential class.

Motivation and context

CPPotential will be replaced by the new class of pair potentials in hoomd-blue in the version 4.6 release with the removal of llvm's JIT engine. AngularStep potential is a type of pair potential that includes an isotropic component (e.g., LJ) and an angular step function that describes the patch interaction.

Partially Resolves #1652

How has this been tested?

In progress of writing validation tests.

Change log

Added:
* `pair.AngularStep` to replace `CPPPotential` for patch interactions.

Checklist:

@joaander joaander self-assigned this Feb 29, 2024
@joaander joaander changed the base branch from trunk-minor to hpmc-union-potential March 1, 2024 17:51
Base automatically changed from hpmc-union-potential to trunk-minor March 4, 2024 18:35
@joaander
Copy link
Member

joaander commented Mar 6, 2024

Validation tests run on 853ba7c merged with the step potential branch: glotzerlab/hoomd-validation#89

patchy_particle_pressure_compare_density0 95_temperature1 0_pressure10 209_chi0 7_4096particles_epsilonrepulsive1 0

@melodyyzh melodyyzh marked this pull request as ready for review March 7, 2024 16:39
@melodyyzh melodyyzh requested review from a team, joaander and tommy-waltmann and removed request for a team March 7, 2024 16:39
@melodyyzh melodyyzh requested review from rayasare and removed request for a team March 7, 2024 16:39
hoomd/hpmc/pair/angular_step.py Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.cc Outdated Show resolved Hide resolved
hoomd/hpmc/pytest/test_pair_angular_step.py Show resolved Hide resolved
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks!

I revised the documentation directly. My other suggestions are below.

I also benchmarked the code to confirm that cos and a non-inlined maskingFunction are indeed performance penalties:

  76.71%  python3  _hpmc.cpython-311-x86_64-linux-gnu.so              [.] hoomd::hpmc::IntegratorHPMCMono<hoomd::hpmc::ShapeSphere>::update(unsigne◆
   5.64%  python3  _hpmc.cpython-311-x86_64-linux-gnu.so              [.] hoomd::hpmc::PairPotentialAngularStep::maskingFunction(double, hoomd::vec▒
   2.86%  python3  libm.so.6                                          [.] __cos_fma                                                                ▒
   1.26%  python3  _hpmc.cpython-311-x86_64-linux-gnu.so              [.] void hoomd::hpmc::move_rotate<3u, hoomd::RandomGenerator>(hoomd::quat<dou▒
   1.08%  python3  _hoomd.cpython-311-x86_64-linux-gnu.so             [.] hoomd::SFCPackTuner::generateTraversalOrder(int, int, int, int, int, unsi▒
   0.97%  python3  _hpmc.cpython-311-x86_64-linux-gnu.so              [.] hoomd::hpmc::PairPotentialAngularStep::energy(double, hoomd::vec3<double>▒
   0.60%  python3  [unknown]                                         

perf reports these two methods as the top two after the main MC update method.

hoomd/hpmc/PairPotentialAngularStep.h Outdated Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.h Outdated Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.h Outdated Show resolved Hide resolved
hoomd/hpmc/pair/angular_step.py Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.h Show resolved Hide resolved
hoomd/hpmc/pytest/test_pair_angular_step.py Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.cc Outdated Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.cc Outdated Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.cc Outdated Show resolved Hide resolved
hoomd/hpmc/PairPotentialAngularStep.cc Outdated Show resolved Hide resolved
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

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

Thanks!

@melodyyzh
Copy link
Contributor Author

pre-commit.ci autofix

@joaander joaander added the validate Execute long running validation tests on pull requests label Mar 18, 2024
@joaander joaander merged commit 92644a3 into trunk-minor Mar 18, 2024
72 of 73 checks passed
@joaander joaander deleted the pair-hpmc-angularStep branch March 18, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants