[Yt-svn] yt: Fixing mpi_catarray to correctly handle one-dimensional arra...

hg at spacepope.org hg at spacepope.org
Mon Dec 13 09:05:03 PST 2010


hg Repository: yt
details:   yt/rev/f4c3e6f9e68f
changeset: 3600:f4c3e6f9e68f
user:      Matthew Turk <matthewturk at gmail.com>
date:
Mon Dec 13 09:03:36 2010 -0800
description:
Fixing mpi_catarray to correctly handle one-dimensional arrays (I believe) and
adding a fake_parameter_file to the field detector, with known values for the
redshift etc.

diffstat:

 yt/data_objects/field_info_container.py                    |  6 +++++-
 yt/utilities/parallel_tools/parallel_analysis_interface.py |  5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 7d975ee28f90 -r f4c3e6f9e68f yt/data_objects/field_info_container.py
--- a/yt/data_objects/field_info_container.py	Mon Dec 13 11:12:46 2010 -0500
+++ b/yt/data_objects/field_info_container.py	Mon Dec 13 09:03:36 2010 -0800
@@ -150,8 +150,12 @@
         self.RightEdge = [1.0,1.0,1.0]
         self.dds = na.ones(3, "float64")
         self['dx'] = self['dy'] = self['dz'] = na.array([1.0])
+        class fake_parameter_file(defaultdict):
+            pass
         if pf is None:
-            pf = defaultdict(lambda: 1)
+            pf = fake_parameter_file(lambda: 1)
+            pf.current_redshift = pf.omega_lambda = pf.omega_matter = \
+                pf.hubble_constant = pf.cosmological_simulation = 0.0
         self.pf = pf
         class fake_hierarchy(object):
             class fake_io(object):
diff -r 7d975ee28f90 -r f4c3e6f9e68f yt/utilities/parallel_tools/parallel_analysis_interface.py
--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py	Mon Dec 13 11:12:46 2010 -0500
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py	Mon Dec 13 09:03:36 2010 -0800
@@ -1033,8 +1033,9 @@
             ncols = -1
             size = 0
         else:
-            if len(data) == 1:
-                ncols = size = data.shape
+            if len(data.shape) == 1:
+                ncols = 1
+                size = data.shape[0]
             else:
                 ncols, size = data.shape
         ncols = MPI.COMM_WORLD.allreduce(ncols, op=MPI.MAX)



More information about the yt-svn mailing list