This seems weird, but cilkscreen reports data race on reducer variable. The code, and corresponding output of cilkscreen is shown below. user@velour:~/tmp/cilk_tests$ cat reducer_test.c #include #include #include #include #include using namespace std; cilk::reducer_opadd total(0); int main() { const int STAT_SIZE = 2; const int N=10; cilk_for(int i=0 ; i total += 1; } cout << "total =" << total.get_value() << endl; return 0; } user@velour:~/tmp/cilk_tests$ icpc -g reducer_test.c user@velour:~/tmp/cilk_tests$ icpc -V Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.1.107 Build 20101116 Copyright (C) 1985-2010 Intel Corporation. All rights reserved. user@velour:~/tmp/cilk_tests$ cilkscreen ./a.out Cilkscreen Race Detector V2.0.0, Build 1113 Race condition on location 0x6024c0 write access at 0x4014a8: (~/aamirshafi/intel/composerxe-2011.1.107/compiler/include/cilk/reducer_opadd.h:320, cilk::reducer_opadd::operator+=+0x30) read access at 0x4014a2: (~/aamirshafi/intel/composerxe-2011.1.107/compiler/include/cilk/reducer_opadd.h:320, cilk::reducer_opadd::operator+=+0x2a) called by 0x7f7d6110860d: (__$U2+0x9d) called by 0x7f7d611083a0: (cilk_for_recursive+0x100) called by 0x7f7d61108739: (__$U0+0x99) called by 0x7f7d61108089: (__cilkrts_cilk_for_32+0xf9) called by 0x400fa1: (~/aamirshafi/tmp/cilk_tests/reducer_test.c:16, main+0x65) Race condition on location 0x6024c0 write access at 0x4014a8: (~/aamirshafi/intel/composerxe-2011.1.107/compiler/include/cilk/reducer_opadd.h:320, cilk::reducer_opadd::operator+=+0x30) write access at 0x4014a8: (~/aamirshafi/intel/composerxe-2011.1.107/compiler/include/cilk/reducer_opadd.h:320, cilk::reducer_opadd::operator+=+0x30) called by 0x7f7d6110860d: (__$U2+0x9d) called by 0x7f7d611083a0: (cilk_for_recursive+0x100) called by 0x7f7d61108739: (__$U0+0x99) called by 0x7f7d61108089: (__cilkrts_cilk_for_32+0xf9) called by 0x400fa1: (~/aamirshafi/tmp/cilk_tests/reducer_test.c:16, main+0x65) total =10 2 errors found by Cilkscreen Cilkscreen suppressed 16 duplicate error messages Cant tell the version of the cilkscreen since using -v option gives an error. But the cilkview version info is below: user@velour:~/tmp/cilk_tests$ cilkscreen -v E:Unable to load ~/aamirshafi/work/install/cilkutil/bin/../lib32/cilkscreen-tool.so: libimf.so: wrong ELF class: ELFCLASS64 user@velour:~/tmp/cilk_tests$ cilkview -v cilkview v2.0.1049.0 Copyright (c) 2010 Intel Corp. All rights reserved user@velour:~/tmp/cilk_tests$ uname -a Linux velour 2.6.29-tps+perfctr+fpufix #1 SMP Sat Sep 4 22:20:28 EDT 2010 x86_64 GNU/Linux --Aamir
cilkscreen showing races on reducers
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.


