MT produces wrong results for complicated with-loop generator layouts
Bugzilla Link | 22 |
Created on | Oct 13, 2003 19:34 |
Resolution | FIXED |
Resolved on | Jul 30, 2011 16:19 |
Version | 1.00beta |
OS | All |
Architecture | All |
Attachments | bug22.sac |
Extended Description
Even on single-processor machines (!) MT produces wrong results for complicated with-loop generator layouts. **** SAC program to reproduce the error: ****** import StdIO: all; int main() { A = with (. <= idx <= . step [2,1]) genarray( [13,7], [1,2,3]); B = with (. <= idx <= . step [1,2]) /* or: step [1,1] */ genarray( [13,7], [4,5,6]); C = with (. <= idx <= .) modarray( A, idx, A[idx] + B[idx]); print( C); return( 0); } ****** sac2c call: ******************* sac2c -mt (use the OLD backend!!) ****** program call: ***************** a.out -mt 1 -> correct result a.out -mt 5 -> wrong result ************************************** With multiple threads used, the result array contains wrong values. Since this problem occurs even on single-processor machines, it may be caused by the scheduler which may calculate wrong/illegal iteration bounds for some threads.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information