The following are various mechanisms and tools that are available for checking the correctness of an OpenMP program.
You can use the -xvpara C/C++/Fortran option to display compiler parallelization messages
You can use the Sun Studio dbx tool to debug C, C++, and Fortran OpenMP programs. An OpenMP program should first be prepared for debugging with dbx by compiling it with the options -xopenmp=noopt -g . dbx allows the programmer to single-step into a PARALLEL region, set breakpoints in the body of an OpenMP construct, as well as print the values of shared, private, and other. variables for a given thread.
You can use the SUNW_MP_WARN environment variable to enable runtime error checking and the issuing of warning messages by the OpenMP runtime library.
You can check your OpenMP program for data races and deadlocks by using the Sun Studio Thread Analyzer tool. Refer to the Thread Analyzer manual and the tha(1) man page for details.