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

[WIP] Using std::normal_distribution in place of inverse transform sampling #203

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matt-graham
Copy link

Description

Would fix #196.

Changes manual implementation of inverse transform sampling using boost::math::erf_inv to generate normally distributed random variates when sampling thermally distributed initial particle velocities to instead use the generator implementation for std::normal_distribution. Microbenchmarking suggests this is slightly more performant, but the main gain is that the intent of the code is (hopefully) clearer.

Opening this a draft PR at the moment as I haven't be able to build locally to test due to #202 and ExCALIBUR-NEPTUNE/NESO-Particles/issues/37

Type of change

  • New feature (non-breaking change which adds functionality)

Testing

Please describe the tests that you ran to verify your changes and provide instructions for reproducibility. Please also list any relevant details for your test configuration.

  • Test Foo in /test/path/to/file_for_test_Foo.cpp
  • Description of test Foo
  • Test Bar in /test/path/to/file_for_test_Bar.cpp
  • Description of test Bar

Test Configuration:

  • OS:
  • SYCL implementation:
  • MPI details:
  • Hardware:

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any new dependencies are automatically built for users via cmake (checked as no new dependencies added)
  • I have used understandable variable names
  • I have run clang-format against my *.hpp and *.cpp changes
  • I have run cmake-format against my changes to CMakeLists.txt (checked as no changes to CMakeLists.txt files)
  • I have run black against changes to *.py (checked as no changes to *.py files)
  • I have made corresponding changes to the documentation (checked as I don't think this should require any changes to documentation)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas (checked as I think this change should make code more self-documenting without need for additional comments)
  • My changes generate no new warnings

@matt-graham matt-graham marked this pull request as draft August 2, 2023 17:11
@oparry-ukaea
Copy link
Contributor

Hi @matt-graham, @cmacmackin,
Any reason this can't be merged now?

@matt-graham
Copy link
Author

Hi @oparry-ukaea. Sorry this dropped off my radar a bit as I had issues with trying to get NESO to build (using Spack) to run the test suite against the changes locally. Other than this wasn't any other reason for this still being draft from my perspective.

@matt-graham
Copy link
Author

I've just rebased against current main and tried building using Spack but still hitting against issue described in #202

@oparry-ukaea
Copy link
Contributor

Is this building in a spack/ubuntu-jammy container? If so, which version?

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.

Using std::normal_distribution rather than inverse transform sampling?
3 participants