Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

bug in OpenMP TASK DEFAULT(NONE) check

jansson
Beginner
1,411 Views
Hi,

This OpenMP program compiles with Intel Visual Fortran Compiler XE 12.0.4.196
I believe it should indicate that the dummy array "thearray" lacks a sharing attribute like it complains about the "localarray" if I remove its sharing attribute.

I did expect an error like:
error #6752: Since the OpenMP* DEFAULT(NONE) clause applies, the PRIVATE, SHARED, REDUCTION, FIRSTPRIVATE, or LASTPRIVATE attribute must be explicitly specified for every variable. [thearray] Console1.f90 30

Regards,
Magnus

[fortran]    program Console1
    implicit none
    integer myarray(10),myscalar
!$omp parallel DEFAULT(NONE) SHARED(myarray,myscalar)
!$omp master
    CALL work(myarray,myscalar)
!$omp end master
!$omp end parallel 
    end program Console1


    subroutine work(thearray,thescalar)
    implicit none
    integer thearray(*),thescalar,localarray(10)
!$OMP TASK DEFAULT(NONE) shared(thescalar,localarray)
    CALL WORKTASK(thearray,thescalar,localarray)
!$OMP end TASK
    end subroutine work


    SUBROUTINE WORKTASK(thearray,thescalar,secondarray)
    implicit none
    INTEGER thearray(*),thescalar,secondarray(*)
       thearray(1)=thescalar
    end SUBROUTINE WORKTASK[/fortran]
0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,411 Views
Yes, we agree that an error should be given here. I'll let the developers know. Issue ID is DPD200169845. Thanks.
0 Kudos
Steven_L_Intel1
Employee
1,411 Views
Further investigation shows that an error message is not warranted, but the compiler is failing to handle the case correctly.

The OpenMP 3.1 standard says:

[plain]2.9.1.1 Data-sharing Attribute Rules for Variables Referenced in a Construct

17          The data-sharing attributes of variables that are referenced in a construct may be one of
18          the following: predetermined, explicitly determined, or implicitly determined.

22         The following variables have predetermined data-sharing attributes:

[/plain]
and then it says, in the Fortran-specific section:

[plain]10         Assumed-size arrays are shared.[/plain]
We will be fixing the compiler to handle this case properly.
in the 3.1 specification, line 15 on page 91:
2.9.1.1 Data-sharing Attribute Rules for Variables Referenced in a 
16 Construct
17 The data-sharing attributes of variables that are referenced in a construct may be one of
18 the following: predetermined, explicitly determined, or implicitly determined.
22 The following variables have predetermined data-sharing attributes:
In the Fortran specific section on page 92, line 10:
10 Assumed-size arrays are shared.
0 Kudos
Reply