[Yt-svn] yt: Re-cythonizing, using -X cdivision=true. This resulted in a...

hg at spacepope.org hg at spacepope.org
Tue Dec 14 12:52:57 PST 2010


hg Repository: yt
details:   yt/rev/a86466a42810
changeset: 3614:a86466a42810
user:      Matthew Turk <matthewturk at gmail.com>
date:
Tue Dec 14 12:52:54 2010 -0800
description:
Re-cythonizing, using -X cdivision=true.  This resulted in a ... pretty big
diff (by my count, ~370k.)  We will need to move to cythoning during the setup
call, and relatively soon.

diffstat:

 yt/utilities/_amr_utils/VolumeIntegrator.pyx |     3 -
 yt/utilities/amr_utils.c                     |  3977 +++++++++++++------------
 2 files changed, 2020 insertions(+), 1960 deletions(-)

diffs (truncated from 7131 to 300 lines):

diff -r ad6d77904932 -r a86466a42810 yt/utilities/_amr_utils/VolumeIntegrator.pyx
--- a/yt/utilities/_amr_utils/VolumeIntegrator.pyx	Tue Dec 14 12:22:49 2010 -0800
+++ b/yt/utilities/_amr_utils/VolumeIntegrator.pyx	Tue Dec 14 12:52:54 2010 -0800
@@ -335,7 +335,6 @@
             tdata = data[i]
             self.data[i] = <np.float64_t *> tdata.data
 
-    @cython.cdivision(True)
     @cython.boundscheck(False)
     @cython.wraparound(False)
     def cast_plane(self, TransferFunctionProxy tf, VectorPlane vp):
@@ -397,7 +396,6 @@
                     if temp > extrema[3]: extrema[3] = temp
         #print extrema[0], extrema[1], extrema[2], extrema[3]
 
-    @cython.cdivision(True)
     @cython.boundscheck(False)
     @cython.wraparound(False)
     cdef int integrate_ray(self, np.float64_t v_pos[3],
@@ -509,7 +507,6 @@
             if enter_t > 1.0: break
         return hit
 
-    @cython.cdivision(True)
     @cython.boundscheck(False)
     @cython.wraparound(False)
     cdef void sample_values(self,
diff -r ad6d77904932 -r a86466a42810 yt/utilities/amr_utils.c
--- a/yt/utilities/amr_utils.c	Tue Dec 14 12:22:49 2010 -0800
+++ b/yt/utilities/amr_utils.c	Tue Dec 14 12:52:54 2010 -0800
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.13.beta0 on Tue Nov  9 08:21:49 2010 */
+/* Generated by Cython 0.13 on Tue Dec 14 12:50:18 2010 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -151,6 +151,11 @@
 #endif
 
 #if PY_MAJOR_VERSION >= 3
+  #define PyBoolObject PyLongObject
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 #else
@@ -200,6 +205,7 @@
 #include "png.h"
 #include "endian_swap.h"
 #include "alloca.h"
+#include "freetype_includes.h"
 
 /* inline attribute */
 #ifndef CYTHON_INLINE
@@ -306,6 +312,7 @@
   "png_writer.pyx",
   "fortran_reader.pyx",
   "QuadTree.pyx",
+  "freetype_writer.pyx",
   "numpy.pxd",
   "amr_utils.pyx",
 };
@@ -871,8 +878,6 @@
 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
 static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
 
-static CYTHON_INLINE long __Pyx_mod_long(long, long); /* proto */
-
 static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
     if (likely(PyList_CheckExact(L))) {
         if (PyList_Append(L, x) < 0) return NULL;
@@ -889,8 +894,6 @@
     }
 }
 
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
-
 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
 
 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
@@ -930,11 +933,7 @@
     return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
 }
 
-static CYTHON_INLINE int __Pyx_div_int(int, int); /* proto */
-
-#define UNARY_NEG_WOULD_OVERFLOW(x)		(((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
-
-static CYTHON_INLINE __pyx_t_5numpy_int64_t __Pyx_div___pyx_t_5numpy_int64_t(__pyx_t_5numpy_int64_t, __pyx_t_5numpy_int64_t); /* proto */
+#include <string.h>
 
 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
 
@@ -952,7 +951,7 @@
 
 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
 
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_Py_intptr_t(Py_intptr_t);
 
 static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *);
 
@@ -1064,6 +1063,8 @@
 
 static CYTHON_INLINE long __Pyx_pow_long(long, long); /* proto */
 
+static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint8(npy_uint8);
+
 #if CYTHON_CCOMPLEX
   #ifdef __cplusplus
     #define __Pyx_CREAL(z) ((z).real())
@@ -1232,6 +1233,8 @@
 static PyTypeObject *__pyx_ptype_2yt_9utilities_9amr_utils_GridFace = 0;
 static PyTypeObject *__pyx_ptype_2yt_9utilities_9amr_utils_ProtoPrism = 0;
 static PyTypeObject *__pyx_ptype_2yt_9utilities_9amr_utils_QuadTree = 0;
