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 patch adds
get_root_stdout
to the MOM_io API, and points to theFMS
stdout()
function in the FMS infra implementations.This change was required because calls to
coupler_type_write_chksums
handles both its own checksums across ranks and its own IO to
outunit
.Typically only the root PE will write the result.
The FMS
stdout()
function would return the designated stdout unit forthe root PE, and the internal
etc_unit
for other PEs, usually set to/dev/null
.When MOM_io switched from using the FMS
stdout()
function to thestdout
unit as defined iniso_fortran_env
, this functionality waslost and every PE would write the same result to stdout.
Normally this was controlled with
if (root)
-like tests, but thiscannot be used in functions like
coupler_type_write_checksums
, whichrequire participation of all PEs.
We decided the only resolution here was to introduce a new function,
get_root_stdout
which replicates the original behavior ofstdout()
.Additional comments:
The
if (root)
checks were retained, since it is presumably still agood idea to avoid the
write()
calls when possible, even to/dev/null
.This patch only updates the FMS coulper driver, but I would recommend
that the other driver maintainers review their own calls to this
function.