Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactor HLL, HLLC, HLLD Solvers #855

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

Open
wants to merge 63 commits into
base: master
Choose a base branch
Loading
from

Conversation

mohdsaid497566
Copy link
Collaborator

@mohdsaid497566 mohdsaid497566 commented Jun 2, 2025

Description

Refactor Riemann Solvers and relevant subroutines

Fixes #(issue) [optional]

Type of change

Please delete options that are not relevant.

  • Refactored solvers
  • Implemented a wave speed subroutine

Scope

  • reducing subroutines' sizes

How Has This Been Tested?

  • Compilation, ./mfc.sh test

Test Configuration:

  • What computers and compilers did you use to test this:
    Locally

Checklist

  • I have added comments for the new code
  • I added Doxygen docstrings to the new code
  • I have made corresponding changes to the documentation (docs/)
  • I have added regression tests to the test suite so that people can verify in the future that the feature is behaving as expected
  • I have added example cases in examples/ that demonstrate my new feature performing as expected.
    They run to completion and demonstrate "interesting physics"
  • I ran ./mfc.sh format before committing my code
  • New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
  • This PR does not introduce any repeated code (it follows the DRY principle)
  • I cannot think of a way to condense this code and reduce any introduced additional line count

If your code changes any code source files (anything in src/simulation)

To make sure the code is performing as expected on GPU devices, I have:

  • Checked that the code compiles using NVHPC compilers
  • Checked that the code compiles using CRAY compilers
  • Ran the code on either V100, A100, or H100 GPUs and ensured the new feature performed as expected (the GPU results match the CPU results)
  • Ran the code on MI200+ GPUs and ensure the new features performed as expected (the GPU results match the CPU results)
  • Enclosed the new feature via nvtx ranges so that they can be identified in profiles
  • Ran a Nsight Systems profile using ./mfc.sh run XXXX --gpu -t simulation --nsys, and have attached the output file (.nsys-rep) and plain text results to this PR
  • Ran a Rocprof Systems profile using ./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace, and have attached the output file and plain text results to this PR.
  • Ran my code using various numbers of different GPUs (1, 2, and 8, for example) in parallel and made sure that the results scale similarly to what happens if you run without the new code/feature

@mohdsaid497566 mohdsaid497566 requested a review from a team as a code owner June 2, 2025 06:39
@sbryngelson
Copy link
Member

The PR looks like it may have gotten some help from a GPT of some kind, which is fine. But make sure it compiles and passes tests on your local laptop or a cluster you have access to before submitting the PR.

@mohdsaid497566
Copy link
Collaborator Author

failed tests mostly Hypoelasticity

Failed test tests/9EB947DB: 1D -> Hypoelasticity -> 1 Fluid(s) after 3 attempt(s).
Failed test tests/32A3A936: 1D -> Hypoelasticity -> 1 Fluid(s) -> cont_damage after 3 attempt(s).
Failed test tests/AF0BCEE4: 1D -> Hypoelasticity -> 2 Fluid(s) after 3 attempt(s).
Failed test tests/122713AA: 2D -> Hypoelasticity -> 1 Fluid(s) after 3 attempt(s).
Failed test tests/574636EE: 2D -> Hypoelasticity -> 1 Fluid(s) -> cont_damage after 3 attempt(s).
Failed test tests/595705C7: 2D -> Hypoelasticity -> 1 Fluid(s) -> bc=-2 after 3 attempt(s).
Failed test tests/059D137F: 2D -> Hypoelasticity -> 1 Fluid(s) -> Axisymmetric after 3 attempt(s).
Failed test tests/5281BD7B: 2D -> Hypoelasticity -> 2 Fluid(s) after 3 attempt(s).
Failed test tests/7EFBCDAE: 3D -> Hypoelasticity -> 1 Fluid(s) after 3 attempt(s).
Failed test tests/EF3E7C79: 3D -> Hypoelasticity -> 1 Fluid(s) -> cont_damage after 3 attempt(s).
Failed test tests/67A5ECF8: 3D -> Hypoelasticity -> 1 Fluid(s) -> bc=-2 after 3 attempt(s).
Failed test tests/BDD3411B: 3D -> Hypoelasticity -> 2 Fluid(s) after 3 attempt(s).
Failed test tests/DB670E50: 2D -> Axisymmetric -> model_eqns=2 after 3 attempt(s).
Failed test tests/B89B8C70: 2D -> Axisymmetric -> model_eqns=3 after 3 attempt(s).
Failed test tests/FB822062: 2D -> Axisymmetric -> Viscous after 3 attempt(s).
Failed test tests/B3AAC9C8: 2D -> Axisymmetric -> Viscous -> weno_Re_flux after 3 attempt(s).
Failed test tests/27A13E25: 2D -> Axisymmetric -> Viscous -> weno_Re_flux -> weno_avg after 3 attempt(s).
Failed test tests/7E15602E: 2D -> Acoustic Source -> Transducer -> support=6 -> Sine after 3 attempt(s).
Failed test tests/B2CBB9FE: 2D -> Acoustic Source -> Transducer -> support=6 -> Delay after 3 attempt(s).
Failed test tests/7C2FF26F: 2D -> Acoustic Source -> Transducer -> support=6 -> Gaussian after 3 attempt(s).
Failed test tests/3E23CB5D: 2D -> Acoustic Source -> Transducer Array -> support=10 after 3 attempt(s).
Failed test tests/4D95A70E: 1D -> Example -> hypo_2materials after 3 attempt(s).
Failed test tests/3E400FBF: 2D -> Example -> axisym_shockwatercavity after 3 attempt(s).
Failed test tests/91938DCD: 1D -> Example -> impact after 3 attempt(s).
Failed test tests/5505A65C: 2D -> Example -> 5wave_quasi1D after 3 attempt(s).
Failed test tests/B97D4966: 2D -> Example -> phasechange_bubble after 3 attempt(s).
Failed test tests/7A9F4EF4: 2D -> Example -> axisym_shockbubble after 3 attempt(s).
Failed test tests/5505A65C: 2D -> Example -> 5wave_quasi1D after 3 attempt(s).

@sbryngelson
Copy link
Member

this is a hard one to refactor. i recommend doing HLL by itself first, which is shorter and involves less physics/edge cases. then if that works you can do HLLC. i already tried this on my own and think it isn't too bad. do things very incrementally and ensure you don't break things along the way.

@mohdsaid497566
Copy link
Collaborator Author

Sounds good, I will undo the changes to the solvers subroutines and go from there incrementally.

Copy link

codecov bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 7.24638% with 64 lines in your changes missing coverage. Please review.

Project coverage is 43.55%. Comparing base (2f8eef1) to head (60c7621).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/common/m_variables_conversion.fpp 7.24% 64 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #855      +/-   ##
==========================================
+ Coverage   43.47%   43.55%   +0.07%     
==========================================
  Files          68       68              
  Lines       19766    19457     -309     
  Branches     2375     2333      -42     
==========================================
- Hits         8593     8474     -119     
+ Misses       9726     9575     -151     
+ Partials     1447     1408      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.