Note that there are some explanatory texts on larger screens.

plurals
  1. POParallelization of a quadratic algorithm
    primarykey
    data
    text
    <p>Let's say I have a vector (array, list, whatever...) V of N elements, let's say V<sub>0</sub> to V<sub>(N-1)</sub>. For each element V<sub>i</sub>, a function f(V<sub>i</sub>,V<sub>j</sub>) needs to be computed for every index j (including the case i=j). The function is symmetric so that once f(V<sub>i</sub>, V<sub>j</sub>) is computed, there is no need to recompute f(V<sub>j</sub>,V<sub>i</sub>). Then we have N(N+1)/2 total evaluations of the function, making this a O(N<sup>2</sup>) algorithm. Let's assume the time it takes to compute f is relatively long but consistent.</p> <p>Now, I want to parallelize the execution of the algorithm. I need to determine a schedule for (some number M of) worker threads so that two threads do not use the same part of memory (i.e. the same element) at the same time. For example, f(V<sub>1</sub>,V<sub>2</sub>) could be evaluated parallel to f(V<sub>3</sub>,V<sub>4</sub>), but not parallel to f(V<sub>2</sub>,V<sub>3</sub>). The workflow is divided into steps such that for each step, every worker thread performs one evaluation of f. The threads are then synchronized, after which they proceed to the next step and so on.</p> <p>The question is, how do I determine (preferably optimally) the schedule for each thread as a series of index pairs (i,j) so that the complete problem is solved (i.e. each index pair visited exactly once, considering the symmetry)? While a direct answer would of course be nice, I'd also appreciate a pointer to an algorithm or even to relevant websites/literature.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload