-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix NetCDF file close error running MPI with NetCDF forcing #819
Conversation
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.
One more change for me to make manually, in base DataProvider
42afc96
to
bc27fd3
Compare
@hellkite500 @donaldwj I rewrote the code changes, so I probably shouldn't also review it when it's ready. |
bc27fd3
to
3b32bb9
Compare
(@stcui007 I just rebased and force-pushed) |
The rebased and revised version is tested to work. |
Per discussion with @robertbartel, |
In reviewing this PR, I think the hard thing will not be deciding whether the present additions and changes are correct, but whether there are related things that are missing. |
I would try testing on macOS, except my Homebrew-installed NetCDF presents linking errors. |
Ok, I didn't try to reproduce the original failure, but I can at least get a clean build and test run on macOS, by |
@PhilMiller, I'm curious why you didn't make |
I gave a concrete empty implementation of Note that the multiple inheritance of |
@stcui007 Could you test this code with a realization config that uses the NetCDF forcings, MPI, and a BMI Multi realization? I think that may still fail, since I don't think the implementation of |
Will do.
…On Fri, May 24, 2024 at 9:10 PM Phil Miller - NOAA ***@***.***> wrote:
@stcui007 <https://github.com/stcui007> Could you test this code with a
realization config that uses the NetCDF forcings, MPI, and a BMI Multi
realization? I think that may still fail, since I don't think the
implementation of Bmi_Multi_Formulation::finalize() I wrote will actually
get called.
—
Reply to this email directly, view it on GitHub
<#819 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACA4SRMG77TPHUP7D4PQWRTZD7XIZAVCNFSM6AAAAABHRFGQM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZQGY3DKOBRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Setting to draft mode until that further testing is complete, so that it doesn't get merged inadvertently. |
The code has been tested again with MPI and NetCDF forcing and BMI realization config (all from ngen/data/ directory) and it still runs to completion without error. Prior to this PR, this combination produced a NetCDF file close error. |
46e7f24
to
e08d4d4
Compare
…to its finalize() If, in the future, we use an MPI-interacting library for access to NetCDF files through that path, this will help ensure that any such stuff is cleaned up before the call to MPI_Finalize()
…he same as formulations
e08d4d4
to
97c9be5
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.
Since I got a review request I assume this is complete. It looks like there is an undocumented [on the PR home page] change where forcings are moved from CatchmentArea to Catchment_Formulation. Could you include this in the changes section and set and remove the draft status.
Donald, thanks for reminding me to update the PR description. That's done, and PR is once again 'Ready' |
Phil,
The pull request is merged
…On Thu, May 30, 2024 at 12:13 PM Phil Miller - NOAA < ***@***.***> wrote:
Donald, thanks for reminding me to update the PR description. That's done,
and PR is once again 'Ready'
—
Reply to this email directly, view it on GitHub
<#819 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF6KABBVOX7BOYLLFDMOLQDZE5M3PAVCNFSM6AAAAABHRFGQM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBQGMZDAMRRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Donald W Johnson
205-347-1467
National Water Center
Tuscaloosa AL
|
This PR provides a fix for running ngen in MPI with NetCDF forcing where a NetCDF file close error is generated at end of run for each MPI process. Fixes #749, #818.
Additions and Changes
DataProvider::finalize()
interface for end-of-run cleanup activities that need to be sequenced more specifically than destructor-call orderNetCDFPerFeatureProvider::finalize()
implementation ofDataProvider
interface to close filesWrappedDataProvider::finalize()
explicit with explanatory commentCsvPerFeatureForcingProvider
: delete unused private membersHY_CatchmentRealization::forcing
member down toCatchment_Formulation
, and remove constructor argument pass-through fromHY_CatchmentArea
accordingly.Catchment_Formulation::finalize()
to callfinalize()
on its forcingDataProvider
Formulation_Manager::finalize
to callfinalize()
on allCatchment_Formulation
-descendant formulations that it ownsFormulation_Manger
call to clean up cache of sharedNetCDFPerFeatureProvider
instances moved from its destructor to its newfinalize()
Formulation_Manager::finalize()
, to get calls down the stackTesting
Run ngen with mpirun. Tests show that the fix removes the NetCDF file close error at the end of the mpirun using NetCDF forcing.
Checklist
Target Environment support