- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following code gives different results with ifx as compared to NAG:
program p
implicit none
integer :: img, data
integer :: cnt[*] = 0
integer, allocatable :: res(:)[:]
allocate(res(num_images())[*], source=-1)
img = this_image()
data = 10 * img ! Something different on each image
res(get_val())[1] = data
sync all
if (this_image() == 1) print *, res
sync all
res(this_image())[1] = cnt ! gather count of invocations of get_val
sync all
if (this_image() == 1) print *, res
contains
function get_val()
integer :: get_val
get_val = img
cnt = cnt + 1 ! Count invocations of get_val
end function
end program
Compiling it and running with 2 images gives:
% ifx -coarray ifx-coarray-gather.f90 -coarray-num-images=2 && ./a.out
10 20
4 4
OTOH NAG calls get_val only once on each image:
% nagfor -coarray ifx-coarray-gather.f90 && ./a.out
NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7200
[NAG Fortran Compiler normal termination]
10 20
1 1
Is this a bug in ifx?
Best regards,
Harald
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, it is a bug. Nag output is correct. I think this is related to a previously reported bug in host-associated coarray objects ( cnt in this example ).
I will get a separate bug report for this example. it may be 'same as' the previously reported but it is different enough to warrant a separate investigation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
bug ID is CMPLRLLVM-69390

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page