Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1 View

Bug with TASK directive in OpenMP

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
Highlighted
1 View

Thanks for the problem report

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.

Retired 12/31/2016
0 Kudos
Highlighted
1 View

Thank you for your quick

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
Highlighted
1 View

I've just update intel

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