Previous | Next --- Slide 12 of 63
Back to Lecture Thumbnails
nba16235

Usually how much speedup could we gain from the best granularity? I'm asking this because I'd like to know if it's worth the time to find the best granularity iteratively.

ant

That would depend on the operating system and hardware specifics. We could iteratively tune the granularity to determine the best value for a particular system, but that code would obviously not be portable. Moreover, it might lead to "magic numbers", like the value 10 in this slide that could make it hard for future maintainers of the code to understand the implementation.

carnegieigenrac

Would it be a reasonable idea to have a dynamic parallel program which decreases the granularity over the course of the computation? It seems to me that smaller granularity become increasingly preferred over as the computation becomes closer to completion, as it becomes more necessary to balance the thread workloads.

bob_sacamano

@carnegieigenrac I don't think dynamically adjusting the granularity would help much, especially when you do not have any knowledge about the input at compile time. What if you're left with a bunch of tasks in the end, that would take about the same time to complete? Switching to fine granularity would increase the time in critical section and wouldn't achieve better work partitioning than coarse granularity.