-
Notifications
You must be signed in to change notification settings - Fork 62
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
Function to get size of useful payload in hg_proc's buffer #751
Comments
Hmm I'm a bit confused, hg_proc_get_size_used() is supposed to do just that? if you look there: https://github.com/mercury-hpc/mercury/blob/master/src/mercury.c#L789 this is what we already do. Are you saying it's not working at all? |
The code you're pointing to is on the sender side, I think. On the receiver side, in the HG_DECODE part of a deserializer, |
ah ok yeah it would do that. OK maybe we should just have a completely different routine then, outside of the proc stuff ? |
A function outside the proc stuff would work too, and would actually be more generic. I just remembered I had a feature requested about that: #691, for monitoring purpose. So that's two use-cases that could use such a function. |
Add the ability to query input / output payload sizes Update tests to use new routines
I just added the new routines in #753, have a look and let me know if that works for you. |
Add the ability to query input / output payload sizes Update tests to use new routines NA BMI/MPI: return actual msg size through cb info
The API looks good to me, thanks! |
The scenario is as follows: a sender sends an RPC with some data. In the
HG_Get_input
function, when calling thehg_proc_my_type
function to deserialize the input, i see this:hg_proc_get_size(proc)
returns 4080hg_proc_get_size_left(proc)
returns 4080hg_proc_get_size_used(proc)
returns 0To my knowledge, there is no API to obtain how much bytes of useful data the buffer actually holds.
If I serialize 100, 200, 300 bytes, I always get these same values. When I serialize more than 4080 bytes, I see these values increase accordingly, but (1) under 4080 I can't know what is "useful" data, and above 4080 I can't just hope that Mercury has reallocated the buffer to only the size needed.
Could you add an API function to get the payload size?
My use case is that of an RPC handler that has no knowledge of the semantics of the data, it simply gets access to the Mercury buffer and forwards the data to another software component via a non-Mercury channel (ZMQ). Since the final receiver (the other side of the ZMQ channel) knows the semantics, I can afford to just send the full buffer, but it's a waste of bandwidth.
The text was updated successfully, but these errors were encountered: