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
Added a gather() function to gather std::map into the root process; #74
base: master
Are you sure you want to change the base?
Conversation
added StringBuffer as an alternative to MemoryBuffer, in order to ease the serialization to std::string; serializeToString() is used in the new gather() function.
@hguo We are doing all merge requests on Kitware's GitLab. Can you move this there? |
@hguo Also, when you do, can you give some context about what you are trying to accomplish? |
I am not trying to accomplish any specific goal in this PR. I wrote and use these utility functions for my own ease in my multiple codes including FTK and vortexfinder, and I think it might be a good idea to make them official in DIY. |
Let's move this to GitLab, but I still want to understand what this buys you. I.e., what does this do that regular |
MemoryBuffer and StringBuffer essentially do the same thing. The reason that I prefer strings is because of legacy codes:
I don't have a GitLab account yet but will do after I got one. |
I see. Would it make sense instead to add a way to convert |
That should work; the drawback is introducing extra memcpy. Is it possible to specify the "backend" container for MemoryBuffer by using a template? The container can be std::vector by default.
|
Oh, that's an interesting idea. Let me think about it; there are a couple of thorny technical issues, but that would be a very good solution if we can make it work. |
Maybe we can use typedef:
|
Right, I was thinking the same. I'm actually looking into what happens if we just use |
added StringBuffer as an alternative to MemoryBuffer, in order to
ease the serialization to std::string; serializeToString() is used
in the new gather() function.