-
Notifications
You must be signed in to change notification settings - Fork 191
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
Change ReduceCceWorldtube to use options #6287
Change ReduceCceWorldtube to use options #6287
Conversation
@markscheel (maybe @keefemitman?) Do we even do this anymore in SpEC? Are any modern runs using the old metric format? I would ideally like to test this out to ensure I didn't break anything, but I'm not sure where to get the data to try. |
a0a4ecd
to
d5cadd3
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.
LGTM, a few minor suggestions. Please squash immediately!
@@ -109,13 +109,20 @@ function(add_single_input_file_test INPUT_FILE EXECUTABLE COMMAND_LINE_ARGS | |||
endfunction() | |||
|
|||
# Searches the directory INPUT_FILE_DIR for .yaml files and adds a test for each | |||
# one. See `WritingTests.md` for details on controlling input file tests. | |||
function(add_input_file_tests INPUT_FILE_DIR) | |||
# one. See `WritingTests.md` for details on controlling input file tests. Add |
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.
Does the WritingTests.md
still need to be updated about the whitelist here?
@@ -275,6 +282,107 @@ void perform_cce_worldtube_reduction( | |||
} | |||
Parallel::printf("\n"); | |||
} | |||
|
|||
namespace OptionTags { | |||
struct InputSpecH5File { |
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.
I'd say let's get rid of references to SpEC already. InputH5File
for the name :)
struct InputSpecH5File { | ||
using type = std::string; | ||
static constexpr Options::String help = | ||
"Name of SpEC H5 worldtube file. A '.h5' extension will be added if " |
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.
Name of the H5 worldtube file. ...
static constexpr Options::String help = | ||
"Apply corrections associated with documented SpEC worldtube file " | ||
"errors. If you are using worldtube data from SpECTRE or from another NR " | ||
"code but in the SpECTRE format, then this option should be 'False'"; |
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.
should
-> must
? Just to make it very clear it's not a know that folks should "try out"?
static constexpr Options::String help = | ||
"Number of time steps to load during each call to the file-accessing " | ||
"routines. Higher values mean fewer, larger loads from file into RAM. " | ||
"Default 2000."; |
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.
Default 2000.
-> Set to 'Auto' to use a default value (2000).
"the boundary computations will be performed at a resolution that is " | ||
"lmax_factor times the input file lmax to avoid aliasing"); | ||
"input-file", boost::program_options::value<std::string>()->required(), | ||
"Name of YAML file to parse."); |
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.
file to parse
-> input file to use.
Parallel::printf("%s\n", desc); | ||
// Option parser for all the actual options | ||
Options::Parser<option_tags> parser{ | ||
"This executable is used for converting the unnecessarily large SpEC " |
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.
unnecessarily large SpEC
-> metric
// Option parser for all the actual options | ||
Options::Parser<option_tags> parser{ | ||
"This executable is used for converting the unnecessarily large SpEC " | ||
"worldtube data format into a far smaller representation (roughly a " |
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.
far
-> remove
tuples::get<ReduceCceTags::FixSpecNormalization>(inputs)); | ||
} catch (const std::exception& exception) { | ||
Parallel::printf("%s\n", exception.what()); | ||
return 1; |
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.
return 2;
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.
We actually use 2
in our charm execs to mean "continue from checkpoint". src/Parallel/ExitCode.hpp
Should I still use that here?
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.
Oh, hmm, I was just thinking a number to distinguish from the other error. Maybe we should choose and document a number for "Input file parse failed" and then use 1
as " 🤷 it went bad"
I'm happy to defer this until some other point. I think it's beyond the scope of this PR. Up to you!
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.
I like dedicating another number to "input file parse failed" and using 1
for general error. But yeah it's outside the scope of this PR, so I'll keep it as 1 for now and change it later.
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.
Sounds good!
|
||
# [reduce_cce_worldtube_yaml_doxygen_example] | ||
|
||
InputSpecH5File: SpecFilenameR0292.h5 |
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.
Spec
-> Input
? Unless we actually have this file in the repo for testing, then leave as-is
0de17da
to
58586af
Compare
@nilsdeppe Squashed in the changes into the first commit. I added a second commit that reorganizes the CCE tarball like so: CceExecutables.tar.xz:
I had to update the google drive link for |
58586af
to
d9c7ea0
Compare
This will require us to edit the python file in the google drive
47eeeb1
to
e17305c
Compare
@nilsdeppe Ok I tested this on my fork by creating a release, and the |
Proposed changes
Towards #6246.
Since there will be a lot more functionality added to the
ReduceCceWorldtube
exec (combining h5 files, dealing with overlapping times, handling nodal data), it will be easier to add this if we use some kind of Option framework. This PR keeps the same functionality as before, but just moves all the options from the command line to a YAML.Upgrade instructions
ReduceCceWorldtube
executable no longer accepts command-line arguments. They must now be specified in a YAML file. Seesrc/Executables/ReduceCceWorldtube/ReduceCceWorldtube.yaml
for an example. You can then run the executable similar to our charm executables asCode review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments