investigate zero-copy read API for Ioss #282
Replies: 4 comments 1 reply
-
Thank you for the proposal. This will be a good location to discuss this. I editted the above comment and change the first issue to 'Not every database needs to support...' |
Beta Was this translation helpful? Give feedback.
-
Thanks for opening this issue, Utkarsh. Below are some of my thoughts on the current and proposed state of memory usage when a simulation code calls Catalyst through IOSS using API 1, API 2, and the proposed zero-copy interface (descriptions may or may not be entirely accurate). Current IOSS (Catalyst API 1)
Current IOSS (Catalyst API 2)
Proposed IOSS zero-copy (Catalyst API 2)
The current IOSS Catalyst API 2 implementation uses about twice the memory as Catalyst API 1? The proposed zero-copy interface will use some amount of memory more than the Would it be possible for the simulation code to indicate that a field is zero-copyable on write to IOSS? In that case, the simulation would need to persist the buffer through the call to Catalyst or give a reference to some persistent data in the correct ordering for IOSS. This might realize even better memory savings than current Catalyst API 1. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Issue:
|
Beta Was this translation helpful? Give feedback.
-
With Catalyst support, it is possible to use Ioss for in situ processing. Currently, however, when the data is read in on ParaView side, it gets deep-copied. This proposal is intended to avoid that deep copy.
Proposal
Ioss::GroupingEntity::get_field_data(...)
is used to read data. Current API requires that the target memory is already allocated by the caller code. To support zero-copy, we can add an overload that returns references to internally held memory instead.Issues
Not every database needs to support zero-copy. Nor is every field zero-copyable e.g. if a field has transforms defined, it's not zero-copyable.
This will require that we have some mechanism to query each
Field
if it's zero-copyable. This could be added a member-variable onIoss::Field
which can be set by the database when creation to indicate if a field is zero-copyable. Readers can check this to determine whether to use zero-copy API or standard API.The zero-copy would return a reference to the actual data being stored somewhere; if the calling code wants to, it can modify the data. Maybe change to
const void * const* data
or somehow disallow modifying the underlying copy of the dataBeta Was this translation helpful? Give feedback.
All reactions