[Yt-svn] yt: 2 new changesets

hg at spacepope.org hg at spacepope.org
Wed Dec 8 14:56:32 PST 2010


hg Repository: yt
details:   yt/rev/6a323c034d45
changeset: 3584:6a323c034d45
user:      Britton Smith <brittonsmith at gmail.com>
date:
Wed Dec 08 17:54:04 2010 -0500
description:
Fixed _mpi_catarray to allow args of None to be given.
Fixed slicing to handle times when processor has no points.
Thanks again to Matt.

hg Repository: yt
details:   yt/rev/2eccd4b9743d
changeset: 3585:2eccd4b9743d
user:      Britton Smith <brittonsmith at gmail.com>
date:
Wed Dec 08 17:56:14 2010 -0500
description:
Clearned up a little.

diffstat:

 yt/data_objects/data_containers.py                         |  13 ++++++++-----
 yt/utilities/parallel_tools/parallel_analysis_interface.py |   8 ++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r a10caab65e54 -r 2eccd4b9743d yt/data_objects/data_containers.py
--- a/yt/data_objects/data_containers.py	Wed Dec 08 16:05:37 2010 -0500
+++ b/yt/data_objects/data_containers.py	Wed Dec 08 17:56:14 2010 -0500
@@ -764,11 +764,14 @@
         points = []
         for grid in self._get_grids():
             points.append(self._generate_grid_coords(grid))
-        if len(points) == 0: points = None
-        else: points = na.concatenate(points)
-        # We have to transpose here so that _mpi_catarray works properly, as
-        # it and the alltoall assume the long axis is the last one.
-        t = self._mpi_catarray(points.transpose())
+        if len(points) == 0:
+            points = None
+            t = self._mpi_catarray(None)
+        else:
+            points = na.concatenate(points)
+            # We have to transpose here so that _mpi_catarray works properly, as
+            # it and the alltoall assume the long axis is the last one.
+            t = self._mpi_catarray(points.transpose())
         self['px'] = t[0,:]
         self['py'] = t[1,:]
         self['pz'] = t[2,:]
diff -r a10caab65e54 -r 2eccd4b9743d yt/utilities/parallel_tools/parallel_analysis_interface.py
--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py	Wed Dec 08 16:05:37 2010 -0500
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py	Wed Dec 08 17:56:14 2010 -0500
@@ -1029,6 +1029,14 @@
 
     @parallel_passthrough
     def _mpi_catarray(self, data):
+        if data is None:
+            ncols = -1
+            size = 0
+        else:
+            ncols, size = data.shape
+        ncols = MPI.COMM_WORLD.allreduce(ncols, op=MPI.MAX)
+        if data is None:
+            data = na.empty((ncols,0), dtype='float64') # This only works for
         size = data.shape[-1]
         sizes = na.zeros(MPI.COMM_WORLD.size, dtype='int64')
         outsize = na.array(size, dtype='int64')



More information about the yt-svn mailing list