Skip to content

Commit

Permalink
Merge pull request #355 from ax3l/fix-support-null-blocks
Browse files Browse the repository at this point in the history
ADIOS2: Support NULL-Blocks (Chunks)
  • Loading branch information
RemiLehe authored Feb 2, 2023
2 parents bffb850 + f11cdd3 commit bbc5d6b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ def get_data(series, record_component, i_slice=None, pos_slice=None,
data = np.full(record_component.shape, np.nan, record_component.dtype)
for chunk in chunks:
chunk_slice = chunk_to_slice(chunk)

# skip empty slices
# https://github.com/ornladios/ADIOS2
volume = 1
for csl in chunk_slice:
volume *= csl.stop - csl.start
if volume == 0:
continue

# read only valid region
x = record_component[chunk_slice]
series.flush()
Expand Down Expand Up @@ -98,6 +107,15 @@ def get_data(series, record_component, i_slice=None, pos_slice=None,
s_valid = list(s) # same as s but reduced to valid regions in chunk
s_target = [] # starts and stops in sliced array
chunk_slice = chunk_to_slice(chunk)

# skip empty slices
# https://github.com/ornladios/ADIOS2
volume = 1
for csl in chunk_slice:
volume *= csl.stop - csl.start
if volume == 0:
continue

# read only valid region
for d, slice_d in enumerate(s):
start = chunk_slice[d].start
Expand Down

0 comments on commit bbc5d6b

Please sign in to comment.