Previous | Next --- Slide 11 of 50
Back to Lecture Thumbnails
arkhan

This reminds me of mergesort, I wonder whether there is an optimal division of elements between fold() and comb()

nickbowman

@arkhan That's an interesting thought, and it seems to be like the optimal division here might depend on what amount of made parallelism is available to you by the hardware – if you had 8 separate execution contexts as we did in previous assignments, I'd guess you'd want to split the sequence up into 8 parts, run fold on those in parallel, and then combine together the results.

felixw17

I agree with arkhan's comment, this reminds me of divide and conquer except from a bottom-up perspective as opposed top-down (as quicksort and mergesort are).

itoen

The reason why there is no need for comb if f is an associative binary operator is that we can just apply f directly onto these "partial-results". Since addition is an associative binary operator we could calculate say a+b+c+d+e+f as (a+b+c) + (d+e+f), where the combiner function is just an addition.

l-henken

It seems like Map exploits a different level of parallelism than Parallel Fold. Map exploits element-level parallelism (each element has no dependencies) whereas Parallel Fold leverages an identity seed to exploit subsequence-level parallelism (each subsequence has no dependencies). What are the distinctions between these levels of parallelism in the data-parallel model?

Please log in to leave a comment.