Use case: container/range reductions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 598
- Forks
- 118
- Avg merge
- 21h 29m
- Merged PRs (30d)
- 1
Description
I'm looking at using RAJA within Dyninst as a quick way to test and migrate among various forms of parallelism (cilk, openmp, tbb are the three of interest right now, as well as retaining serial capabilities). One of the things I want to parallelize is of the general form:
Worklist current, new;
while(!current.empty()) {
for(x in current) {
Worklist tmp = do_work(x);
new += tmp;
}
swap(new, current);
}
where += is a set union on Worklists. This leads to a natural forall-reduce idiom if reductions support anything with an operator+= that takes responsibility for its own thread safety; however, I've not been able to hack out an outside-RAJA extension that works.
Two questions:
- Is this something that should work without messing with RAJA internals, or am I reading things right that any Reducer is implicitly scalar only as there's no way to create a const_expr representing an empty STL container?
- If I coded up an extension that allows Reducers to use insert(begin, end) as a sum operation, is that something you guys would be interested in adding? My general thinking is that SFINAE should allow a user to specify reducers that only work with certain policies, as long as there's at least two policies that work.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading RAJA's reducer and reduction-policy support, then trace how a const_expr represents an initial value and how policy-specific reducers are selected. Reproduce the container/range reduction pattern described with Worklist and operator+=, and compare it with an insert(begin, end) approach. Done means the supported scope for non-scalar reducers and policy requirements is documented or an accepted extension path is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- hpc
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100