- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The TBB Thread Checker was flagging all kinds of write/read errors in my application. So I paired it down to the following...which still produces errors in thread checker. The following is the simple source code and results of the checker. Is there something wrong with how I am using parallel_for or perhaps the checker? Any help would be greatly appreciated.
Thanks, Brian
#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
#include
using namespace tbb;
class p_do {
public:
void p_do::operator() (const blocked_range
for (size_t i = r.begin() ; i != r.end() ; ++i ) {
// do nothing
}
}
p_do::p_do () { }
};
int main(int argc,char* argv[]) {
int threads = atoi(argv[1]);
cout << "Threads= " << threads << endl;
task_scheduler_init init(threads);
int maxi = 5;
tbb::parallel_for (blocked_range
cout << "Done" << endl;
}
Checker output>
Application finished
_______________________________________________________________________________
|ID|Short De|Sev|C|Context|Description |1st Acc|2nd Acc|
| |scriptio|eri|o|[Best] | |ess[Bes|ess[Bes|
| |n |tyN|u| | |t] |t] |
| | |ame|n| | | | |
| | | |t| | | | |
_______________________________________________________________________________
|1 |Write ->|Err|4|"tbb_ma|Memory write at "tbb_machine.h":111|"tbb_ma|"tbb_ma|
| |Write da|or | |chine.h|conflicts with a prior memory write|chine.h|chine.h|
| |ta-race | | |":107 |at "tbb_machine.h":111 (output |":111 |":111 |
| | | | |&nb
sp; |dependence) | | |
_______________________________________________________________________________
|2 |Write ->|Err|1|"LifoQu|Memory read at "LifoQueue.h":82 |"LifoQu|"LifoQu|
| |Read dat|or | |eue.h":|conflicts with a prior memory write|eue.h":|eue.h":|
| |a-race | | |78 |at "LifoQueue.h":74 (flow |74 |82 |
| | | | | |dependence) | | |
_______________________________________________________________________________
|3 |Write ->|Err|1|"LifoQu|Memory read at "LifoQueue.h":83 |"LifoQu|"LifoQu|
| |Read dat|or | |eue.h":|conflicts with a prior memory write|eue.h":|eue.h":|
| |a-race | | |78 |at "LifoQueue.h":74 (flow |74 |83 |
| | | | | |dependence) | | |
_______________________________________________________________________________
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Brian,
I unable to reproduce problem you reported with exactly your sources, but see something similar if set maxi to, say, 500. False positivies you reported is most likely result of relatively old Intel Thread Checker that know nothing about version 2 of TBB library.This can be resolved on the configuration file level, i.e. for Linux/Intel64 in
[UserModule]
libtbb.so.2=as_api
libtbb_debug.so.2=as_api
libtbbmalloc.so.2=as_api
libtbbmalloc_debug.so.2=as_api
ForIA-32 version
To check the changes are correct, you can look at the tcheck_cl output. It should contains something like
Building project
Instrumenting
10% for-checker ( All Functions ):..
30% libc-2.5.so ( Minimal ):....
40% libdl-2.5.so ( Minimal ):..
50% libgcc_s-4.1.2-20070626.so.1 ( Minimal ):..
60% libm-2.5.so ( Minimal ):..
70% libpthread-2.5.so ( Minimal ):..
80% librt-2.5.so ( API Imports ):..
90% libstdc++.so.6.0.8 ( Minimal ):..
100% libtbb.so.2 ( API Imports ):..
Threads= 2
Verifying new module: libittnotify.so
9% libittnotify.so ( Minimal ):..
Verifying new module: libtbbmalloc.so.2
8% libtbbmalloc.so.2 ( API Imports ):..
I.e., both tbb and tbbmalloc (or tbb_debug and tbb malloc_debug) should be instrumented as API Imports.
Sorry for inconvenience. Please reports if this doesnt help.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page