Skip to content

Conversation

@pnorbert
Copy link
Contributor

Add defer_read=bool option to Stream.read() and Stream.read_in_buffer() functions. Need to use Stream.read_complete() to make sure data is read into the numpy/etc arrays. Timing test added to examples/hello/deferredRead

$ python3 ./deferred_timing_test.py
Write 1000 arrays of [100, 1000] shape
Time of writing: 1.082126s
Incoming nx, ny, nvars = 100, 1000, 1000
Time of reading one by one (Sync mode): 0.306817s
Incoming nx, ny, nvars = 100, 1000, 1000
Time of reading at once (Deferred mode): 0.067873s

@pnorbert pnorbert requested a review from anagainaru May 21, 2025 18:08
@pnorbert pnorbert requested a review from vicentebolea as a code owner May 21, 2025 18:08
@pnorbert pnorbert force-pushed the python-read-deferred2 branch 2 times, most recently from a14ef7e to 78742d5 Compare May 21, 2025 18:18
…() functions. Need to use Stream.read_complete() to make sure data is read into the numpy/etc arrays. Timing test added to examples/hello/deferredRead

$ python3 ./deferred_timing_test.py
Write 1000 arrays of [100, 1000] shape
Time of writing: 1.082126s
Incoming nx, ny, nvars = 100, 1000, 1000
Time of reading one by one (Sync mode): 0.306817s
Incoming nx, ny, nvars = 100, 1000, 1000
Time of reading at once (Deferred mode): 0.067873s
@pnorbert pnorbert force-pushed the python-read-deferred2 branch from 78742d5 to ef9be6d Compare May 21, 2025 18:20
Copy link
Member

@anagainaru anagainaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I will run it on Frontier can come back with an Approve

count=[],
block_id=None,
step_selection=None,
defer_read: bool = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised the format did not complained about this :)

Suggested change
defer_read: bool = False,
defer_read: bool=False,

count=[],
block_id=None,
step_selection=None,
defer_read: bool = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
defer_read: bool = False,
defer_read: bool=False,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flake8 does not like your perfectly reasonable suggestions.
python/adios2/stream.py:566: [E252] missing whitespace around parameter equals

@pnorbert pnorbert merged commit 679f9b1 into ornladios:master May 22, 2025
39 checks passed
@pnorbert pnorbert deleted the python-read-deferred2 branch May 22, 2025 12:06
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.

2 participants