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

do concurrent can not be inside of openmp-parallelized loop

foxtran
New Contributor II
585 Views

Hello!

I have tried to compile the following code

subroutine example(a, n)
  implicit none
  integer, intent(in) :: n
  real(8), intent(inout) :: a(n,n,n)
  !
  integer :: i, j, k
  integer :: tmp

  !$OMP PARALLEL DO &
  !$OMP DEFAULT(NONE) SHARED(a, n) &
  !$OMP PRIVATE(i,j,k,tmp)
  do k = 1, n
    do concurrent (i = 1:n, j = 1:n, i < j)
      tmp = a(i,j,k)
      a(i,j,k) = a(j,i,k)
      a(j,i,k) = tmp
    end do
  end do
end subroutine example

 I compiled it with ifx 2024.2.1 with the following command:

ifx do-concurrent.f90 -fopenmp

And it says, that it cannot compile that example with the following message:

do-concurrent.f90(13): error #6752: Since the OpenMP* DEFAULT(NONE) clause applies, the PRIVATE, SHARED, REDUCTION, FIRSTPRIVATE, or LASTPRIVATE attribute must be explicitly specified for every variable.   [I]
    do concurrent (i = 1:n, j = 1:n, i < j)
-------------------^
do-concurrent.f90(13): error #6752: Since the OpenMP* DEFAULT(NONE) clause applies, the PRIVATE, SHARED, REDUCTION, FIRSTPRIVATE, or LASTPRIVATE attribute must be explicitly specified for every variable.   [J]
    do concurrent (i = 1:n, j = 1:n, i < j)
----------------------------^


I and J variables are defined in !$OMP section in PRIVATE, but somewhat this code is not accepted.

With gfortran this code is compiling without any messages.

0 Kudos
3 Replies
Ron_Green
Moderator
510 Views

This is a bug.  The compiler is picking up the DEFAULT NONE  for the DO CONCURRENT but missing the other clauses.  I'll write a bug report.

Ron_Green
Moderator
300 Views

The bug ID is CMPLRLLVM-64185.  Thanks to Devorah for writing up the bug report.

foxtran
New Contributor II
166 Views

This bug is still exist in ifx 2025.1

$ ifx --version
ifx (IFX) 2025.1.0 20250317
Copyright (C) 1985-2025 Intel Corporation. All rights reserved.
0 Kudos
Reply