Skip to content

Close HDF5 handles eagerly when reading and writing MPS and MPO - #225

Merged
mtfishman merged 5 commits into
mainfrom
mf/hdf5-close-handles
Sep 27, 2026
Merged

mtfishman merged 5 commits into
mainfrom
mf/hdf5-close-handles

Conversation

@mtfishman

@mtfishman mtfishman commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

HDF5 handles were left open until garbage collection, so repeated reads slowed down (https://itensor.discourse.group/t/2639). Now they are closed on return, and the ITensors and NDTensors compat floors are raised to the releases with the same fix for the per-tensor readers.

The HDF5 readers and writers left group and attribute handles open until garbage collection, so repeated reads got slower and slower (https://itensor.discourse.group/t/2639). They are now closed on return. The leaks inside each site tensor are fixed in ITensor/ITensors.jl#1781.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.15%. Comparing base (993960f) to head (2210fb2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ext/ITensorMPSHDF5Ext/mpo.jl 94.44% 1 Missing ⚠️
ext/ITensorMPSHDF5Ext/mps.jl 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
+ Coverage   90.13%   90.15%   +0.02%     
==========================================
  Files          52       52              
  Lines        3577     3587      +10     
==========================================
+ Hits         3224     3234      +10     
  Misses        353      353              
Flag Coverage Δ
docs 18.11% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

mtfishman and others added 4 commits September 27, 2026 12:33
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mtfishman mtfishman changed the title [WIP] Close HDF5 handles eagerly when reading and writing MPS and MPO Close HDF5 handles eagerly when reading and writing MPS and MPO Sep 27, 2026
@mtfishman
mtfishman marked this pull request as ready for review September 27, 2026 22:24
@mtfishman
mtfishman enabled auto-merge (squash) September 27, 2026 22:24
@mtfishman
mtfishman merged commit 2a98a99 into main Sep 27, 2026
25 of 28 checks passed
@mtfishman
mtfishman deleted the mf/hdf5-close-handles branch September 27, 2026 23:21
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