- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the ifort compiler (version 13.1.0) refuses to compile the following code:
[fortran]
program t
type b
integer :: s
end type b
integer :: v
type(b) :: x
!$omp atomic capture
v = x%s
x%s = x%s+1
!$omp end atomic
stop
end program t
[/fortran]
giving the following error message:
t.f90(11): error #7926: This statement is not a valid OpenMP* ATOMIC update-statement.
v = x%s
--^
t.f90(12): error #8550: An OpenMP* ATOMIC capture-statement is expected
x%s = x%s+1
--^
t.f90(10): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
!$omp atomic capture
^
[ Aborting due to internal error. ]
compilation aborted for t.f90 (code 1)
As far as I can understand the OpenMP 3.1 standard, the code should be compliant and, in fact, it goes through gfortran 4.7 with no problems. Note that, even if I change the order of the two instructions in the atomic construct (i.e., the update first and the capture second) nothing changes.
Is this a compiler bug or am I missing something?
thanks,
alfredo
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will escalate the issue to engineering. Thanks for the small test case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alfredo
this very problem has been reported before ( issue # DPD200233147) and gwill be fixed in a release later this year.
Heinz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One of your runtime libraries migh have a function performing the (atomic) XCHGADD (the specific function name will vary with library). This might get you by. On Windows you have in kernel32 the function InterlockedExchangeAdd, Linux may have different module, same function, different function name.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page