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

Upstream CheMFC infrastructure #544

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

henryleberre
Copy link
Member

Description

Many changes are needed to implement chemistry and some are quite significant. This PR upstreams the core set of modifications that relate to code infrastructure. The PR also includes some non-chemistry, nice-to-have, updates and features.

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

Scope

  • This PR comprises a set of related changes with a common goal

How Has This Been Tested?

  • Local OSX ./mfc.sh test.
  • GitHub CI.

What is important here is not the correctness of the chemistry, but that these additions don't break existing code.

@sbryngelson
Copy link
Member

Can you add a brief summary of the added features/code cleaning? I realize this is a bit tedious but scrolling through the changed code is harder...

@henryleberre henryleberre force-pushed the chemfc-up branch 2 times, most recently from 65892b3 to e23383d Compare August 7, 2024 11:47
@sbryngelson
Copy link
Member

@henryleberre FYI the Phoenix runners will be down for a few days, the computer is under maintenance.

@henryleberre
Copy link
Member Author

List of changes:

  • (Main) MFC <-> Pyrometheus compile-time integration (case setup, builds, code-gen, etc.)
  • (Main) Parts of m_chemistry, some separation of logic for chemistry/non-chemistry cases at compile-time, variable buffers for chemistry, and some early logic like EoS, reactions, and post_processing.
  • (Minor) Creation of ./mfc.sh spelling.
  • (Minor) Multi-threaded misc/viz.py.
  • (Minor) Creation of m_finite_differences.
  • (Minor) Updated indices.dat to include the cons/prim variables, including mass fractions.
  • (Minor) Fixed s_rectangle patch for immersed boundaries. Note: I forget how I encountered this. Might have been with a test.
  • (Minor) Explicitly zero-out rhs_vf at the start of s_compute_rhs.
  • (Minor) Fixed the computation time_avg in m_rhs so that it works in 1D and 2D (not just 3D).
  • (Minor) Multi-threaded pip install if you specify -j (could speed up Cantera builds).
  • (Minor) Created ./mfc.sh spelling (called by CI).

\dots and I think that's most of them. You can wait for the GT runners to come back up to merge this.

@sbryngelson
Copy link
Member

List of changes:

  • (Main) MFC <-> Pyrometheus compile-time integration (case setup, builds, code-gen, etc.)
  • (Main) Parts of m_chemistry, some separation of logic for chemistry/non-chemistry cases at compile-time, variable buffers for chemistry, and some early logic like EoS, reactions, and post_processing.
  • (Minor) Creation of ./mfc.sh spelling.
  • (Minor) Multi-threaded misc/viz.py.
  • (Minor) Creation of m_finite_differences.
  • (Minor) Updated indices.dat to include the cons/prim variables, including mass fractions.
  • (Minor) Fixed s_rectangle patch for immersed boundaries. Note: I forget how I encountered this. Might have been with a test.
  • (Minor) Explicitly zero-out rhs_vf at the start of s_compute_rhs.
  • (Minor) Fixed the computation time_avg in m_rhs so that it works in 1D and 2D (not just 3D).
  • (Minor) Multi-threaded pip install if you specify -j (could speed up Cantera builds).
  • (Minor) Created ./mfc.sh spelling (called by CI).

\dots and I think that's most of them. You can wait for the GT runners to come back up to merge this.

Fancy. Will do a little code review and merge once runners are up.

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 33.87978% with 121 lines in your changes missing coverage. Please review.

Project coverage is 54.36%. Comparing base (3cf7fb6) to head (3b53b1b).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/common/m_finite_differences.fpp 10.41% 41 Missing and 2 partials ⚠️
src/simulation/m_chemistry.fpp 0.00% 32 Missing ⚠️
src/common/m_variables_conversion.fpp 30.43% 14 Missing and 2 partials ⚠️
src/simulation/m_data_output.fpp 22.22% 14 Missing ⚠️
src/pre_process/m_data_output.fpp 76.92% 1 Missing and 5 partials ⚠️
src/post_process/m_start_up.f90 0.00% 5 Missing ⚠️
src/pre_process/m_patches.fpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #544      +/-   ##
==========================================
- Coverage   54.69%   54.36%   -0.34%     
==========================================
  Files          59       61       +2     
  Lines       13662    13747      +85     
  Branches     1698     1720      +22     
