Skip to content

cilk reducer use in lower level #153

Answered by ailiop
adnan4791 asked this question in Q&A
Discussion options

You must be logged in to vote

@adnan4791 Hi Adnan!

Thank you for this question. The code you posted certainly shows a correct way of implementing a recursive parallel reduction. In OpenCilk, however, reducers work fairly differently. A principal difference, in particular, is that the OpenCilk runtime internally implements various optimizations to handle reducers efficiently.

Let me go over a couple of similar code snippets to show the semantics of Cilk reducers and demonstrate at least one optimization that OpenCilk does internally. You can also find these codes in this attached (and zipped) source file: reducer-implementation-illustration.zip

Reducers and cilk_for in OpenCilk 2.0

Just as a starting/reference point, h…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@adnan4791
Comment options

Answer selected by adnan4791
Comment options

You must be logged in to vote
1 reply
@neboat
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants