Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

sync image problem with Coarray Fortran

Zuodong_Y_
Novice
506 Views

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? 

0 Kudos
1 Solution
Kevin_D_Intel
Employee
506 Views

Development found the root cause. While your case did not exhibit the same behavior with 17.0, the possibility of the root cause still existed w/17.0; therefore, the fix will be applied to that release; likely the first update in the Q4 timeframe. The fix missed the upcoming final PSXE 2016 (16.0) update but will be applied to that branch in the event of a future unplanned update.

View solution in original post

0 Kudos
4 Replies
Kevin_D_Intel
Employee
506 Views

I can reproduce the behavior you described with our current PSXE 2016 Update 3 (ifort 16.0.3.210) compiler but I cannot with our upcoming PSXE 2017 (ifort 17.0) compiler so it seems possible there is a defect with 16.0 responsible for the delay of image 1 when the sleep(1) is active.

I will make some inquiries with Development.

0 Kudos
Zuodong_Y_
Novice
506 Views

Thanks a lot for this information.

This problem slow my real program a lot. So if there is any progress, please let me know.

Thanks again. 

0 Kudos
Kevin_D_Intel
Employee
506 Views

I reported the issue to Development for further investigation and to ensure we understand the underlying reason behind the change with 17.0. I will keep you updated about their findings.

(Internal tracking id: DPD200413377)

0 Kudos
Kevin_D_Intel
Employee
507 Views

Development found the root cause. While your case did not exhibit the same behavior with 17.0, the possibility of the root cause still existed w/17.0; therefore, the fix will be applied to that release; likely the first update in the Q4 timeframe. The fix missed the upcoming final PSXE 2016 (16.0) update but will be applied to that branch in the event of a future unplanned update.

0 Kudos
Reply