Multicore lab Thread Checker mystery error... solved!!

9. October 2006 04:08 by Jaguilar in General  //  Tags: ,   //   Comments (0)

Some of you may recall that on some events, we got an error message on Intel Thread Checker during the Multicore lab. No matter what we did, even if we solved all the concurrency issues related to our code, the Thread Checker would always log this message:

Write -> Read data-race Memory read at [PrimesInstrumented.exe, 0x2468] conflicts with a prior memory write at [PrimesInstrumented.exe, 0x16816] (flow dependence)

During the labs, we have said that we've been working out the solution with the Intel support people - and now we have an answer!!The thing is that you can work with Thread Checker in two ways:
  1. Use compiler based instrumentation. With this, you basically need to add the /Qtcheck flag to the compiler command line to instrument the binary. Once it is instrumented and you run it, it will create a file called "Threadchecker.thr", that you can then load in the VTune Thread Checker. To do this, you need to use the following command lines: (using the primes example from the lab)

    icl /c /Zi primes.cpp /Qopenmp /Qtcheck /Od
    link primes.obj /out:PrimesInstrumented.exe /fixed:no /DEBUG


  2. Use Thread Checker to intrument the application. In this scenario, you don't intrument the binary at compile time, but have Thread Checker intrument it when running the application. For this, you need to build the application with the following command lines:

    icl /c /Zi primes.cpp /Qopenmp /MD /Od
    link primes.obj /out:PrimesInstrumented.exe /fixed:no /DEBUG


    And then load it in Thread Checker.

The error we were doing on the lab is that we were using both compiler and "Thread Checker" instrumentation, and that caused Thread Checker to report conflicts that are outside of the program and in the runtime libraries. Now, using either option (BUT not both at the same time) the strange error is gone!

Thanks to Vasanth Tovinkere at Intel who really helped us out with this problem!!

BTW, this is repeating an old blog post I did for the 64–bit Advantage Blog. The post was deleted for some reason. Since I consider this information to be important, I am re-posting it here.

Categories