Closed Moelf closed 9 months ago
Btw, we also need a nested example and Fibonacci could be a candidate for this. (But we can also take something basic)
How about I convert this to nested example, at which level do we parallel?
Hm, maybe Fibonacci isn't the best example after all. What we want is likely the following: a simple parallel program that we then run as part of a parallel reduction. I.e. a parallel mapreduce(f, +, ...)
where f
is also parallelised (and produces uniform workload). However, to be able to use and compare @threads
, we need a for-loop kind of parallelization and this is probably non-trivial for Fibonacci (although potentially doable). I think we should just choose any simple and convenient parallel algorithm.
(Maybe a basic parallel matmul could be a choice for f
? Or the standard parallel pi computation? I'm not very creative right now 😄)
This is a mapreduce with
f=fib
. I would use a local summation for each task and only write to the outer array once at the end. See the mapreduce folder.