Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: X10 SVN HEAD
-
Fix Version/s: X10 2.4
-
Component/s: Work-Stealing Compiler and Runtime, X10 Compiler: Front-end
-
Labels:None
-
Environment:-O -NO_CHECKS -WORK_STEALING=true
-
Testcase included:yes
-
Number of attachments :
Description
The following code compiles happily with x10/x10c++, and should print "1.0".
var x:Double = 0; finish { for (i in 1..100) async { if (i == 17) { x = 1.0; } } } Console.OUT.println("x = " + x);
When compiled with the default (help-first) runtime, it prints "1.0" as expected. However when compiled with -WORK_STEALING=true, it prints "0.0".
Interesting this only happens in the context of a loop; for example the following works correctly:
var x:Double = 0; finish { async x = 1.0; } Console.OUT.println("x = " + x);
We transform loop this into a divide-and-conquer parallel loop. The transformation incorrectly captures x by value.