-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Use tbb::task_group::defer in FinalWaitingTask #38715
Conversation
A new Pull Request was created by @Dr15Jones (Chris Jones) for master. It involves the following packages:
@cmsbuild, @smuzaffar, @Dr15Jones, @makortel can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d96a8e/26204/summary.html Comparison SummarySummary:
|
Could you rebase so the first commit (which was merged for the previous IB) would get dropped? |
- This will allow the task_group wait to stay open until the FinalWaitingTask is recycled - Added FinalWaitingTask::wait method to handle the usual usage pattern of throwing after wait if needed.
400301f
to
5de7db4
Compare
please test |
@makortel rebased |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38715/31033
|
Pull request #38715 was updated. @makortel, @smuzaffar, @Dr15Jones can you please check and sign again. |
public: | ||
FinalWaitingTask() = delete; | ||
explicit FinalWaitingTask(tbb::task_group& iGroup) | ||
: m_group{&iGroup}, m_handle{iGroup.defer([]() {})}, m_done{false} {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if always adding an empty deferred task could add any visible overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is only used when shutting down the event loop so I doubt it can be seen at all.
|
||
[[nodiscard]] bool done() const noexcept { return m_done.load(); } | ||
|
||
void wait() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about having similar nomenclature with SYCL queues? (asking since SYCL/DPC++ is part of the oneAPI) There the wait()
does not throw, and one has to ask wait_and_throw()
explicitly to have exceptions (from asynchronous processing) to throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we care at all. I went with consistency with tbb::task_group::wait
which can throw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, consistency with oneTBB's nomenclature is more important.
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d96a8e/26217/summary.html The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
You can see more details here: Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
PR validation:
Framework unit tests pass.