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

New Bnd + New Save method #110

Merged
merged 59 commits into from
Aug 13, 2024
Merged

New Bnd + New Save method #110

merged 59 commits into from
Aug 13, 2024

Conversation

CyprienBosserelle
Copy link
Owner

@CyprienBosserelle CyprienBosserelle commented Jun 17, 2024

New Bnd and New save method

This PR superseeds 2 PR: #101 and #98 .
They have been pre-merged to facilitate testing.

Save to file takes too long for many blocks

The problem

The current dev branch save each block independantly to the netcdf file. The bottleneck is the netcdf write function overhead which make writing large model (20000 blocks and more) quite slow.

The solution

To alleviate this needs a new function that combines all blocks in a single array (for each level/variable) and write the whole array at once to the netcdf file.

Hold on

While this will be faster, it is likely inefficient when there are few arrays in a level. Typically when the highest level has only a few block we would still be writing a full array.

Memory is cheap?

This will also be impossible if going to very high level where we won't be able to allocate memory to hold the highest level array.

The real solution

Something that combine both option above and decide what is the best compromise.

Collapse array

This may be a good time to introduce collapsing level to a single array and saving it to disk.

Other things

This branch also includes:

  • fix on AOI polygon
  • Fix for Tsunami initial condition (deform)

Using flux term for new boundary treatment

Proof of concept

  • New wall bnd for halo flux on GPU
  • Same for CPU

Implementation

  • apply wall boundary metafunction designed for AOI wall to model BBox
  • Implement new segment based bnd
  • New abs flux for model BBox
  • Fix Warmstart

Testing

  • New CI test for wall bnd of AOI
  • New CI test for wall of BBox
  • Test new spatially varying forcing for water level

Docs

  • Full documentation page with example
  • Demo of stability/instability and if it solves the problem

… be descarde if it fails but may be pulled to Dev branch if successfull. (#109)

* switch off deflate

* Add function to optimise output writing

* Update Write_netcdf.cu

* debug level index when writting

* fix + update of def nc var

* Make loop increment declaration cleaner

* Hotfix for deform

This has been broken for a while!

* Try fix aoi polygon

* Add parameter to switch on/off the saving per block feature

* Update ReadInput.cu
@CyprienBosserelle CyprienBosserelle marked this pull request as draft June 17, 2024 22:33
@CyprienBosserelle CyprienBosserelle marked this pull request as ready for review June 18, 2024 00:22
@CyprienBosserelle
Copy link
Owner Author

New save method

Added a new variable savebyblk input parameter. default is on if set to off it will save per level which is a lot faster but that require enough memory to allocate the full high res level.

@CyprienBosserelle
Copy link
Owner Author

Crash/Instability fixed: Waikanae instability example

In Waikanae with rain-on-grid the old absorbing boundary (type=3) would crash almost immediately if the boundary intersected Kapiti Island.

The crashing did not happen with type-2 boundary but tsunami like instability occured:
image

The new boundary is very much stable with type=3:
image

@CyprienBosserelle CyprienBosserelle merged commit 36c1e85 into development Aug 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant