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

intel + copyprivate wrong error

valery_w_
Beginner
406 Views

dear all

ifort produces a wrong error with the following codethanks

v

ifort -v
ifort version 14.0.1

cat ifort_14.0.1_copyprivate.f90
program test
  use omp_lib
  implicit none
  integer :: b

  !$omp parallel
  !$omp end parallel

  !$omp parallel  private (b)
  !$omp single
  b = omp_get_num_threads ()
  !$omp end single copyprivate (b)
  write(*,*) b
  !$omp end parallel

end program test

ifort -openmp ifort_14.0.1_copyprivate.f90
ifort_14.0.1_copyprivate.f90(12): error #7982: Variables in the COPYPRIVATE list must be PRIVATE in the enclosing parallel region.  
  !$omp end single copyprivate (b)
--------------------------------^
compilation aborted for ifort_14.0.1_copyprivate.f90 (code 1)

 

0 Kudos
3 Replies
Jonathan_B_
Beginner
406 Views

I got the same error; the error goes away when lines 6 and 7

[fortran]!$omp parallel
!$omp end parallel[/fortran]

are commented out or removed.

[bash]ifort -v
ifort version 13.1.0[/bash]
and
[bash]ifort -v
ifort version 14.0.1[/bash]

0 Kudos
Kevin_D_Intel
Employee
406 Views

Thank you for notifying us about this error. I reported this to Development and will update this post as I hear more.

(Internal tracking id: DPD200250671)
(Resolution Update on 09/15/2014): This defect is fixed in the Intel® Parallel Studio XE 2015 Initial Release (2015.0.090 - Linux)

0 Kudos
Kevin_D_Intel
Employee
406 Views

I confirmed this issue is resolved in the Intel® Parallel Studio XE 2015 release for Linux (Version 15.0.0.090 Build 20140723) now available from the Intel® Registration Center.

0 Kudos
Reply