|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3: OpenMP API User's Guide Oracle Solaris Studio 12.3 Information Library|
Autoscoping can help the programmer decide how to scope variables. However, for some complicated programs, autoscoping might not be successful or the result of autoscoping might not be what the programmer expects. Incorrect scoping can cause many inconspicuous yet serious problems. For example, incorrectly scoping some variable as SHARED may cause a data race; incorrectly privatizing a variable may result in an undefined value for the variable outside the construct.
Oracle Solaris Studio C, C++, and Fortran compilers provide a compile-time scope-checking feature where the compiler determines whether variables in an OpenMP program are correctly scoped.
Based on the compiler's capabilities, scope checking can discover potential problems including data races, inappropriate privatization or reduction of variables, and other scoping issues. During scope checking, the data-sharing attributes specified by the programmer, the implicit data-sharing attributes determined by the compiler, and autoscoping results are all checked by the compiler.