Working 0-1D Chemistry (among other things)#653
Conversation
sbryngelson
left a comment
There was a problem hiding this comment.
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 .=++*: -+*+=. | sbryngelson3@atl1-1-01-003-34-0.pace.gatech.edu [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. |
|
@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. |
|
@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: |
sbryngelson
left a comment
There was a problem hiding this comment.
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? |
I did "document" these like this: I could maybe have specified these were the proc's local domain. They are only defined in one place now so it's very straightforward to understand. The other indices are module-specific and I'm not sure I have enough context to explain them better than the code does. |
I'm not sure how this is true. Why are the 2-rank test cases not enough? |
2-rank may be enough, but I'm not sure if our current single test case in the suite is enough. |
Ah I did not see this part. I mostly saw the module indices. I think those are still confusing. Why do we need any such variables beyond |
|
The debug cases are failing on this case (perhaps among others, they only run a fraction of the cases in CI): Case |
sbryngelson
left a comment
There was a problem hiding this comment.
this isn't a complete review but covers at least 90% of the diff
Co-authored-by: Dimitrios Adam <mitsos.gr@hotmail.gr>
+ nD_perfect_reactor + 1D_reactive_shocktube + 1D_inert_shocktube
Co-Authored-By: Henry Le Berre <hberre3@gatech.edu>
| @:ALLOCATE_GLOBAL(ghost_points(num_gps)) | ||
| @:ALLOCATE_GLOBAL(inner_points(num_inner_gps)) | ||
|
|
||
| print *, "num_gps was ", num_gps |
Description
nD_perfect_reactor,1D_reactive_shocktube, and1D_inert_shocktube.misc/viz.pyscript and instead adds a reusable library in the toolchain for this. See the small, individual,viz.pyfiles for each example case I added.mfc.case_utils.pyproject.tomlfor the toolchain so that it can be installed in the venv. You can alsopip3 install -e toolchain/../mfc.sh runpasses its internal state to the cases it reads, through CLI arguments, it now does so using the--mfcargument (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_INCLUDEon 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.