diff mbox

[Fortran-caf,committed] Fix array support for CAF send, handle rank > 1 arrays

Message ID 5342480C.6080407@net-b.de
State New
Headers show

Commit Message

Tobias Burnus April 7, 2014, 6:39 a.m. UTC
Tobias Burnus wrote:
> Testing showed that the test case doesn't work with num_images() > 1. 
> Fixed by the commit Rev. 209170.

I forgot two functions - now it looks as if it really works with 
multiple images :-)

Tobias
diff mbox

Patch

Index: gcc/testsuite/ChangeLog.fortran-caf
===================================================================
--- gcc/testsuite/ChangeLog.fortran-caf	(Revision 209173)
+++ gcc/testsuite/ChangeLog.fortran-caf	(Arbeitskopie)
@@ -1,3 +1,8 @@ 
+2014-04-07  Tobias Burnus  <burnus@net-b.de>
+
+	* gfortran.dg/coarray/send_array.f90: Really fix support
+	for num_images() > 1.
+
 2014-04-06  Tobias Burnus  <burnus@net-b.de>
 
 	* gfortran.dg/coarray/send_array.f90: Fix support
Index: gcc/testsuite/gfortran.dg/coarray/send_array.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray/send_array.f90	(Revision 209173)
+++ gcc/testsuite/gfortran.dg/coarray/send_array.f90	(Arbeitskopie)
@@ -130,7 +130,7 @@  subroutine two()
   a(:,:) = b(lb1, lb2)
   sync all
   if (this_image() == 1) then
-    caf(:,:)[this_image()] = b(lb1, lb2)
+    caf(:,:)[num_images()] = b(lb1, lb2)
   end if
   sync all
   if (this_image() == num_images()) then
@@ -144,7 +144,7 @@  subroutine two()
   a(:,:) = b(:, :)
   sync all
   if (this_image() == 1) then
-    caf(:,:)[this_image()] = b(:, :)
+    caf(:,:)[num_images()] = b(:, :)
   end if
   sync all
   if (this_image() == num_images()) then
@@ -167,7 +167,8 @@  subroutine two()
                   a(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2) = b(lb1, lb2)
                   sync all
                   if (this_image() == 1) then
-                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[1] = b(lb1, lb2)
+                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[num_images()] &
+                        = b(lb1, lb2)
                   end if
                   sync all
 
@@ -178,7 +179,7 @@  subroutine two()
                       = b(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)
                   sync all
                   if (this_image() == 1) then
-                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[1] &
+                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[num_images()] &
                         = b(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)
                   end if
                   sync all
@@ -222,7 +223,7 @@  subroutine three()
   a(:,:) = b(lb1, lb2)
   sync all
   if (this_image() == 1) then
-    caf(:,:)[this_image()] = b(lb1, lb2)
+    caf(:,:)[num_images()] = b(lb1, lb2)
   end if
   sync all
   if (this_image() == num_images()) then
@@ -236,7 +237,7 @@  subroutine three()
   a(:,:) = b(:, :)
   sync all
   if (this_image() == 1) then
-    caf(:,:)[this_image()] = b(:, :)
+    caf(:,:)[num_images()] = b(:, :)
   end if
   sync all
   if (this_image() == num_images()) then
@@ -259,7 +260,8 @@  subroutine three()
                   a(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2) = b(lb1, lb2)
                   sync all
                   if (this_image() == 1) then
-                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[1] = b(lb1, lb2)
+                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[num_images()] &
+                        = b(lb1, lb2)
                   end if
                   sync all
 
@@ -270,7 +272,7 @@  subroutine three()
                       = b(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)
                   sync all
                   if (this_image() == 1) then
-                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[1] &
+                    caf(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)[num_images()] &
                         = b(i:i_e:i_s*i_sgn1, j:j_e:j_s*i_sgn2)
                   end if
                   sync all