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

Command line override args #87

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Command line override args #87

merged 2 commits into from
Sep 16, 2021

Conversation

alwinm
Copy link
Collaborator

@alwinm alwinm commented Sep 16, 2021

This minor patch allows command line overrides, which is a quality-of-life convenience when testing and can reduce the # of input files needed to run a variety of tests. Use examples:

Changing the output directory
./bin/cholla tests/3D/constant.txt outdir=dir2/

Changing the resolution
./bin/cholla tests/3D/constant.txt nx=100 ny=100 nz=100

Changing tout
./bin/cholla tests/3D/constant.txt tout=1000.0 outstep=1000.0

Changing parameters
./bin/cholla tests/3D/constant.txt rho=1e2

Everything combined
./bin/cholla tests/3D/constant.txt outdir=dir2/ nx=100 ny=100 nz=100 tout=1000.0 rho=1e2

Adding new params to the codebase should not be any different from before, as there is only one copy of the param parser, which is first used on the input file and then used on command line arguments, which gives command line arguments the power to override.

@evaneschneider
Copy link
Collaborator

Great idea.

@evaneschneider evaneschneider merged commit 3e1ac5e into cholla-hydro:CAAR Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants