-
Notifications
You must be signed in to change notification settings - Fork 51
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
WIP: Introducing the grcli
development tool
#231
Draft
mabruzzo
wants to merge
21
commits into
grackle-project:main
Choose a base branch
from
mabruzzo:grackle-cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
mabruzzo
force-pushed
the
grackle-cli
branch
from
September 6, 2024 14:59
a8e28c9
to
e455173
Compare
…entation of the standard c++ library.
…hen compiling grcli)
mabruzzo
force-pushed
the
grackle-cli
branch
from
September 18, 2024 14:10
e455173
to
218665e
Compare
mabruzzo
force-pushed
the
grackle-cli
branch
from
September 18, 2024 14:11
218665e
to
345957e
Compare
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.
This PR is ~90% complete.
Overview/Motivation
This PR introduces a new development tool called
grcli
. It is a command-line tool, written in C++, that can be used to configure and execute fairly arbitrary grackle-sample problems. Currently, the primary purpose is to use it for benchmarking.At some point in the near future (in a different PR), it is my intention to add support for debugging.1
This tool makes use of Google's benchmark library (I'm not 100% sure this is the right tool for the job). The CMake build system is configured to automatically download and build that library as part of compiling
grcli
.Description
The outputs of
grcli --help
are displayed down below (in the collapsible sectiongrcli description
Here's an example invocation:
Currently, there isn't any way to adjust the code_units. But that's something that can be introduced
./build/src/grcli/grcli bench \ --par-start metal_cooling=1 use_grackle=1 primordial_chemistry=0 \ 'grackle_data_file="input/CloudyData_UVB=HM2012.h5"' \ --par-stop \ -Sgrid.ax0=temperature,geomspace,1e4,1e6,128 \ -Sgrid.ax1=metallicity,1.0 \ -Sgrid.ax2=mass_density,geomspace,0.01,10.0,128 \ -Osolve-chemistry-dt=1e-6
Here's the output on my Mac Book Pro with an M3 Pro processor (I think the output probably looks nicer and is more informative on Linux):
This translates to a case where the timestep is ~1e-6 Myr.
The following collapsed section shows a snippets of the outputs for
calculate_temperature
andcalculate_cooling_time
.other timings
Calculate cooling time:
Calculate temperature:
This suggests, that up to ~70% of the cooling-time calculation is spent computing temperature (for primordial_chemistry == 0)
ToDo List
There are essentially 3 main things left to do:
metal_cooling=1 use_grackle=1
every time we run a test-problemFootnotes
In more detail, PR State-Dumping Debug Tool #197 seeks to add debugging tools to dump the state of grackle to disk. That PR introduces some python functions to read in the dumped data. The idea would be to add functionality to
grcli
to do the same. ↩