Oracle® Solaris Studio 12.4: OpenMP API User's Guide

Exit Print View

Updated: December 2014
 
 

6.7 Checking the Results of Autoscoping

Detailed autoscoping results are displayed in the compiler commentary, The compiler produces an inline commentary when the source is compiled with the -g option. The commentary can be viewed with the er_src command, as shown in the following example. The er_src command is provided as part of the Oracle Solaris Studio software. For more information, see the er_src(1) man page or the Oracle Solaris Studio 12.4: Performance Analyzer .

For a quick check of autoscoping results, compile with the -xvpara option. Compiling with —xvpara will give you a general idea about whether autoscoping for a particular construct was successful.

Example 6-1  Checking Autoscoping Results With -xvpara
% cat source1.f
      INTEGER X(100), Y(100), I, T
C$OMP PARALLEL DO DEFAULT(__AUTO)
      DO I=1, 100
         T = Y(I)
         X(I) = T*T
      END DO
C$OMP END PARALLEL DO
      END

% f95 -xopenmp -xO3 -xvpara -c -g source1.f
"source1.f", line 2: Autoscoping for OpenMP construct succeeded. 
Check er_src for details

If autoscoping fails for a particular construct, a warning message is issued when -xvpara is specified, as shown in the following example.

Example 6-2  Autoscoping Failure With -xvpara
% cat source2.f
      INTEGER X(100), Y(100), I, T
C$OMP PARALLEL DO DEFAULT(__AUTO)
      DO I=1, 100
         T = Y(I)
         CALL FOO(X)
         X(I) = T*T
      END DO
C$OMP END PARALLEL DO
      END

% f95 -xopenmp -xO3 -xvpara -c -g source2.f
"source2.f", line 2: Warning: Autoscoping for OpenMP construct failed. 
 Check  er_src for details. Parallel region will be executed by
 a single thread.

More detailed autoscoping information appears in the compiler commentary displayed by er_src, as shown in the following example.

Example 6-3  Detailed Autoscoping Results Displayed Using er_src
% er_src source2.o
Source file: source2.f
Object file: source2.o
Load Object: source2.o

     1.         INTEGER X(100), Y(100), I, T
        
   Source OpenMP region below has tag R1
   Variables autoscoped as SHARED in R1: y
   Variables autoscoped as PRIVATE in R1: t, i
   Variables treated as shared because they cannot be autoscoped in R1: x
   R1 will be executed by a single thread because 
     autoscoping for some variable s was not successful
   Private variables in R1: i, t
   Shared variables in R1: y, x
     2. C$OMP PARALLEL DO DEFAULT(__AUTO)

   Source loop below has tag L1
   L1 parallelized by explicit user directive
   L1 autoparallelized
   L1 parallel loop-body code placed in function _$d1A2.MAIN_ 
      along with 0 inner loops
   L1 could not be pipelined because it contains calls
     3.         DO I=1, 100
     4.                 T = Y(I)
     5.                 CALL FOO(X)
     6.                 X(I) = T*T
     7.         END DO
     8. C$OMP END PARALLEL DO
     9.         END
    10.