[yt-svn] commit/yt: sskory: Adding explicit 'del's to the merger tree to be careful,

Bitbucket commits-noreply at bitbucket.org
Tue Nov 22 12:54:36 PST 2011


1 new commit in yt:


https://bitbucket.org/yt_analysis/yt/changeset/7cba2f3a9d77/
changeset:   7cba2f3a9d77
branch:      yt
user:        sskory
date:        2011-11-22 21:54:03
summary:     Adding explicit 'del's to the merger tree to be careful,
and PAI.__init__ for LoadedHaloes so it doesn't croak
when parallel_objects is used with them.
affected #:  2 files

diff -r eff898582e9538166e31ae224eda89020d07b096 -r 7cba2f3a9d779c6d1d2fc123c17e842418446943 yt/analysis_modules/halo_finding/halo_objects.py
--- a/yt/analysis_modules/halo_finding/halo_objects.py
+++ b/yt/analysis_modules/halo_finding/halo_objects.py
@@ -1323,6 +1323,7 @@
     _name = "Loaded"
     
     def __init__(self, pf, basename):
+        ParallelAnalysisInterface.__init__(self)
         self.pf = pf
         self._groups = []
         self.basename = basename


diff -r eff898582e9538166e31ae224eda89020d07b096 -r 7cba2f3a9d779c6d1d2fc123c17e842418446943 yt/analysis_modules/halo_merger_tree/merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py
@@ -464,6 +464,7 @@
                         parent_masses = na.concatenate((parent_masses, thisMasses))
                         parent_halos = na.concatenate((parent_halos, 
                             na.ones(thisIDs.size, dtype='int32') * gID))
+                        del thisIDs, thisMasses
                     h5fp.close()
             
             # Sort the arrays by particle index in ascending order.
@@ -495,6 +496,7 @@
                     child_masses = na.concatenate((child_masses, thisMasses))
                     child_halos = na.concatenate((child_halos, 
                         na.ones(thisIDs.size, dtype='int32') * gID))
+                    del thisIDs, thisMasses
                 h5fp.close()
         
         # Sort the arrays by particle index.
@@ -548,6 +550,7 @@
         parent_halos_tosend = parent_halos[parent_send]
         child_IDs_tosend = child_IDs[child_send]
         child_halos_tosend = child_halos[child_send]
+        del parent_send, child_send
         
         parent_IDs_tosend = self.comm.par_combine_object(parent_IDs_tosend,
                 datatype="array", op="cat")
@@ -651,6 +654,11 @@
             #values = tuple(values)
             self.write_values.append(values)
             self.write_values_dict[parent_currt][parent_halo] = values
+
+        # Clean up.
+        del parent_IDs, parent_masses, parent_halos
+        del parent_IDs_tosend, parent_masses_tosend
+        del parent_halos_tosend, child_IDs_tosend, child_halos_tosend
         
         return (child_IDs, child_masses, child_halos)

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