[Yt-svn] commit/yt: samskillman: == should be used instead of is for comparing values. This led to a bug when using >256 processors to render. Now fixed.

Bitbucket commits-noreply at bitbucket.org
Mon Oct 3 17:17:34 PDT 2011


1 new changeset in yt:

http://bitbucket.org/yt_analysis/yt/changeset/eed9eae8e589/
changeset:   eed9eae8e589
branch:      yt
user:        samskillman
date:        2011-10-04 02:15:20
summary:     == should be used instead of is for comparing values.  This led to a bug when using >256 processors to render.  Now fixed.
affected #:  1 file (-1 bytes)

--- a/yt/utilities/amr_kdtree/amr_kdtree.py	Mon Oct 03 10:34:29 2011 -0700
+++ b/yt/utilities/amr_kdtree/amr_kdtree.py	Mon Oct 03 18:15:20 2011 -0600
@@ -755,7 +755,7 @@
         for i in range(2**nprocs):
             if ((i + 1)>>par_tree_depth) == 1:
                 # There are nprocs nodes that meet this criteria
-                if (i+1-nprocs) is not my_rank:
+                if (i+1-nprocs) != my_rank:
                     self.tree_dict.pop(i)
                     continue
         for node in self.tree_dict.itervalues():
@@ -1002,7 +1002,7 @@
             # This is where all the domain decomposition occurs.  
             if ((current_node.id + 1)>>par_tree_depth) == 1:
                 # There are anprocs nodes that meet this criteria
-                if (current_node.id+1-anprocs) is my_rank:
+                if (current_node.id+1-anprocs) == my_rank:
                     # I own this shared node
                     self.my_l_corner = current_node.l_corner
                     self.my_r_corner = current_node.r_corner
@@ -1012,7 +1012,7 @@
                     continue
                 
             # If we are down to one grid, we are either in it or the parent grid
-            if len(current_node.grids) is 1:
+            if len(current_node.grids) == 1:
                 thisgrid = current_node.grids[0]
                 # If we are completely contained by that grid
                 if (thisgrid.LeftEdge[0] <= current_node.l_corner[0]) and (thisgrid.RightEdge[0] >= current_node.r_corner[0]) and \
@@ -1040,7 +1040,7 @@
                     continue
 
             # If we don't have any grids, this volume belongs to the parent        
-            if len(current_node.grids) is 0:
+            if len(current_node.grids) == 0:
                 set_leaf(current_node, current_node.parent_grid, current_node.l_corner, current_node.r_corner)
                 # print 'This volume does not have a child grid, so it belongs to my parent!'
                 current_node, previous_node = self.step_depth(current_node, previous_node)

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list