[Yt-svn] yt: Modifying my recent changes to parallel HOP load balancing

hg at spacepope.org hg at spacepope.org
Wed May 12 09:54:33 PDT 2010


hg Repository: yt
details:   yt/rev/684af72650cd
changeset: 1665:684af72650cd
user:      Stephen Skory <stephenskory at yahoo.com>
date:
Wed May 12 09:54:18 2010 -0700
description:
Modifying my recent changes to parallel HOP load balancing
to be more memory efficient.

diffstat:

 yt/lagos/HaloFinding.py |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 5046b8e91114 -r 684af72650cd yt/lagos/HaloFinding.py
--- a/yt/lagos/HaloFinding.py	Tue May 11 23:03:53 2010 -0700
+++ b/yt/lagos/HaloFinding.py	Wed May 12 09:54:18 2010 -0700
@@ -1248,8 +1248,6 @@
         # Read in a random subset of the points in each domain, and then
         # collect them on the root task.
         xp = self._data_source["particle_position_x"]
-        yp = self._data_source["particle_position_y"]
-        zp = self._data_source["particle_position_z"]
         n_parts = self._mpi_allsum(xp.size)
         local_parts = xp.size
         random_points = int(self.sample * n_parts)
@@ -1263,8 +1261,13 @@
         uni = na.array(random.sample(xrange(xp.size), n_random))
         uni = uni[uni.argsort()]
         my_points[:,0] = xp[uni]
-        my_points[:,1] = yp[uni]
-        my_points[:,2] = zp[uni]
+        del xp
+        self._data_source.clear_data()
+        my_points[:,1] = self._data_source["particle_position_y"][uni]
+        self._data_source.clear_data()
+        my_points[:,2] = self._data_source["particle_position_z"][uni]
+        self._data_source.clear_data()
+        del uni
         # Collect them on the root task.
         mine, sizes = self._mpi_info_dict(n_random)
         if mine == 0:
@@ -1275,6 +1278,7 @@
             root_points = na.empty([])
         my_points.shape = (1, n_random*3)
         root_points = self._mpi_concatenate_array_on_root_double(my_points[0])
+        del my_points
         if mine == 0:
             root_points.shape = (tot_random, 3)
         return root_points



More information about the yt-svn mailing list