+static int __pyx_v_2yt_9utilities_9amr_utils_initialized;
+static FT_Library __pyx_v_2yt_9utilities_9amr_utils_library;
 static CYTHON_INLINE void __pyx_f_2yt_9utilities_9amr_utils_set_rotated_pos(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t (*)[3], __pyx_t_5numpy_float64_t *, int, int, int); /*proto*/
 static void __pyx_f_2yt_9utilities_9amr_utils_normalize_vector(__pyx_t_5numpy_float64_t *); /*proto*/
 static void __pyx_f_2yt_9utilities_9amr_utils_get_cross_product(__pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *, __pyx_t_5numpy_float64_t *); /*proto*/
@@ -1379,8 +1382,12 @@
 static char __pyx_k__posx[] = "posx";
 static char __pyx_k__posy[] = "posy";
 static char __pyx_k__posz[] = "posz";
+static char __pyx_k__rows[] = "rows";
+static char __pyx_k__text[] = "text";
 static char __pyx_k__x_is[] = "x_is";
+static char __pyx_k__xpos[] = "xpos";
 static char __pyx_k__y_is[] = "y_is";
+static char __pyx_k__ypos[] = "ypos";
 static char __pyx_k__z_is[] = "z_is";
 static char __pyx_k__alpha[] = "alpha";
 static char __pyx_k__close[] = "close";
@@ -1390,6 +1397,7 @@
 static char __pyx_k__empty[] = "empty";
 static char __pyx_k__field[] = "field";
 static char __pyx_k__floor[] = "floor";
+static char __pyx_k__glyph[] = "glyph";
 static char __pyx_k__green[] = "green";
 static char __pyx_k__grids[] = "grids";
 static char __pyx_k__idbin[] = "idbin";
@@ -1411,6 +1419,7 @@
 static char __pyx_k__stack[] = "stack";
 static char __pyx_k__sweep[] = "sweep";
 static char __pyx_k__table[] = "table";
+static char __pyx_k__width[] = "width";
 static char __pyx_k__wvals[] = "wvals";
 static char __pyx_k__x_vec[] = "x_vec";
 static char __pyx_k__y_vec[] = "y_vec";
@@ -1418,6 +1427,7 @@
 static char __pyx_k__aimage[] = "aimage";
 static char __pyx_k__ax_vec[] = "ax_vec";
 static char __pyx_k__ay_vec[] = "ay_vec";
+static char __pyx_k__bitmap[] = "bitmap";
 static char __pyx_k__bounds[] = "bounds";
 static char __pyx_k__buffer[] = "buffer";
 static char __pyx_k__center[] = "center";
@@ -1445,6 +1455,7 @@
 static char __pyx_k__z_vals[] = "z_vals";
 static char __pyx_k__Channel[] = "Channel";
 static char __pyx_k__acenter[] = "acenter";
+static char __pyx_k__advance[] = "advance";
 static char __pyx_k__avp_dir[] = "avp_dir";
 static char __pyx_k__avp_pos[] = "avp_pos";
 static char __pyx_k__corners[] = "corners";
@@ -1466,6 +1477,7 @@
 static char __pyx_k__children[] = "children";
 static char __pyx_k__field_id[] = "field_id";
 static char __pyx_k__filename[] = "filename";
+static char __pyx_k__fontpath[] = "fontpath";
 static char __pyx_k__grid_dds[] = "grid_dds";
 static char __pyx_k__istorage[] = "istorage";
 static char __pyx_k__itemsize[] = "itemsize";
@@ -1483,6 +1495,7 @@
 static char __pyx_k__copy_into[] = "copy_into";
 static char __pyx_k__direction[] = "direction";
 static char __pyx_k__field_ids[] = "field_ids";
+static char __pyx_k__font_size[] = "font_size";
 static char __pyx_k__genealogy[] = "genealogy";
 static char __pyx_k__grid_dims[] = "grid_dims";
 static char __pyx_k__grid_mask[] = "grid_mask";
@@ -1493,11 +1506,13 @@
 static char __pyx_k__slab_size[] = "slab_size";
 static char __pyx_k__Transfer3D[] = "Transfer3D";
 static char __pyx_k__ValueError[] = "ValueError";
+static char __pyx_k__bitmap_top[] = "bitmap_top";
 static char __pyx_k__box_center[] = "box_center";
 static char __pyx_k__box_origin[] = "box_origin";
 static char __pyx_k__child_mask[] = "child_mask";
 static char __pyx_k__count_only[] = "count_only";
 static char __pyx_k__dimensions[] = "dimensions";
+static char __pyx_k__face_index[] = "face_index";
 static char __pyx_k__im_strides[] = "im_strides";
 static char __pyx_k__left_edges[] = "left_edges";
 static char __pyx_k__level_data[] = "level_data";
@@ -1514,6 +1529,7 @@
 static char __pyx_k__vd_strides[] = "vd_strides";
 static char __pyx_k__vp_strides[] = "vp_strides";
 static char __pyx_k__weight_val[] = "weight_val";
+static char __pyx_k__bitmap_left[] = "bitmap_left";
 static char __pyx_k__box_lengths[] = "box_lengths";
 static char __pyx_k__box_vectors[] = "box_vectors";
 static char __pyx_k__break_first[] = "break_first";
