-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add reference implementation for parallel_block feature #1570
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: pavelkumbrasev <[email protected]>
Signed-off-by: pavelkumbrasev <[email protected]>
Signed-off-by: pavelkumbrasev <[email protected]>
Signed-off-by: Isaev, Ilya <[email protected]>
Signed-off-by: Isaev, Ilya <[email protected]>
…rallel_block Signed-off-by: Isaev, Ilya <[email protected]>
Signed-off-by: Isaev, Ilya <[email protected]>
@akukanov @aleksei-fedotov @vossmjp Could you please take a look at the PR in terms of implementation and ABI. P.S. Tests are still WIP. |
Signed-off-by: Isaev, Ilya <[email protected]>
Signed-off-by: Isaev, Ilya <[email protected]>
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.
Not a complete review, just a couple of starters to think about.
if (is_worker_should_leave(slot)) { | ||
if (!governor::hybrid_cpu()) { | ||
if ( | ||
#if __TBB_PREVIEW_PARALLEL_BLOCK | ||
!my_arena.my_thread_leave.should_leave() | ||
#else | ||
!governor::hybrid_cpu() | ||
#endif | ||
) |
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.
A readability issue. These should_leave
functions do not convey any additional meaning except for whether thread should leave or not. In this case I would move all the logic into single main should_leave
function, which would include a set of probes with more meaningful names the "leaving" algorithm is based on, such as below "my_arena.my_threading_control->is_any_other_client_active()" or "is_recall_requested". In my opinion, the general "should_leave" name is good for the most embracing function of such kind, not a set of smaller functions that check various parts of the system.
|
||
#if __TBB_PREVIEW_PARALLEL_BLOCK | ||
TBB_EXPORT void __TBB_EXPORTED_FUNC register_parallel_block(d1::task_arena_base&); | ||
TBB_EXPORT void __TBB_EXPORTED_FUNC unregister_parallel_block(d1::task_arena_base&, bool); |
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 anticipate any future extension? In other words, does it make sense to accept an untyped pointer for any future details?
TBB_EXPORT void __TBB_EXPORTED_FUNC unregister_parallel_block(d1::task_arena_base&, bool); | |
TBB_EXPORT void __TBB_EXPORTED_FUNC unregister_parallel_block(d1::task_arena_base&, void* /*supplemental details*/); |
Also, I don't think single bit can be passed. At least a word (or even more?) is used anyway. Then, it makes sense to accept at least that width and do not kill opportunity for future extensions:
TBB_EXPORT void __TBB_EXPORTED_FUNC unregister_parallel_block(d1::task_arena_base&, bool); | |
TBB_EXPORT void __TBB_EXPORTED_FUNC unregister_parallel_block(d1::task_arena_base&, unsigned short/*supplemental details*/); |
Please double check what size of information is passed.
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.
Yeah, I also have been thinking about that. Perhaps we should pass std::uintptr_t
instead of void*
?
Signed-off-by: Isaev, Ilya <[email protected]>
Co-authored-by: Aleksei Fedotov <[email protected]>
Description
Add a comprehensive description of proposed changes
Fixes # - issue number(s) if exists
Type of change
Choose one or multiple, leave empty if none of the other choices apply
Add a respective label(s) to PR if you have permissions
Tests
Documentation
Breaks backward compatibility
Notify the following users
List users with
@
to send notificationsOther information