Skip to content

Commit 3142d26

Browse files
committed
fix: preserve uint64 ID type in HDF5 extension check
Avoids using `iterrows()` which implicitly casts Darshan record IDs to float64, potentially breaking file_map lookups for large IDs. Replaced with `itertuples()` to maintain original dtype and re-enabled `break` for early exit.
1 parent d611255 commit 3142d26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drishti/handlers/darshan_util.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,10 +1037,12 @@ def has_hdf5_extension(self) -> bool:
10371037
if self._has_hdf5_extension is None:
10381038
self._has_hdf5_extension = False
10391039
mpi_df = self.report.records[ModuleType.MPIIO].to_df()
1040-
for index, row in mpi_df['counters'].iterrows():
1041-
if self.file_map[int(row['id'])].endswith('.h5') or self.file_map[int(row['id'])].endswith('.hdf5'):
1040+
# for index, row in mpi_df['counters'].iterrows(): # Implicitly converts all data to np.float64. Problematic for id (np.uint64)
1041+
for row in mpi_df['counters'].itertuples(index=False):
1042+
# if self.file_map[int(row['id'])].endswith('.h5') or self.file_map[int(row['id'])].endswith('.hdf5'):
1043+
if self.file_map[row.id].endswith('.h5') or self.file_map[row.id].endswith('.hdf5'):
10421044
self._has_hdf5_extension = True
1043-
# break
1045+
break
10441046
return self._has_hdf5_extension
10451047

10461048
@cached_property

0 commit comments

Comments
 (0)