[newchem-cpp] Improve API-Test Harness (2/2): grtest::FieldContainer#500
Open
mabruzzo wants to merge 31 commits intograckle-project:newchem-cppfrom
Open
[newchem-cpp] Improve API-Test Harness (2/2): grtest::FieldContainer#500mabruzzo wants to merge 31 commits intograckle-project:newchem-cppfrom
grtest::FieldContainer#500mabruzzo wants to merge 31 commits intograckle-project:newchem-cppfrom
Conversation
d34d389 to
2fbe523
Compare
2fbe523 to
59177be
Compare
59177be to
0d30096
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To be reviewed after #499 is merged
This PR introduces the
grtest::FieldContainertype and basic machinery for initializing the values.Description:
grtest::FieldContainerThis is basically a glorified wrapper around
grackle_field_dataand the underlying field allocations. The main goals were to:There are obvious parallels to
gracklepy'sFluidContainerclassA fair amount of design decisions were influenced by my desire to write benchmarks (in a subsequent PR).
FieldContaineris probably a little slow. This won't be a problem for benchmarks since theFieldContainer::copy_tois designed to be a fastmemcpy. The very end of this PR includes a snippet of what a benchmark might look likeDescription:
grtest::fill_field_valuesThis is the basic function that is intended to initialize the values of a
FluidContainer. The basic idea is that an initial-condition "tile" is specified and this function fills aFluidContainerby repeating this tile.At the moment, machinery is in place to construct highly simplistic initial-conditions. Over time, we'll probably add alternative choices to test Grackle in various regimes (and to eventually build benchmarks of physically meaningful scenarios).
Summary
All of these changes make it possible to write tests of the Grackle API a lot more concisely. Things are still fairly clunky, but I think it's worth wait to refactor until I have written some tests using this API (I have a handful of half-finished PRs).
This PR talks quite a bit about benchmarking. At this point, it will be quite straight-forward to construct a few basic benchmarks. For some context, if we used a tool like Google Benchmark, then a benchmark of
local_solve_chemistrymight look something like the snippet in the collapsible sectionSample Benchmarking Snippet
In practice, the benchmarking code would probably be a little more sophisticated.