[Yt-svn] yt: A couple optimizations for the fortran_reader

hg at spacepope.org hg at spacepope.org
Wed Nov 10 08:45:30 PST 2010


hg Repository: yt
details:   yt/rev/8fc9a045dd91
changeset: 3519:8fc9a045dd91
user:      Matthew Turk <matthewturk at gmail.com>
date:
Wed Nov 10 08:45:26 2010 -0800
description:
A couple optimizations for the fortran_reader

diffstat:

 yt/utilities/_amr_utils/fortran_reader.pyx |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r a198f8022927 -r 8fc9a045dd91 yt/utilities/_amr_utils/fortran_reader.pyx
--- a/yt/utilities/_amr_utils/fortran_reader.pyx	Tue Nov 09 21:54:19 2010 -0800
+++ b/yt/utilities/_amr_utils/fortran_reader.pyx	Wed Nov 10 08:45:26 2010 -0800
@@ -234,6 +234,9 @@
         fread(&new_padding, sizeof(int), 1, f); FIX_LONG(new_padding)
         assert(padding[0] == new_padding)
 
+ at cython.cdivision(True)
+ at cython.boundscheck(False)
+ at cython.wraparound(False)
 def read_art_grid(int varindex, 
               np.ndarray[np.int64_t, ndim=1] start_index,
               np.ndarray[np.int32_t, ndim=1] grid_dims,
@@ -250,8 +253,8 @@
     cdef np.ndarray[np.int64_t, ndim=1] og_start_index
     cdef np.float64_t temp_data
     cdef np.int64_t end_index[3]
+    cdef int kr_offset, jr_offset, ir_offset
     cdef int to_fill = 0
-    cdef ir_offset, jr_offset, kr_offset
     # Note that indexing into a cell is:
     #   (k*2 + j)*2 + i
     for i in range(3):



More information about the yt-svn mailing list