-
Notifications
You must be signed in to change notification settings - Fork 19
XIOS configuration available through the help-config system #846
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
Conversation
1b8e3ef
to
c867e4e
Compare
static const std::map<int, std::string> keyMap | ||
= { { Xios::ENABLED_KEY, "xios.enable" }, { Xios::STARTTIME_KEY, "model.start" }, | ||
{ Xios::STOPTIME_KEY, "model.stop" }, { Xios::TIME_STEP_KEY, "model.time_step" }, | ||
{ Xios::OUTPUT_RESTARTPERIOD_KEY, xOutputPfx + ".period" }, | ||
{ Xios::OUTPUT_RESTARTFILE_KEY, xOutputPfx + ".filename" }, | ||
{ Xios::OUTPUT_FIELD_NAMES_KEY, xOutputPfx + ".field_names" }, | ||
{ Xios::INPUT_RESTARTPERIOD_KEY, xInputPfx + ".period" }, | ||
{ Xios::INPUT_RESTARTFILE_KEY, xInputPfx + ".filename" }, | ||
{ Xios::INPUT_FIELD_NAMES_KEY, xInputPfx + ".field_names" } }; |
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.
Note that I renamed the keys for consistency with their names in Model
.
"an ISO8601 duration (P prefix) or number of seconds. A value of zero assumes no " | ||
"intermediate restart files." }, | ||
{ keyMap.at(INPUT_RESTARTFILE_KEY), ConfigType::STRING, {}, "", "", | ||
// TODO: Support format "restart%Y-%m-%dT%H:%M:%SZ.nc" |
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.
Filename patterns are not currently supported in our XIOS implementation. This would likely make use of setFileSplitFreq
and getFileSplitFreq
.
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 don't plan to do this in this PR.
>> std::boolalpha >> isEnabled; | ||
|
||
// Extract the start time from the model configuration | ||
// TODO: Deduce from Model.iterator rather than duplicating 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.
Question for the reviewer: what's the best way to transfer start time, stop time, and timestep info to the XIOS handler? The current implementation duplicates the logic in Model.iterator
. I considered associating the Model
with the XIOS handler but then we'd have to set up Model
s for the sake of the unit tests. Perhaps some of the parsed info could be static?
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.
this is something I have faced with development of the MPI backend. IMO I think we should get the info from Model
either by making it a friend
or by creating getters
. But yes, it does make testing more laborious 😞
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 suggest a new class (or perhaps rather a struct
) that holds two TimePoint
s and one Duration
. The Iterator
class could then hold a private one, but have a getter function to create copy of the information it holds. The duration/stop time logic would then be a part of this class.
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.
Thanks @timspainNERSC. I opened #925 to follow this up.
f388d14
to
00acebc
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.
Thanks @jwallwork23 it all looks good to me
Xios::HelpMap& Xios::getHelpText(HelpMap& map, bool getAll) | ||
{ | ||
map["Xios"] = { | ||
{ keyMap.at(ENABLED_KEY), ConfigType::BOOLEAN, {}, "", "", |
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.
is the idea of this key so that we can build with XIOS=ON
but then disable it as a runtime option?
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 I'd just been including it because it was in the map. But yes, I suppose that could be one use case.
ccdca3a
to
456d2a7
Compare
[Rebased on top of |
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.
Approved, unless you want to include a possible new start/stop time handling class.
XIOS configuration available through the help-config system
Fixes #830
Merges into #859
Task List
Change Description
This PR implements and hooks up a
HelpConfig
system for the XIOS handler class. Building with XIOS support and running./build/nextsim --help-config
, I see the following at the bottom:Test Description
The input/output frequency now default to the timestep. This is tested by dropping their specifications in the
XiosRead
andXiosWrite
tests.Pre-Request Checklist