Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26732 Discussions

ifort 2019 parsing omp directives with -qno-openmp

Wright__Garrett
Beginner
243 Views

Hey, I am working with some external code that has incorrect OMP directives.  To save you the hassle I made a simple test case below.  I am leaning towards this being a bug based on my expectations, but I am not an OMP expert....

Is there a way to disable parsing of the directives when not intending to use openmp? My expectation using openmp directives, was that the lines should be ignored when not in that mode... I will work to get the directives corrected with the real authors, but that will take a long time and this is just the first of many breaks I would expect from this in a bunch of software.  I would prefer not to bifurcate the code versions by making local changes... instead looking for a flag or something...

Thanks!

 

➜  ifor19_test_omp cat test.f90 
program main

  integer, parameter :: NN =100
  integer :: n

  real :: x, C
  real :: aray(NN), bray(NN)

  x = 1.2345
  C = 1.414

!$omp bad, dont parse me
  do n = 1, NN
     bray(n) = REAL(n)
     aray(n) = bray(n)*x + C
  end do

  print *, aray

end program
➜  ifor19_test_omp ifort -qno-openmp test.f90 
test.f90(12): error #7844: Invalid directive.
!$omp bad, dont parse me
^
compilation aborted for test.f90 (code 1)

 

0 Kudos
5 Replies
Wright__Garrett
Beginner
243 Views

FWIW, I do not see this with 2018 or 2015...

Juergen_R_R
Valued Contributor I
243 Views

Yep, that is a compiler error, you should file a support request.

 

Lorri_M_Intel
Employee
243 Views

Until we can resolve this, try adding "-qno-openmp-simd" to your command line.

          --Lorri

jimdempseyatthecove
Black Belt
243 Views

Lorri,

Is the problem related to the fact that

!$omp simd

was appropriated for non-OpenMP declaration of SIMD sections of code?

IOW !$omp simd has been standardized (though within the OpenMP standards) whereas !DIR$ SIMD is Intel (implementation) dependent.

Note that the requirements for !$omp simd can be slightly different than the requirements for !dir$ simd (e.g. wr/t loop split points amongst multiple threads).

Jim Dempsey

Wright__Garrett
Beginner
243 Views

Lorri, your workaround was very helpful, and got me past the problem areas, thank you. 

I believe one of our software administrators is going to pass this along via the support channels.

Thanks again!
Garrett

Reply