Skip to content

initial support for pmr containers in DPL#1593

Merged
ktf merged 2 commits intoAliceO2Group:devfrom
mkrzewic:pmr_in_dpl
Sep 21, 2019
Merged

initial support for pmr containers in DPL#1593
ktf merged 2 commits intoAliceO2Group:devfrom
mkrzewic:pmr_in_dpl

Conversation

@mkrzewic
Copy link
Copy Markdown
Contributor

@mkrzewic mkrzewic commented Jan 15, 2019

depends on #1581

@mkrzewic mkrzewic mentioned this pull request Jan 15, 2019
@ktf ktf self-requested a review January 15, 2019 15:56
Copy link
Copy Markdown
Member

@ktf ktf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change:

class FairMQDevice;

to

#include <FairMQDevice.h>

the rest I am not sure I like, but since I've an idea on how to completely hide DataAllocator all this from the user, I can live with it.

@mkrzewic
Copy link
Copy Markdown
Contributor Author

@ktf, indeed, the need for include was already gone, forgot to change that back. done.

@mkrzewic
Copy link
Copy Markdown
Contributor Author

@ktf on another note - according to @rbx the boost includes are gone - is that verified?

@ktf
Copy link
Copy Markdown
Member

ktf commented Mar 18, 2019

I had a bit of time to rethink about this. I think you have been too conservative. ;-) IMHO, what we should do is to replace newChunk and adoptChunk to basically be what you do in makeVector / adoptVector, basically having std::pmr::vector replace the DataChunk. We can then discuss how to expose a proper API for all the other types, but given that FairMQ now basically supports resizable messages I do not see why DataChunk should limit us to fixed size... I would still not expose the container to the user, like in the current interface, but I guess that for the backend there is not much to gain from having it based around fixed size messages no?

@matthiasrichter what do you think?

@mkrzewic
Copy link
Copy Markdown
Contributor Author

AFAIK there is no support for resizeable messages in FairMQ - last I checked you could only specify a part of the allocated buffer to be sent, the full resize functionality lies with the container (@rbx something new was added?).
Anyway the point of this PR is exactly to expose a container and skip the "ownership manager" abstraction layer, there is no need for that in modern C++, it just makes things complicated.
I consider the "adoptContainer" vital functionality. The "makeVector" part is just for convenience introduced at @ktf request, not really necessary.
I think this PR does not break anything in DPL, so I don't see why it takes so long to merge.

@davidrohr
Copy link
Copy Markdown
Collaborator

@ktf @mkrzewic : This has been stalled since >3 months now. Do we still need it, then we should rebase and merge it at some point?

@ktf
Copy link
Copy Markdown
Member

ktf commented Jul 10, 2019

I would like to see the developments of @matthiasrichter in the same direction before deciding what to do with this.

@matthiasrichter
Copy link
Copy Markdown
Collaborator

I think its independent of the other development which is basically an extension of #1873 / #1846. Its a matter of two different approaches and the arguments have been posted here in this PR.

@davidrohr
Copy link
Copy Markdown
Collaborator

Well, if it is independent and provides useful functionality, I don't see a reason not to merge it, in particular since it is a rather small change and looks elegant. But to be honest, I didn't dive deep enough into the framework to judge if this is just a competing strategy to #1846.

@sawenzel
Copy link
Copy Markdown
Collaborator

sawenzel commented Sep 9, 2019

Is there any new development here? Probably a decision needs to be taken at some point.

@mkrzewic mkrzewic requested a review from a team as a code owner September 17, 2019 12:01
@mkrzewic
Copy link
Copy Markdown
Contributor Author

Dear all, i updated the PR to use Matthias' new MessageContext thingy thereby improving compliance with the way-DPL-does-it. As a reminder: this only adds functionality without breaking or changing anything (except for fixing the broken DPLMerger which looks like dead code anyway).

Copy link
Copy Markdown
Collaborator

@davidrohr davidrohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (besides the clanf-format)

namespace workflows
{
//TODO: this is to make DPLmerger compile, but this code is (and always was) horribly broken - please remove.
inline void freefn(void* data, void* /*hint*/) { delete static_cast<char*>(data); };
Copy link
Copy Markdown
Collaborator

@davidrohr davidrohr Sep 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difficult to judge for me, but if this is broken and should be removed, and it compiles after removal, then it is probably the way to go. I mean, why is it there anyway? Was it just forgotten to remove it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, a remnant after removal of the Stack::freefn long time ago.

@davidrohr
Copy link
Copy Markdown
Collaborator

@ktf @sawenzel : Could you have a look?

@ktf
Copy link
Copy Markdown
Member

ktf commented Sep 17, 2019

Ok, fine with me at this point. I still disagree on the idea, but I guess we need something. @matthiasrichter what do you think?

Copy link
Copy Markdown
Collaborator

@sawenzel sawenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me. @mkrzewic Could you maybe target to add a short markdown documentation how the feature could be used.

@ktf ktf requested a review from matthiasrichter September 18, 2019 09:56
@ktf
Copy link
Copy Markdown
Member

ktf commented Sep 18, 2019

Yes, indeed, documentation and a test would be nice. I assume there is no way to simply call the two adopt and make?

@ktf
Copy link
Copy Markdown
Member

ktf commented Sep 18, 2019

Actually makeVector could become make<o2::vector<T>> and be folded as one of the constexpr ifs, no?

@mkrzewic
Copy link
Copy Markdown
Contributor Author

@ktf, indeed, looks like it could. About the test: I'll think about a test workflow, not sure how to test this "standalone" to actually trigger all the involved dpl internals...

@ktf
Copy link
Copy Markdown
Member

ktf commented Sep 18, 2019

@mkrzewic there is a test already for DataAllocator:

https://github.com/AliceO2Group/AliceO2/blob/dev/Framework/Core/test/test_DataAllocator.cxx

Something simple there would do.

For the renaming we can do it afterwards, unless you find it completely trivial to do.

@ktf ktf merged commit b6848e3 into AliceO2Group:dev Sep 21, 2019
knopers8 pushed a commit to knopers8/AliceO2 that referenced this pull request Oct 23, 2019
carlos-soncco pushed a commit to carlos-soncco/AliceO2 that referenced this pull request Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants