Fix-HDF5-buffered-reads-and-writes-for-shape-datasets#52
Conversation
|
Need to test with Fortran code writing this file and check if this issue appears again. imas:hdf5?path=/home/ITER/pankina/public/d3d/4/163518/75 |
fleuryl-ai
left a comment
There was a problem hiding this comment.
It was not an easy bug... The patch seems fine. Thanks a lot.
This is still under investigation, as it is not clear if the fix is hiding the problem. Looking at some of the shapes of the HDF5 datasets there seem to be odd things, possibly due to inconsistent AoS sizes inside two time slices
|
|
Between I could not reproduce the segfault with the files I have created in Python and Fortran. create_d3d_like_mhd_f90.txt import imas
entry = imas.DBEntry("imas:hdf5?path=/home/ITER/sawantp1/github/IMAS-Core/testdata/d3d_mhd_fortran", "r")
ids = entry.get("mhd", occurrence=0, lazy=True, autoconvert=False)
ids.grid_ggd[0].space[0].objects_per_dimension[3].object[0].geometry[0]$ python test.py
16:21:32 INFO Parsing data dictionary version 4.1.0 @dd_zip.py:89
Traceback (most recent call last):
File "/home/ITER/sawantp1/github/IMAS-Core/test.py", line 8, in <module>
ids.grid_ggd[0].space[0].objects_per_dimension[3].object[0].geometry[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/work/imas/opt/EasyBuild/software/IMAS-Python/2.2.0-intel-2023b/lib/python3.11/site-packages/imas/ids_primitive.py", line 224, in __getitem__
return self.value[index]
~~~~~~~~~~^^^^^^^
IndexError: index 0 is out of bounds for axis 0 with size 0
$ module list 2>&1 | grep IMAS
15) libxml2/2.11.5-GCCcore-13.2.0 43) IMAS-Core/5.5.2-intel-2023b
16) ncurses/6.4-GCCcore-13.2.0 44) IMAS-MDSplus-models/5.5.2-GCCcore-13.2.0-DD-4.1.0
17) libreadline/8.2-GCCcore-13.2.0 45) IMAS-Data-Dictionary/4.1.0-GCCcore-13.2.0
18) Java/21 -> Java/21.0.5 46) IMAS-Fortran/5.5.0-intel-2023b-DD-4.1.0
27) fmt/10.2.1-GCCcore-13.2.0 55) IMAS-Python/2.2.0-intel-2023b
$It seems that files were created in MDSplus and then converted to HDF5 with idscp
Thank you.. |
fixes a crash when reading some HDF5 shape datasets through the
buffered read path also fixes the same indexing problem in the buffered write path.
geometrystores the actual values and has 5 dimensionsgeometry_SHAPEstores the length ofgeometryfor each object. It hasonly 4 dimensions::
indices.push_back(0);always added one extra index when reading or writing 1D data.That is correct for
geometry, but wrong forgeometry_SHAPE.checks the dataset rank before adding the extra index.
0.