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

Add seek and tell to Python CuFile object #576

Open
jakirkham opened this issue Dec 10, 2024 · 3 comments
Open

Add seek and tell to Python CuFile object #576

jakirkham opened this issue Dec 10, 2024 · 3 comments

Comments

@jakirkham
Copy link
Member

jakirkham commented Dec 10, 2024

To make it easier to drop CuFile objects in where other Python file objects are accepted, it would be nice to have seek and tell methods. This would allow a user to go to a file offset and also check what file offset they are at.

@madsbk
Copy link
Member

madsbk commented Dec 11, 2024

I think it could be a good idea, but it will require some smart chunking under the hood. This is because all of our reads and writes (incl. all of the cuFile API) takes ranges.

@jakirkham
Copy link
Member Author

Could we simply store an off_t offset inside the CuFile object that we then simply do some integer math with to determine where to read and write from?

Or is there some existing behavior under-the-hood that would complicate this approach?

@madsbk
Copy link
Member

madsbk commented Dec 11, 2024

Sorry, yes that would work. I was more thinking of using it together with #577 where stream read and write would not use GDS or parallel IO if we don't do something clever :)

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

No branches or pull requests

2 participants