Closed computablee closed 11 months ago
All modified lines are covered by tests :white_check_mark:
Comparison is base (
26c0fb1
) 90.06% compared to head (2d604ef
) 93.28%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which issue are you addressing?
Closes #39
How have you addressed the issue?
There has been a significant amount of refactoring done in the inner scheduler code to make this possible. This PR adds the
Wrappers.cs
file, which contains several new delegates and theForAction<T>
class. The methods inIter
now defer toForAction<T>.PerformLoop
to execute a chunk. The overhead should be negligible for non-collapsed loops. For collapsed loops, new control flow exists to un-flatten the indices from the scheduler into 2D, 3D, 4D, or even higher dimensional loops. This infrastructure exists with both non-reduction and reduction loops. New methods have been implemented into theParallel
class, includingForCollapse
,ForReductionCollapse
,ParallelForCollapse
, andParallelForReductionCollapse
, each with several overloads based on the collapse factor.How have you tested your patch?
New tests have been written, namely
Collapse_works
andReduction_collapse_works
. Both of these are passing.Additional work
This PR also creates the
benchmarks/
subfolder, which will be the home for benchmarking DotMP. For a performance-oriented library, I am utterly ashamed at the lack of benchmarking that has happened. I hope to useBenchmarkDotNet
to power benchmarks, but it is still a WIP.I have also changed the access modifier of
Lock._lock
frominternal
toprivate
. With the new API, there is no reason for_lock
to be internal.