- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in my quest to find a solution for the problem I posted in the thread "Internal compiler error with lock/unlock", I stumbled upon another problem. Again using Intel Fortran 12.0.3.
Here is the program:
! checkscalar.f90 --
! Check some odd (erroneous) behaviour with scalar coarrays
!
program checkscalar
implicit none
logical, codimension
logical, codimension
ready = .false.
new_results = .true. ! Indicates the image has results available
write(*,*) 'Image', this_image(), new_results
sync all
write(*,*) 'Image2', this_image(), new_results
!
! Collect the found primes in image 1, create new tasks
! for all images
!
do while ( .not. ready )
if ( this_image() == 1 ) then
call collect_results
endif
call sleepqq(1)
enddo
contains
!
! Subroutine to collect the results from all
! images (run by image 1)
!
subroutine collect_results
integer :: i
integer :: np
integer :: maxindex
do i = 1,num_images()
write(*,*) 'Examine', i, new_results
enddo
do i = 1,num_images()
ready = .true.
enddo
end subroutine collect_results
end program checkscalar
It does not do much: in image 1 I print the value of new_results and when the
loop is finished I set the flag ready in all images so that they will stop. At least
that is my intention.
The output of one run with this program is:
Image 6 T
Image 1 T
Image 3 T
Image2 3 T
Image 7 T
Image2 7 T
Image2 6 T
Image 5 T
Image 2 T
Image2 2 T
Image 4 T
Image 8 T
Image2 4 T
Image2 1 T
Examine 1 T
Image2 8 T
Image2 5 T
(after a few seconds of no progress at all, I stopped the program)
So, all 8 images start, image 1 is entering the loop, prints the value of new_results on that
image, and then hangs - it does not get beyond this!
Does anyone have any clues? Am I doing something wrong? (Possible, of course, but the
program is so simple that I can not believe that.)
Regards,
Arjen
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
?? isn't that the purpose of sync all ??
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then it appears that one should always use YourCoArrayVariable[yourImageNumber] instead of YourCoArrayVariable whenever some other image could write to YourCoArrayVariable (because sync all, although reportedly not broken, does not update local image of YourCoArrayVariable).
(toung back where it belongs)
There may be a race condition in an optimization whereby you omit poling other processes if you "know" no updates to your shared variable(s) were made. (error in code relating to condition variables on Linux). Might be a place to look after you get a reproducer.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »