Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 415

sync image problem with Coarray Fortran

$
0
0

Hello,

I learn from "Coarrays in the next Fortran Standard" by John Reid that following piece of code will make other images to wait for image 1

program main
	implicit none
	if(this_image()==1) then
		call sleep(1)
		sync images(*)
	else
		sync images(1)
	endif
	write(*,*)this_image()
	call sleep(10)
end program

I expect it take 11 seconds to finish. But it actually take 21s. The extra time is the time of second sleep(). It seems that image 1 is wait for image 2 to finish the whole code. If I remove the first sleep(), the time is 11 seconds as expected.

The program is compiled with ifort -coarray -coarray-num-images=2 using Intel(R) 64, Version 16.0.3.210 Build 20160415

Any idea? 


Viewing all articles
Browse latest Browse all 415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>