SUN CC 5.2 support in Boost 1.43?

Hi, I wrote a C++ project using OpenMP, GCC and Boost. When I enable nested parallelism (omp_set_nested(1)), repeated runs of the same piece of code produce different results, which suggests that there is a race condition somewhere, but I do not see anything wrong with the logic of my code, so I decided to use Sun Studio's Thread Analyzer to analyze my code. This requires me to build my project with Sun's CC 5.2, which fails with the following warning message from Boost: "/h/96/g4max/local/boost64/include/boost/numeric/ublas/detail/config.hpp", line 170: Error: #error Your compiler and/or configuration is unsupported by this verions of uBLAS. Define BOOST_UBLAS_UNSUPPORTED_COMPILER=0 to override this message. Boost 1.32.0 includes uBLAS with support for many older compilers.. Is it even possible to compile Boost 1.43 with Sun's CC? I tried setting user-config.jam and then build with: ./bootstrap.sh --prefix=/install_dir ./bjam --user-config=user-config.jam -j16 toolset=sun ./bjam install where user-config.jam is: using sun : 5.2 : /my_sun_location/CC : -library=stlport4 -features=tmplife -features=tmplrefstatic ; I get a lot of warnings and error messages... So, my questions are: 1) What is the best way to check parallel code for race conditions using some free tool? 2) If one such free tool is Sun Studio, then how can I get Boost working with it? 3) If someone here knows OpenMP, could it be that omp_set_nested() produces a race condition within a Boost library? My codes run fine with omp_set_dynamic(1), but as soon as I enable nesting I get race conditions. Thanks! Max

Sorry, that's Sun CC 5.11, not 5.2.
On Sun, Sep 26, 2010 at 2:47 PM, Max S. Kaznady
Hi,
I wrote a C++ project using OpenMP, GCC and Boost. When I enable nested parallelism (omp_set_nested(1)), repeated runs of the same piece of code produce different results, which suggests that there is a race condition somewhere, but I do not see anything wrong with the logic of my code, so I decided to use Sun Studio's Thread Analyzer to analyze my code. This requires me to build my project with Sun's CC 5.2, which fails with the following warning message from Boost:
"/h/96/g4max/local/boost64/include/boost/numeric/ublas/detail/config.hpp", line 170: Error: #error Your compiler and/or configuration is unsupported by this verions of uBLAS. Define BOOST_UBLAS_UNSUPPORTED_COMPILER=0 to override this message. Boost 1.32.0 includes uBLAS with support for many older compilers..
Is it even possible to compile Boost 1.43 with Sun's CC? I tried setting user-config.jam and then build with: ./bootstrap.sh --prefix=/install_dir ./bjam --user-config=user-config.jam -j16 toolset=sun ./bjam install
where user-config.jam is: using sun : 5.2 : /my_sun_location/CC : -library=stlport4 -features=tmplife -features=tmplrefstatic ;
I get a lot of warnings and error messages...
So, my questions are: 1) What is the best way to check parallel code for race conditions using some free tool? 2) If one such free tool is Sun Studio, then how can I get Boost working with it? 3) If someone here knows OpenMP, could it be that omp_set_nested() produces a race condition within a Boost library? My codes run fine with omp_set_dynamic(1), but as soon as I enable nesting I get race conditions.
Thanks! Max

I wrote a C++ project using OpenMP, GCC and Boost. When I enable nested parallelism (omp_set_nested(1)), repeated runs of the same piece of code produce different results, which suggests that there is a race condition somewhere, but I do not see anything wrong with the logic of my code, so I decided to use Sun Studio's Thread Analyzer to analyze my code. This requires me to build my project with Sun's CC 5.2, which fails with the following warning message from Boost:
"/h/96/g4max/local/boost64/include/boost/numeric/ublas/detail/config.hpp", line 170: Error: #error Your compiler and/or configuration is unsupported by this verions of uBLAS. Define BOOST_UBLAS_UNSUPPORTED_COMPILER=0 to override this message. Boost 1.32.0 includes uBLAS with support for many older compilers..
You need to build your code with -DBOOST_UBLAS_UNSUPPORTED_COMPILER=0 as suggested. Quite a lot of boost will work with sun's compiler, but by no means all of it. HTH, John.

I tried overriding the message and the compiler exists with more
errors from Boost, as well as my program. Things like std::isnan
haven't been ported to Sun's STL I guess... so I don't think I can use
Solaris Studio to profile my codes, because those are written for
Linux. I don't feel like re-writing the entire project for Solaris.
Max
On Mon, Sep 27, 2010 at 4:33 AM, John Maddock
I wrote a C++ project using OpenMP, GCC and Boost. When I enable nested parallelism (omp_set_nested(1)), repeated runs of the same piece of code produce different results, which suggests that there is a race condition somewhere, but I do not see anything wrong with the logic of my code, so I decided to use Sun Studio's Thread Analyzer to analyze my code. This requires me to build my project with Sun's CC 5.2, which fails with the following warning message from Boost:
"/h/96/g4max/local/boost64/include/boost/numeric/ublas/detail/config.hpp", line 170: Error: #error Your compiler and/or configuration is unsupported by this verions of uBLAS. Define BOOST_UBLAS_UNSUPPORTED_COMPILER=0 to override this message. Boost 1.32.0 includes uBLAS with support for many older compilers..
You need to build your code with -DBOOST_UBLAS_UNSUPPORTED_COMPILER=0 as suggested.
Quite a lot of boost will work with sun's compiler, but by no means all of it.
HTH, John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hi Max, On Sunday, 26. September 2010 20:47:46 Max S. Kaznady wrote:
So, my questions are: 1) What is the best way to check parallel code for race conditions using some free tool?
Use helgrind: http://valgrind.org/docs/manual/hg-manual.html Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !

Cool, thanks! I just profiled my code with Helgrind, but I can't say
that the output is very informative. Helgrind just tells me that a
specific line of code might have a possible race condition, and it
tells me that a section of the code is not protected by any lock.
I already know this, but what I would like is for the race condition
detector to tell me for which values of the data structure a race
condition occurs, i.e. some index value overwrites some other index
value. Can this at all be done?
Max
2010/9/28 Jürgen Hunold
Hi Max,
On Sunday, 26. September 2010 20:47:46 Max S. Kaznady wrote:
So, my questions are: 1) What is the best way to check parallel code for race conditions using some free tool?
Use helgrind: http://valgrind.org/docs/manual/hg-manual.html
Yours,
Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
John Maddock
-
Jürgen Hunold
-
Max S. Kaznady