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

Coarray bug?

OP1
New Contributor III
398 Views

Maybe this is just my ignorance showing up here, but neither the FLUSH nor the SYNC ALL statements seems to work here. Am I missing something obvious?

[fortran]

PROGRAM

IS_THIS_A_COARRAY_BUG

USE

IFPORT

IMPLICIT NONE

IF

(THIS_IMAGE()==1)

THEN

WRITE(*,'(A)')'Hello from image 1'

CALL FLUSH(6)

END IF

SYNC ALL

WRITE

(*,'(A,I2)') 'I am image',THIS_IMAGE()

END

PROGRAM

[/fortran]

The output I get (it may take a couple tries to get that behavior to show up) is:

I am image 2
Hello from image 1
I am image 1
I am image 4
etc...

In other words, the SYNC ALL statement does not seem to impact the WRITE / FLUSH statements that only image 1 executes. This is with IVF XE 2011. (I will try with the beta version Steve mentioned).

0 Kudos
1 Reply
Steven_L_Intel1
Employee
398 Views

There's no guarantee of order for the merged standard output file, even with SYNC ALL and FLUSH.

0 Kudos
Reply