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

error #8550: An OpenMP* ATOMIC capture-statement is expected

Hi,

I am trying to get an atomic read out of a global module variable to be returned by the function. A small example is:

integer(c_int) function get_mag(mag) bind(C, name="get_mag")
#ifdef DLL
!DEC$ ATTRIBUTES DLLEXPORT :: get_mag
#endif
use VOL, only: x_g, y_g

implicit none
real(c_double), intent(inout) :: mag
doubleprecision :: x, y
integer :: num 

num = 1
!$omp atomic read
x=x_g(num)
!$omp atomic read
y=y_g(num)
mag=hypot(x, y)

get_mag=0
end function get_mag

I get an error "error #8550: An OpenMP* ATOMIC capture-statement is expected" on both atomic reads. I don't know what I'm doing wrong. 

Module VOL has simply:

double precision ::  x_g(10000), y_g(10000) 

I have the ifort version "Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.2.181 Build 20160204"

Thanks in advance

0 Kudos
8 Replies
Highlighted
1 View

!$omp atomic read

!$omp atomic read
x=x_g(num)
!$omp end atomic

Jim Dempsey

0 Kudos
Highlighted
Beginner
1 View

Quote:jimdempseyatthecove

jimdempseyatthecove wrote:

!$omp atomic read
x=x_g(num)
!$omp end atomic

Jim Dempsey

I get the same exact error... And according to the OpenMP standard, it shouldn't require an end directive...

0 Kudos
Highlighted
1 View

As shown above, it would

As shown above, it would appear that you found a compiler error.

As an alternative, use !$omp flush(x_g(num)) before the read (same with y_g(num)).

Jim Dempsey

0 Kudos
Highlighted
Beginner
1 View

Flush didn't seem to work

Flush didn't seem to work either. It only accepts !$omp flush(x_g) and it gives the same error. For now, I have converter it into a critical section.

Just for complete information, I tried also with v15.0.0.090 and v13.1.3.192, both give the same error.

0 Kudos
Highlighted
1 View

Can't reproduce the error

Can't reproduce the error with your code. Which compiler options are you using? I am using "ifort -c -qopenmp -fpp test.f90".

Thanks,

Xiaoping Duan

Intel Customer Support

0 Kudos
Highlighted
Beginner
1 View

Quote:Xiaoping D. (Intel)

Xiaoping D. (Intel) wrote:

Can't reproduce the error with your code. Which compiler options are you using? I am using "ifort -c -qopenmp -fpp test.f90".

Thanks,

Xiaoping Duan

Intel Customer Support

I use:

ifort -align -zero -fpp -openmp -O3 -traceback -implicitnone -fPIC

I have also tried with

ifort -fpp -openmp -traceback -implicitnone

Same error. I think under Linux it's -openmp, not -qopenmp.

0 Kudos
Highlighted
1 View

Still can't reproduce the

Still can't reproduce the error using the same command line. If you are using 16.0 compiler there must be message like:

ifort: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'

 

Would you please attach a complete test case including module source and the function source which can be compiled to reproduce the error, or submit it through Intel Premier Support?

Thanks,

Xiaoping Duan

Intel Customer Support

 

0 Kudos
Highlighted
Beginner
1 View

Quote:Xiaoping D. (Intel)

Xiaoping D. (Intel) wrote:

Still can't reproduce the error using the same command line. If you are using 16.0 compiler there must be message like:

ifort: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'

Would you please attach a complete test case including module source and the function source which can be compiled to reproduce the error, or submit it through Intel Premier Support?

Thanks,

Xiaoping Duan

Intel Customer Support

Dear Xiaoping, you are right. I was compiling with version 13 all the time. when I actually switched to v16 the error was removed and I got the warning about the deprecated option (which I fixed). Thanks!

0 Kudos