Showing results for 
Search instead for 
Did you mean: 

Bug in collective coarray subroutines

The collective coarray subroutines such as co_sum, co_min, etc. produce incorrect results when result_image is not specified. According to the 2018 Fortran Standard, the results should return on all images in this case. However, it seems the only comes back in image 1. The program below uses the example given in the standard in section 16.9.50 which states:

Example. If the number of images in the current team is two and A is the array [1, 5, 3] on one image and [4,1, 6] on the other image, the value of A after executing the statement CALL CO_SUM(A) is [5, 6, 9] on both images.

The following program shows that this does not happen.

program test
  implicit none
  integer :: a(3)
  • a(:)[1] = [1,5,3] a(:)[2] = [4,1,6] sync all call co_sum(a) sync all print *, a(:), this_image() end program test
  • I compiled this using

    ifort -V -coarray -coarray-num-images=2 -O0 co_sum_test_2.f90 -o co_sum_test_2
    Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version Build 20191121

    ... and running it gave these results:

               5           6           9           1
               4           1           6           2

    The result came back in image 1 only when it should have come back in both images.



    0 Kudos
    1 Reply

    Thank you for sending us this

    Thank you for sending us this bug report.  I'll get it into our system.

    update: ID CMPLRILO-32636


    0 Kudos