Added parameters to keep all statepoints in transient solves. #1313
Added parameters to keep all statepoints in transient solves. #1313TheBEllis wants to merge 15 commits intoneams-th-coe:develfrom
Conversation
|
Job Documentation, step Sync to remote on 2e8bfa7 wanted to post the following: View the site here This comment will be updated on new commits. |
|
@TheBEllis can you rebase your branch off |
…to OpenMCBaseProblem
…et default base name for transient statepoint dirs
… sets a statepoint_directory
… exists before creating it
f241885 to
4367813
Compare
|
Whoops my bad, should be rebased now! |
nuclearkevin
left a comment
There was a problem hiding this comment.
Thanks for opening this PR @TheBEllis! I have one question regarding the design and I think another test should be added to catch an edge case, but otherwise I don't have any major complaints.
| [Executioner] | ||
| type = Transient | ||
| num_steps = 2 | ||
| batches = 50 # this number needs to match the value in settings.xml for the purpose of the test |
There was a problem hiding this comment.
batches belongs in the [Problem] block.
| [Executioner] | ||
| type = Transient | ||
| num_steps = 2 | ||
| batches = 50 # this number needs to match the value in settings.xml for the purpose of the test |
There was a problem hiding this comment.
batches belongs in the [Problem] block.
| if (isParamSetByUser("statepoint_directory") && !_keep_transient_statepoint) | ||
| { | ||
| openmc::settings::path_output = formattedOutputPath(_statepoint_directory); | ||
| if (!std::filesystem::is_directory(openmc::settings::path_output)) |
There was a problem hiding this comment.
Are we catching this if statement with a test? From what I can see, none of the tests try to create a statepoint directory with the same name as a file.
There was a problem hiding this comment.
I've added a RunException for this exact scenario, let me know if you think that's enough or whether I should be catching it in code:)
4367813 to
a9e228b
Compare
734b297 to
9c36899
Compare
|
It appears as if the include statements are still outside of the
|
…rio when user defined output path has the same name as existing file
d78c475 to
1b8b26a
Compare
…so that potentially non existant directories can be compared
|
Job Coverage, step Generate coverage on 2e8bfa7 wanted to post the following: CoverageInconsistent report tags were found between the head and base reports. Inconsistent tags: This comment will be updated on new commits. |
nuclearkevin
left a comment
There was a problem hiding this comment.
A few more comments from me, but I think this is almost ready to go.
Terribly sorry for the inconvenience dealing with the regression suite being non-deterministic - we're trying to figure out what's going on but can't find any patterns.
| [check_statepoint_exists_in_directory_w_existing_filenmae] | ||
| type = RunException | ||
| input = openmc_custom_dir_filename.i | ||
| expect_err = 'filesystem error: cannot create directory: File exists' |
There was a problem hiding this comment.
Does this trace back to OpenMCCellAverageProblem through a mooseError()? if not, it will be difficult for the user to debug the error message.
There was a problem hiding this comment.
I've moved the logic around a bit so that a mooseError() is thrown now. There are some slightly annoying lines in there, mostly related to removing trailing "/". The value passed to openmc::settings::path_output must contain a trailing "/", but when checking is a file with the same name exists using is_regular_file(), this has to be removed.
|
Job Test OpenMC on 2e8bfa7 : invalidated by @nuclearkevin |
|
I'll rerun the tests until they pass. The random |
|
Job Test DagMC on 2e8bfa7 : invalidated by @nuclearkevin |
|
Job Coverage on 2e8bfa7 : invalidated by @nuclearkevin |
1 similar comment
|
Job Coverage on 2e8bfa7 : invalidated by @nuclearkevin |
| const std::string & _statepoint_directory; | ||
|
|
||
| /// Parameter determines whether statepoints from all timesteps should be saved in separtate directories to avoid them being overwritten | ||
| const bool _keep_transient_statepoint; |
There was a problem hiding this comment.
| const bool _keep_transient_statepoint; | |
| const bool & _keep_transient_statepoint; |
There was a problem hiding this comment.
capturing by reference is recommended by MOOSE convention when possible because it'll be compatible with controls and other systems
| params.addParam<bool>("keep_transient_statepoint", | ||
| false, | ||
| "Whether or not statepoints from all timesteps should be kept, and written " | ||
| "to seperate directories."); |
There was a problem hiding this comment.
| "to seperate directories."); | |
| "to separate directories."); |
| const std::string & _statepoint_directory; | ||
|
|
||
| /// Parameter determines whether statepoints from all timesteps should be saved in separtate directories to avoid them being overwritten | ||
| const bool _keep_transient_statepoint; |
There was a problem hiding this comment.
capturing by reference is recommended by MOOSE convention when possible because it'll be compatible with controls and other systems
| requirement = "A statepoint file must be written to the parameter defined directory when the batches parameter matches the batches " | ||
| "in settings.xml and they are both specified." | ||
| capabilities = 'openmc' | ||
| [] |
There was a problem hiding this comment.
please make sure each test has a issues and design parameter
Addresses issue #1312. Adds two parameters to OpenMCProblemBase,
statepoint_directoryandkeep_transient_statepoint.statepoint_directoryallows the user to set the directory they want the statepoint file to be written to. InOpenMCProblemBasethis setsopenmc::settings::path_output.keep_transient_statepointcreates a directory for each timestep's statepoint file to be saved to. If the user has already setstatepoint_directory, this value is used as a base directory name, and a suffix is appended to indicate the timestep.I've added a couple of tests in, just to check the statepoints get output to the expected directories.