-
Notifications
You must be signed in to change notification settings - Fork 63
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
GrB_Vector_(de)serialize #175
Comments
They should exist, in my opinion. See GraphBLAS/graphblas-api-c#36 . I only follow the spec, and I've put in an issue to the GraphBLAS C API committee to consider adding them. I've added my own as GxB_Vector_serialize and deserialize. |
I closed this by mistake ... should be left open until the C API spec is updated. |
sounds good. i prepend the size of the serialized buffer first, then the buffer, then align the tail to 2MB as i'm using O_DIRECT. so when i control the memory it's as simple as a single meta write. but when i don't control the memory i have to do it in up to 3 stages (head + body + tail). so just makes the code more unnecessarily complex though still less than 40 lines. and 10 lines the other way. |
oh and thanks for these functions! allowed me to delete the multi hundred line serialization and deserialization functions i'd written myself. less code is always more. |
Glad to help! Yes, the serialize/deserialize methods are very important. I put a lot of work into them to make the serialized blobs as compact as possible, now with ZSTD compression by default. I hadn't considered the idea of rounding up the size to a multiple of 2MB, but then that would only make sense if all you had was the blob ... but you want to (naturally) add the blobsize at the front. Actually, the first 8 bytes of the serialized blob contains the size of the blob itself. But the blob is supposed to be opaque, and that feature of my blob is not supposed to be visible to the user application. So you can't rely on that fact, unfortunately. See this line for the first thing in my blob header: GraphBLAS/Source/GB_serialize.c Line 301 in b5ae1ed
... shhhh ... you didn't see that line of code :-) |
i just ran into a need for this. when forking, to then serialize the copy-on-write copies of the matrix and vector objects into IPC shared memory segments between the parent and child process, there's of course no way with the current API to instruct GrB_Vector_serialize to write into the shared memory region. |
any fundamental reason why these functions don't exist, or just simply "on the docket"?
The text was updated successfully, but these errors were encountered: