-
Notifications
You must be signed in to change notification settings - Fork 67
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
Working 0-1D Chemistry (among other things) #653
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add goldenfiles/tests since we now have examples? Even if they are only for 0D or 1D. this would also help ensure the user has installed boost/pyro and other dependencies correctly.
Yes, will do. There is one caveat, however. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #653 +/- ##
===========================================
- Coverage 54.53% 42.89% -11.65%
===========================================
Files 61 61
Lines 13802 16070 +2268
Branches 1727 1799 +72
===========================================
- Hits 7527 6893 -634
- Misses 5819 8191 +2372
- Partials 456 986 +530 ☔ View full report in Codecov by Sentry. |
Perhaps... what is the reason? For example, as a user it would be convenient to be able to run a chemistry case, and then switch to a 'normal' case without rebuilding (or vice-versa). Is the mechanism only available at compile time for some reason? |
This is transparent to the user. Chemistry is a compile-time feature because it needs to invoke Pyrometheus to generate code for a specific mechanism file. The build "slug" system is in place to prevent rebuilds for the exact reason you described. The slug is (partially) a function of the mechanism. When you switch back to running a "regular" MFC case, it will re-use a previous build. def get_slug(self, case: input.MFCInputFile) -> str:
if self.isDependency:
return self.name
m = hashlib.sha256()
m.update(self.name.encode())
m.update(CFG().make_slug().encode())
m.update(case.get_fpp(self, False).encode())
if case.params.get('chemistry', 'F') == 'T':
m.update(case.get_cantera_solution().name.encode())
return m.hexdigest()[:10] |
Yes it seems there is no way to avoid this, so long as Pyro is generating our code on the fly for each chemistry case. So yes I am OK with this, as we should probably have a 'store' of mechanism files that we test with located somewhere in VC |
I agree. A bunch of standard mechanisms are shipped with Cantera (see https://github.com/Cantera/cantera/tree/main/data). This is why you can run these example cases without downloading a mechanism file. |
Benchmarking is failing with .=++*: -+*+=. | [email protected] [Linux]
:+ -*- == =* . | -------------------------------------------------------
:*+ == ++ .+- |
:*##-.....:*+ .#%+++=--+=:::. | --jobs 24
-=-++-======#=--**+++==+*++=::-:. | --mpi --no-gpu --no-debug --no-gcov --no-unified
.:++=----------====+*= ==..:%..... | --targets pre_process, simulation, and post_process
.:-=++++===--==+=-+= +. := |
+#=::::::::=%=. -+: =+ *: | ----------------------------------------------------------
.*=-=*=.. :=+*+: -...-- | $ ./mfc.sh (build, run, test, clean, count, packer) --help
Benchmarking pre_process, simulation, and post_process (build/benchmarks/e180):
1/4: 5eq_rk3_weno3_hllc @ benchmarks/5eq_rk3_weno3_hllc/case.py
> Log: build/benchmarks/e180/5eq_rk3_weno3_hllc.out
> Summary: build/benchmarks/e180/5eq_rk3_weno3_hllc.yaml
$ ./mfc.sh run /storage/scratch1/6/sbryngelson3/runners/actions-runner-4/_work/MFC/MFC/pr/benchmarks/5eq_rk3_weno3_hllc/case.py --case-optimization --targets pre_process simulation post_process --output-summary /storage/scratch1/6/sbryngelson3/runners/actions-runner-4/_work/MFC/MFC/pr/build/benchmarks/e180/5eq_rk3_weno3_hllc.yaml -c phoenix --gpu -g 0 1 -n 2 -- 1
Error: Failed to load YAML from "/storage/scratch1/6/sbryngelson3/runners/actions-runner-4/_work/MFC/MFC/pr/build/benchmarks/e180/5eq_rk3_weno3_hllc.yaml": [Errno 2] No such file or directory: '/storage/scratch1/6/sbryngelson3/runners/actions-runner-4/_work/MFC/MFC/pr/build/benchmarks/e180/5eq_rk3_weno3_hllc.yaml'
Terminated
mfc: ERROR > main.py finished with a 143 exit code.
mfc: (venv) Exiting the Python virtual environment. the 'master' run doesn't have this error, only the 'pr' run. |
0020e66
to
480c342
Compare
@sbryngelson Thanks for letting me know. Just fixed it. |
@henryleberre mind pulling from upstream for 'cleanliness'? I made an update there yesterday and want to see how it worked out. |
480c342
to
23df5d6
Compare
@henryleberre pull my 'fix cleanliness' PR so it's up to date with master if possible (that's the thing I would like to test). |
Yes I did, that was the force-push you saw (a rebase on upstream). This is the workflow step that is causing it to fail: |
53c637d
to
ee8e4d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀🙌🏻
0ac3ace
to
e0cca6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing this is a bit harder because it only appears meaningfully in multi-rank cases. Once you're done, can you test for correctness on a longer 4-rank case, for example, to be sure there isn't a subtle mistake?
Also @henryleberre: It's somewhat unclear what all the different variables really mean (and they don't seem to have comments). I think even after refactor we have 2 or 3 versions of this variable. Can we put comments to say what those are/why they exist? |
5cd3244
to
0013438
Compare
8554d67
to
7340b87
Compare
The debug cases are failing on this case (perhaps among others, they only run a fraction of the cases in CI):
Case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't a complete review but covers at least 90% of the diff
Co-authored-by: Dimitrios Adam <[email protected]>
+ nD_perfect_reactor + 1D_reactive_shocktube + 1D_inert_shocktube
Co-Authored-By: Henry Le Berre <[email protected]>
84b8c9e
to
9b76c7d
Compare
@@ -106,6 +106,8 @@ contains | |||
@:ALLOCATE_GLOBAL(ghost_points(num_gps)) | |||
@:ALLOCATE_GLOBAL(inner_points(num_inner_gps)) | |||
|
|||
print *, "num_gps was ", num_gps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
Description
nD_perfect_reactor
,1D_reactive_shocktube
, and1D_inert_shocktube
.misc/viz.py
script and instead adds a reusable library in the toolchain for this. See the small, individual,viz.py
files for each example case I added.mfc.case_utils
.pyproject.toml
for the toolchain so that it can be installed in the venv. You can alsopip3 install -e toolchain/
../mfc.sh run
passes its internal state to the cases it reads, through CLI arguments, it now does so using the--mfc
argument (instead of using positional arguments). This improves the usability of the feature because you no longer have to pass your case a fake first argument when running it usingpython3
.i[x,y,z]
variables everywhere that made the code confusing to read.fastjsonschema
. Needed for loading many case files from files (e.g. testing using example cases).BOOST_INCLUDE
on macOS.Type of change
Scope
How Has This Been Tested?
The three example cases recreate simulations from papers referenced in their respective case.py files and READMEs.