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

EXODUS: Prototype to see if can speed up field metadata output #468

Merged
merged 11 commits into from
Jul 17, 2024

Conversation

gsjaardema
Copy link
Member

Add exi_persist_redef and exi_persist_leavedef which will stay in netCDF define mode even though exi_redef and exi_leavedef are called.

exi_redef and exi_leavedef are wrappers around the netCDF nc_redef and nc_enddef calls that go in and out of defined mode.

If exi_persist_redef is called, it checks whether in define mode and if in persisted define mode. It will either go into define mode, or if already in persistent mode, it will increment a counter which is decremented on exi_persist_leavedef and if reaches a value of 1, it leaves persist define mode.

Note that currently, can only nest the calls up to 7 deep (unchecked) or the counter will wrap around. (Probably not that important to save space with a 3-wide bit field, but that is how it is currently).

This should speed up the ex_put_field_metadata and ex_put_multi_field_metadata calls since they write lots of attributes which move in and out of define mode.

Can also look at not writing empty attributes or defaulted attributes if it is still slow.

@gsjaardema gsjaardema self-assigned this Jul 15, 2024
@gsjaardema gsjaardema marked this pull request as draft July 15, 2024 23:43
@gsjaardema gsjaardema marked this pull request as ready for review July 17, 2024 16:14
@gsjaardema gsjaardema merged commit 3e6500f into master Jul 17, 2024
44 checks passed
@gsjaardema gsjaardema deleted the ex_redef_refactor branch July 17, 2024 16:55
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.

2 participants