[cig-commits] [commit] master: 0 caused segfaults in collective IO, because it is out of range (5e02e1e)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Oct 17 05:29:31 PDT 2014


Repository : https://github.com/geodynamics/axisem

On branch  : master
Link       : https://github.com/geodynamics/axisem/compare/607f803cf074063627513d235f9ed0837fc1dd44...b6457db24acdde4a4e1c08935ae1b22adf87f5bf

>---------------------------------------------------------------

commit 5e02e1e90fab2c2a72a6c6d4fd5d1cf9558f0066
Author: martinvandriel <martin at vandriel.de>
Date:   Wed Oct 15 19:55:15 2014 +0200

    0 caused segfaults in collective IO, because it is out of range
    
    of the dimension bounds starting from 1. could not be nelem(i-1) + 1 either, because for
    the last proc this is of bounds as well. defaulting to 1 seems to cause no problems


>---------------------------------------------------------------

5e02e1e90fab2c2a72a6c6d4fd5d1cf9558f0066
 SOLVER/commun.F90 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/SOLVER/commun.F90 b/SOLVER/commun.F90
index edac5b9..9c32b32 100644
--- a/SOLVER/commun.F90
+++ b/SOLVER/commun.F90
@@ -602,8 +602,6 @@ subroutine comm_elem_number(my_elems, glob_elems, my_first, my_last)
 
   if (nproc>1) then
 #ifndef serial
-     my_first = 0
-     my_last  = 0
      all_elems(mynum) = my_elems
 
      do iproc = 0, nproc-1
@@ -611,8 +609,8 @@ subroutine comm_elem_number(my_elems, glob_elems, my_first, my_last)
      end do
 
      if (my_elems == 0) then
-         my_first = 0
-         my_last  = 0
+         my_first = 1
+         my_last  = 1
      else
          my_first = sum(all_elems(0:mynum-1)) + 1
          my_last  = sum(all_elems(0:mynum))



More information about the CIG-COMMITS mailing list