Skip to content
Commit 55de0ded authored by PAUL M CARPENTER's avatar PAUL M CARPENTER
Browse files

Fix pragmas in manual_simple

Fix the pragma annotations in manual_simple, which were:

  out(arr1[0;SIZE]) for initialization of arr1 - CORRECT
  out(arr1[0;SIZE]) for initialization of arr2 - WRONG
  out(arr2[0;SIZE]) for initialization of sum - WRONG

Naively you might think that even with wrong pragmas it should work, because
the wrong pragmas still mean that all arrays must have been initialized before
any of the strong tasks can execute. Also (1) the location of arr2 will be
correct (node 0, since all initialization tasks execute on node 0) and (2) the
location of sum will be wrong, but it doesn't matter because memory starts off
as zeros on all the nodes anyway.

The problem is caused by eager weak fetch. If satisfiability of arr2 (actually
meaning that sum has been initialized) reaches a weak task before that weak
task has been scheduled and before arr2 is initialized, then the weak task will
fetch zeros for arr2. It will then set the location to the current node and
pass that to its descendants and eventually to the strong tasks. This is what was
happening, some of the calculated values were 3+0 = 3 rather than 3+4 = 7.
parent 1f8b9f65
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment