Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Bug in collective coarray subroutines

Theodore_T_1
Beginner
195 Views

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 19.1.0.166 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 Solution
    Ron_Green
    Moderator
    183 Views

    This issue was fixed in PSXE 2020 Update 2.


    View solution in original post

    2 Replies
    Ron_Green
    Moderator
    195 Views

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

    update: ID CMPLRILO-32636

     

    Ron_Green
    Moderator
    184 Views

    This issue was fixed in PSXE 2020 Update 2.


    View solution in original post

    Reply