Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Bug with TASK directive in OpenMP

janusz_andrzejewski
283 Views

Hi,

this little program cause compiler error when it is compiled with -fopenmp switch.

MODULE aM
IMPLICIT NONE

 CONTAINS
SUBROUTINE a1(tab1, tab2)
 REAL, INTENT(IN), DIMENSION(:)  :: tab1
 REAL, INTENT(OUT), DIMENSION(:)  :: tab2

 REAL, DIMENSION(10) :: t1

 !$OMP PARALLEL
  !$OMP SINGLE
    !error1  !$OMP TASK DEPEND(IN: tab1) !<= unmarked lines causes internal compiler error
    !$OMP TASK DEPEND(OUT: tab2)  !<= unmarked lines causes internal compiler error
    !OK  $OMP TASK DEPEND(OUT: t1)  !<= this is OK
        tab2(:)=2.8*tab1(:)
        t1(:)=tab1(:)
    !$OMP END TASK
  !$OMP END SINGLE
 !$OMP END PARALLEL

END SUBROUTINE a1

END MODULE aM

Program aa
USE aM
IMPLICIT NONE
  REAL, DIMENSION(10) :: tab1, tab2

  tab1=1.0
  CALL a1(tab1, tab2)

END

I tested this program on ifort 15.0.5 and 16.0.1 on Debian

Best regards

Janusz Andrzejewski

 

0 Kudos
3 Replies
Steven_L_Intel1
Employee
283 Views

Thanks for the problem report. I can reproduce this in 16.0.1, but not in 16.0.2 which should be out any day now. When you get 16.0.2, please try your program again and let me know if the problem is resolved.

0 Kudos
janusz_andrzejewski
283 Views

Thank you for your quick replay.

The following program compiles now, but crashes.

MODULE aM
IMPLICIT NONE

 CONTAINS
SUBROUTINE a1(n)
 INTEGER, INTENT(INOUT) :: n

 !$OMP PARALLEL DEFAULT(SHARED)
  !$OMP SINGLE
    !$OMP TASK FIRSTPRIVATE(n)
    !$OMP END TASK
  !$OMP END SINGLE
 !$OMP END PARALLEL

END SUBROUTINE a1

END MODULE aM

Program aa
USE aM
IMPLICIT NONE
  INTEGER :: n

  n=10
  CALL a1(n)

END

There is a problem within the FIRSTPRIVATE. If you replace FIRSTPRIVATE(n) with FIRSTPRIVATE(n1),

where n1 is a local INTEGER variable everything is OK. The bug is insensitive on attribute INTENET in subroutine.

0 Kudos
janusz_andrzejewski
283 Views

I've just update intel compiler to the version 16.0.2.

After update, the first program compiles now. But the second one (with FIRSTPRIVATE) still causes runtime segmentation fault.

0 Kudos
Reply