Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct implementation of providing arrays for channel I/O #24

Open
nsoblath opened this issue Apr 10, 2018 · 0 comments
Open

Correct implementation of providing arrays for channel I/O #24

nsoblath opened this issue Apr 10, 2018 · 0 comments

Comments

@nsoblath
Copy link
Member

The Problem

At some point relatively recently I added a feature to allow the user to provide arrays to be used for channel I/O with the HDF5 library. I did this badly. In particular, I provided this functionality through the channel record objects, while in M3Stream the actual I/O with the HDF5 library is made via the stream record object. User access is typically through the channel record(s).

The Complication

This would be a simple fix except that there are two "cases" that are characterized by different relationships between the stream and channel records:

  • Case A: channel records share memory with the stream record; memory is owned by the stream record
    • Sequential arrangement of channels w/in the stream
    • Any interface method
    • Any number of channels
  • Case B: channel records and stream records have their own memory
    • Interleaved arrangement of channels w/in the stream
    • Separate interface method
    • 1 channel

The Fix

  • M3Stream must be in charge of the interface for users to provide their own arrays for I/O.
  • In Case B, M3Stream should provide the memory for the channel records, and it should enforce that the arrays are sequential such that it could be assigned as a single block of memory.
  • The access functions in M3Stream that allow a user to provide the memory for I/O should accept a single memory block, and it is then responsible for setting that memory block either in the stream record (Case A) or for the channel records (Case B).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant