[Yt-svn] yt: 2 new changesets

hg at spacepope.org hg at spacepope.org
Tue Aug 10 07:55:30 PDT 2010


hg Repository: yt
details:   yt/rev/ed13db578174
changeset: 1917:ed13db578174
user:      Matthew Turk <matthewturk at gmail.com>
date:
Tue Aug 10 07:53:00 2010 -0700
description:
Adding file offset storage to protosubgrids

hg Repository: yt
details:   yt/rev/6a3c23ef3ae4
changeset: 1918:6a3c23ef3ae4
user:      Matthew Turk <matthewturk at gmail.com>
date:
Tue Aug 10 07:55:20 2010 -0700
description:
We don't need the getter method -- the previous segfault was a red herring.

diffstat:

 yt/lagos/HierarchyType.py |   1 +
 yt/ramses_reader.pyx      |  27 ++++++++++-----------------
 2 files changed, 11 insertions(+), 17 deletions(-)

diffs (81 lines):

diff -r cc5baf021d41 -r 6a3c23ef3ae4 yt/lagos/HierarchyType.py
--- a/yt/lagos/HierarchyType.py	Mon Aug 09 12:21:54 2010 -0700
+++ b/yt/lagos/HierarchyType.py	Tue Aug 10 07:55:20 2010 -0700
@@ -1561,6 +1561,7 @@
                         child_masks[i,:])
               for i in xrange(self.num_grids)]
         self.grids = na.array(gs, dtype='object')
+        self.grid_file_locations = grid_file_locations
 
     def _populate_grid_objects(self):
         for gi,g in enumerate(self.grids):
diff -r cc5baf021d41 -r 6a3c23ef3ae4 yt/ramses_reader.pyx
--- a/yt/ramses_reader.pyx	Mon Aug 09 12:21:54 2010 -0700
+++ b/yt/ramses_reader.pyx	Tue Aug 10 07:55:20 2010 -0700
@@ -596,25 +596,14 @@
             data[i] = local_hydro_data.m_var_array[level][8*grid_id+i]
         return tr
 
-def identify_new_subgrids_by_signature(
-        np.ndarray[np.int64_t, ndim=2] left_edges,  # In integer indices
-        np.ndarray[np.int64_t, ndim=2] right_edges, # In integer indices
-        np.ndarray[np.int64_t, ndim=2] grid_dimensions):
-    # We operate slightly differently than Enzo does.  We can't afford to store
-    # all the flagging fields in memory; so, we operate only on 1D signatures.
-    # So, we have a list of grids that we want to cluster, and then we pass
-    # that around and determine which grids are appropriate.
-    # We start with a proto subgrid that contains the entire domain.
-    #cdef ProtoSubgrid *psg = ProtoSubgrid()
-    pass
-
 cdef class ProtoSubgrid:
     cdef np.int64_t *signature[3]
     cdef np.int64_t left_edge[3]
     cdef np.int64_t right_edge[3]
     cdef np.int64_t dimensions[3]
-    cdef np.float64_t efficiency
+    cdef public np.float64_t efficiency
     cdef public object sigs
+    cdef public object grid_file_locations
         
     #@cython.boundscheck(False)
     #@cython.wraparound(False)
@@ -623,7 +612,8 @@
                    np.ndarray[np.int64_t, ndim=1] dimensions, 
                    np.ndarray[np.int64_t, ndim=2] left_edges,
                    np.ndarray[np.int64_t, ndim=2] right_edges,
-                   np.ndarray[np.int64_t, ndim=2] grid_dimensions):
+                   np.ndarray[np.int64_t, ndim=2] grid_dimensions,
+                   np.ndarray[np.int64_t, ndim=2] grid_file_locations):
         # This also includes the shrinking step.
         cdef int i, ci, ng = left_edges.shape[0]
         cdef np.ndarray temp_arr
@@ -665,7 +655,10 @@
         sig1 = self.sigs[1]
         sig2 = self.sigs[2]
         efficiency = 0.0
+        cdef int used
+        self.grid_file_locations = []
         for gi in range(ng):
+            used = 0
             nnn = 0
             for l0 in range(grid_dimensions[gi, 0]):
                 i0 = left_edges[gi, 0] + l0
@@ -686,14 +679,14 @@
                         i = i2 - self.left_edge[2]
                         sig2[i] += 1
                         efficiency += 1
+                        used = 1
+            if used == 1:
+                self.grid_file_locations.append(grid_file_locations[gi,:])
          
         for i in range(3): efficiency /= self.dimensions[i]
         #print "Efficiency is %0.3e" % (efficiency)
         self.efficiency = efficiency
 
-    def get_efficiency(self):
-        return self.efficiency
-
     def find_split(self, int ax):
         # First look for zeros
         cdef int i, center



More information about the yt-svn mailing list