@@ -1554,6 +1570,7 @@
 static char __pyx_k__weight_field_ids[] = "weight_field_ids";
 static char __pyx_k__weight_table_ids[] = "weight_table_ids";
 static char __pyx_k__find_on_root_level[] = "find_on_root_level";
+static char __pyx_k__initialize_library[] = "initialize_library";
 static char __pyx_k__component_grid_info[] = "component_grid_info";
 static PyObject *__pyx_n_s_1;
 static PyObject *__pyx_kp_u_10;
@@ -1584,6 +1601,7 @@
 static PyObject *__pyx_n_s__a;
 static PyObject *__pyx_n_s__acenter;
 static PyObject *__pyx_n_s__add_to_position;
+static PyObject *__pyx_n_s__advance;
 static PyObject *__pyx_n_s__aimage;
 static PyObject *__pyx_n_s__alpha;
 static PyObject *__pyx_n_s__avp_dir;
@@ -1591,6 +1609,9 @@
 static PyObject *__pyx_n_s__ax_vec;
 static PyObject *__pyx_n_s__ay_vec;
 static PyObject *__pyx_n_s__base;
+static PyObject *__pyx_n_s__bitmap;
+static PyObject *__pyx_n_s__bitmap_left;
+static PyObject *__pyx_n_s__bitmap_top;
 static PyObject *__pyx_n_s__blue;
 static PyObject *__pyx_n_s__bounds;
 static PyObject *__pyx_n_s__box_center;
@@ -1634,6 +1655,7 @@
 static PyObject *__pyx_n_s__e;
 static PyObject *__pyx_n_s__empty;
 static PyObject *__pyx_n_s__eval_transfer;
+static PyObject *__pyx_n_s__face_index;
 static PyObject *__pyx_n_s__field;
 static PyObject *__pyx_n_s__field_id;
 static PyObject *__pyx_n_s__field_ids;
@@ -1648,10 +1670,13 @@
 static PyObject *__pyx_n_s__float64;
 static PyObject *__pyx_n_s__floor;
 static PyObject *__pyx_n_s__fn;
+static PyObject *__pyx_n_s__font_size;
+static PyObject *__pyx_n_s__fontpath;
 static PyObject *__pyx_n_s__format;
 static PyObject *__pyx_n_s__genealogy;
 static PyObject *__pyx_n_s__get_start_stop;
 static PyObject *__pyx_n_s__gi;
+static PyObject *__pyx_n_s__glyph;
 static PyObject *__pyx_n_s__gray;
 static PyObject *__pyx_n_s__green;
 static PyObject *__pyx_n_s__grid;
@@ -1676,6 +1701,7 @@
 static PyObject *__pyx_n_s__imax;
 static PyObject *__pyx_n_s__imin;
 static PyObject *__pyx_n_s__ind;
+static PyObject *__pyx_n_s__initialize_library;
 static PyObject *__pyx_n_s__int32;
 static PyObject *__pyx_n_s__int64;
 static PyObject *__pyx_n_s__int8;
@@ -1769,6 +1795,7 @@
 static PyObject *__pyx_n_s__root_nodes;
 static PyObject *__pyx_n_s__root_size;
 static PyObject *__pyx_n_s__rot_mat;
+static PyObject *__pyx_n_s__rows;
 static PyObject *__pyx_n_s__sample_values;
 static PyObject *__pyx_n_s__shape;
 static PyObject *__pyx_n_s__shells;
@@ -1783,6 +1810,7 @@
 static PyObject *__pyx_n_s__sweep;
 static PyObject *__pyx_n_s__table;
 static PyObject *__pyx_n_s__tables;
+static PyObject *__pyx_n_s__text;
 static PyObject *__pyx_n_s__tf;
 static PyObject *__pyx_n_s__tf_obj;
 static PyObject *__pyx_n_s__top_grid_dims;
@@ -1804,6 +1832,7 @@
 static PyObject *__pyx_n_s__weight_table_id;
 static PyObject *__pyx_n_s__weight_table_ids;
 static PyObject *__pyx_n_s__weight_val;
+static PyObject *__pyx_n_s__width;
 static PyObject *__pyx_n_s__wvals;
 static PyObject *__pyx_n_s__x;
 static PyObject *__pyx_n_s__x_bins;
@@ -1811,12 +1840,14 @@
 static PyObject *__pyx_n_s__x_is;
 static PyObject *__pyx_n_s__x_vals;
 static PyObject *__pyx_n_s__x_vec;
+static PyObject *__pyx_n_s__xpos;
 static PyObject *__pyx_n_s__xrange;
 static PyObject *__pyx_n_s__y;
 static PyObject *__pyx_n_s__y_bins;
 static PyObject *__pyx_n_s__y_is;
 static PyObject *__pyx_n_s__y_vals;
 static PyObject *__pyx_n_s__y_vec;
+static PyObject *__pyx_n_s__ypos;
 static PyObject *__pyx_n_s__z;
 static PyObject *__pyx_n_s__z_bins;
 static PyObject *__pyx_n_s__z_is;



More information about the yt-svn mailing list