==========================================
+ Hits         7473     7474       +1     
- Misses       5740     5817      +77     
- Partials      449      456       +7     

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

@henryleberre henryleberre force-pushed the chemfc-up branch 4 times, most recently from 4a5a0b0 to 8586f71 Compare August 12, 2024 02:10
@henryleberre henryleberre force-pushed the chemfc-up branch 3 times, most recently from 97da6b2 to 2319d4a Compare August 18, 2024 22:23
@henryleberre henryleberre force-pushed the chemfc-up branch 4 times, most recently from 3c642e8 to 5f6a474 Compare August 25, 2024 01:07
@sbryngelson
Copy link
Member

new_patch.patch
did you apply this patch? some of it is needed for CCE18 I think...

@henryleberre
Copy link
Member Author

@sbryngelson I did but it needed some modifications to work with other compilers. I'm fixing the new errors now.

@henryleberre
Copy link
Member Author

@sbryngelson You haven't approved the PR yet. Let me know if you want anything changed.

@henryleberre henryleberre force-pushed the chemfc-up branch 2 times, most recently from aebc6a4 to ec22431 Compare August 25, 2024 21:32
@sbryngelson
Copy link
Member

I think some documentation may need to be updated. For example, the variables here: https://mflowcode.github.io/documentation/md_visualization.html

@henryleberre henryleberre mentioned this pull request Aug 27, 2024
@henryleberre
Copy link
Member Author

I think some documentation may need to be updated. For example, the variables here: https://mflowcode.github.io/documentation/md_visualization.html

Since this PR adds the infrastructure for chemistry and does not claim to have working chemistry, I actively think we should refrain from documenting the existence of chemistry so as not to confuse users.

@sbryngelson
Copy link
Member

Phoenix is down, so I might have to wait to merge this. It looks like Frontier is still not working and it is interesting the Phoenix GPU test suite that finished before the servers went down showed a marked increase in performance.

@sbryngelson
Copy link
Member

sbryngelson commented Sep 13, 2024

@henryleberre I suppose this is up next, once conflicts are resolved? I merged #620

@sbryngelson
Copy link
Member

This is the first almost-mergable PR since #619. It's failing the CI cleanliness check, which is helpful, but in the diff it does find things like this (I was just perusing the "everything diff":

<   766 |         real(kind(0d0)) :: start, finish
---
>   261 |         real(kind(0d0)) :: start, finish
2781c2410
<   766 |         real(kind(0d0)) :: start, finish
---
>   261 |         real(kind(0d0)) :: start, finish
2820,2823d2448

We should probably change the workflow so that strip line numbers or some such before doing the diff. This is a real warning in the sense that those variables are probably not used, but it doesn't make sense to fail the check just because the user moved the subroutine down a few lines or something. @okBrian .

@henryleberre
Copy link
Member Author

@sbryngelson Do I need to pass the Cleanness CI to merge?

@sbryngelson
Copy link
Member

I'd like to see what's involved in passing this test (barring the silly diff warnings, like the line change I commented on above). if no one can actually pass the test, then it needs to be adjusted somehow or removed.

@henryleberre
Copy link
Member Author

@sbryngelson I'm sure I can remove the new warnings but a few are them are spurious since the testing is done with the chemistry parameter set to False. So everything that's behind chemistry = T causes warnings for being unused. Also, even if I got the new warnings to go away, the CI would still have to be updated to ignore the line number where the warnings were produced on.

@sbryngelson
Copy link
Member

ok then we can ignore it

@sbryngelson sbryngelson merged commit 17eb3de into MFlowCode:master Sep 16, 2024
20 of 23 checks passed
@sbryngelson sbryngelson deleted the chemfc-up branch September 16, 2024 20:39
haochey added a commit to haochey/MFChaocheyfork that referenced this pull request Nov 5, 2024
The changes on the rectangle patches are added mistakenly.
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