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

Add pio_finalize calls for CICE history and restart files #995

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

apcraig
Copy link
Contributor

@apcraig apcraig commented Nov 14, 2024

PR checklist

  • Short (1 sentence) summary of your PR:
    Add pio_finalize calls for CICE history and restart files
  • Developer(s):
    apcraig
  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    Tested quick_suite and io_suite on derecho with 6 compilers. All tests pass and are bit for bit. New tests pass. One old test, restart_gx3_32x1_alt02_histall_iohdf5_iopio1 now is failing with an hdf5 dimscales error. I tried to look into the problem, but this seems to be a problem on with pio1 and hdf5. I am going to allow this to fail.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR update the Icepack submodule? If so, the Icepack submodule must point to a hash on Icepack's main branch.
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please document the changes in detail, including why the changes are made. This will become part of the PR commit log.

This fixes a "too many communicators" error caught in UFS and duplicated in standalone CICE when writing lots of files.

Add pio_finalize calls for CICE history and restart files when running with PIO. This cleans up some PIO internal data. The code was aborting when trying to write lots of files (>600) because we reinitialize PIO for each file. This is a short term fix. A longer term fix is to initialize PIO once and reuse as much as possible.

Add a new test that runs CICE for a year writing hourly files (>8000 files). Test with pio2 and netcdf.

…g with PIO. This

cleans up some PIO internal data.  The code was aborting when trying to write
lots of files (>600) because we reinitialize PIO for each file.  This is a short term
fix.  A longer term fix is to initialize PIO once and reuse as much as possible.

Add a new test that runs CICE for a year writing hourly files (>8000 files).  Test with
pio2 and netcdf.
Copy link
Contributor

@DeniseWorthen DeniseWorthen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In UFS, this successfully generates over 1900 hourly files for a C48-5deg case by the end of the wall-clock time. The previous limit was 675 files.

Copy link
Contributor

@anton-seaice anton-seaice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this :)

integer(kind=int_kind) :: ierr
character(len=*), parameter :: subname = '(ice_pio_finalize)'

call pio_finalize(ice_pio_subsystem,ierr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly when there is an ierr code returned from a pio function, elsewhere there is a

call pio_seterrorhandling(File, PIO_RETURN_ERROR)

before the call, then the ierr is checked with ice_pio_check and the error handling is set back to internal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've updated the implementation.


integer(kind=int_kind) :: ierr
character(len=*), parameter :: subname = '(ice_pio_finalize)'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#ifndef CESMCOUPLED

This is handled elsewhere for CESMCOUPLED

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've updated the implementation.

@anton-seaice
Copy link
Contributor

Thanks @apcraig

@apcraig apcraig merged commit 618a08e into CICE-Consortium:main Nov 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants