[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Jun 29 11:23:06 PDT 2016


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/4ed97dbcd832/
Changeset:   4ed97dbcd832
Branch:      yt
User:        atmyers
Date:        2016-06-16 01:03:31+00:00
Summary:     disable bounds checking on pixelize_element_mesh
Affected #:  1 file

diff -r dfe34c8552f4bb62b86c8d6e3990f41025ec9cd6 -r 4ed97dbcd832da602e8f228c57dca14578faf256 yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -539,7 +539,9 @@
                 return 0
     return 1
 
-
+ at cython.cdivision(True)
+ at cython.boundscheck(False)
+ at cython.wraparound(False)
 def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords,
                           np.ndarray[np.int64_t, ndim=2] conn,
                           buff_size,


https://bitbucket.org/yt_analysis/yt/commits/ac0344cc8f95/
Changeset:   ac0344cc8f95
Branch:      yt
User:        atmyers
Date:        2016-06-16 01:31:33+00:00
Summary:     make these functions nogil like the others
Affected #:  1 file

diff -r 4ed97dbcd832da602e8f228c57dca14578faf256 -r ac0344cc8f951e1dacdc6ed59763cf1d17312ebf yt/utilities/lib/fp_utils.pxd
--- a/yt/utilities/lib/fp_utils.pxd
+++ b/yt/utilities/lib/fp_utils.pxd
@@ -50,11 +50,11 @@
                       np.float64_t a, np.float64_t b) nogil:
     return fmin(fmax(f, a), b)
 
-cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
+cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
     if i0 > i1: return i0
     return i1
 
-cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
+cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
     if i0 < i1: return i0
     return i1
 


https://bitbucket.org/yt_analysis/yt/commits/0cf71d568654/
Changeset:   0cf71d568654
Branch:      yt
User:        atmyers
Date:        2016-06-16 01:31:55+00:00
Summary:     only disable bounds checking inside the tight loop/
Affected #:  1 file

diff -r ac0344cc8f951e1dacdc6ed59763cf1d17312ebf -r 0cf71d5686543dfd597cb88429c542905175673e yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -31,7 +31,7 @@
     P1Sampler2D, \
     Q1Sampler2D, \
     W1Sampler3D
-
+from cython.parallel cimport prange, parallel
 
 cdef extern from "pixelization_constants.h":
     enum:
@@ -539,9 +539,7 @@
                 return 0
     return 1
 
- at cython.cdivision(True)
- at cython.boundscheck(False)
- at cython.wraparound(False)
+
 def pixelize_element_mesh(np.ndarray[np.float64_t, ndim=2] coords,
                           np.ndarray[np.int64_t, ndim=2] conn,
                           buff_size,
@@ -612,57 +610,58 @@
         else:
             idds[i] = 1.0 / dds[i]
 
-    for ci in range(conn.shape[0]):
+    with cython.boundscheck(False):
+        for ci in range(conn.shape[0]):
 
-        # Fill the vertices
-        LE[0] = LE[1] = LE[2] = 1e60
-        RE[0] = RE[1] = RE[2] = -1e60
+            # Fill the vertices
+            LE[0] = LE[1] = LE[2] = 1e60
+            RE[0] = RE[1] = RE[2] = -1e60
 
-        for n in range(num_field_vals):
-            field_vals[n] = field[ci, n]
+            for n in range(num_field_vals):
+                field_vals[n] = field[ci, n]
 
-        for n in range(nvertices):
-            cj = conn[ci, n] - index_offset
+            for n in range(nvertices):
+                cj = conn[ci, n] - index_offset
+                for i in range(ndim):
+                    vertices[ndim*n + i] = coords[cj, i]
+                    LE[i] = fmin(LE[i], vertices[ndim*n+i])
+                    RE[i] = fmax(RE[i], vertices[ndim*n+i])
+
+            use = 1
             for i in range(ndim):
-                vertices[ndim*n + i] = coords[cj, i]
-                LE[i] = fmin(LE[i], vertices[ndim*n+i])
-                RE[i] = fmax(RE[i], vertices[ndim*n+i])
+                if RE[i] < pLE[i] or LE[i] >= pRE[i]:
+                    use = 0
+                    break
+                pstart[i] = i64max(<np.int64_t> ((LE[i] - pLE[i])*idds[i]) - 1, 0)
+                pend[i] = i64min(<np.int64_t> ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1)
 
-        use = 1
-        for i in range(ndim):
-            if RE[i] < pLE[i] or LE[i] >= pRE[i]:
-                use = 0
-                break
-            pstart[i] = i64max(<np.int64_t> ((LE[i] - pLE[i])*idds[i]) - 1, 0)
-            pend[i] = i64min(<np.int64_t> ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1)
+            # override for the 2D case
+            if ndim == 2:
+                pstart[2] = 0
+                pend[2] = 0
 
-        # override for the 2D case
-        if ndim == 2:
-            pstart[2] = 0
-            pend[2] = 0
+            if use == 0:
+                continue
 
-        if use == 0:
-            continue
-
-        # Now our bounding box intersects, so we get the extents of our pixel
-        # region which overlaps with the bounding box, and we'll check each
-        # pixel in there.
-        for pi in range(pstart[0], pend[0] + 1):
-            ppoint[0] = (pi + 0.5) * dds[0] + pLE[0]
-            for pj in range(pstart[1], pend[1] + 1):
-                ppoint[1] = (pj + 0.5) * dds[1] + pLE[1]
-                for pk in range(pstart[2], pend[2] + 1):
-                    ppoint[2] = (pk + 0.5) * dds[2] + pLE[2]
-                    # Now we just need to figure out if our ppoint is within
-                    # our set of vertices.
-                    sampler.map_real_to_unit(mapped_coord, vertices, ppoint)
-                    if not sampler.check_inside(mapped_coord):
-                        continue
-                    if (num_field_vals == 1):
-                        img[pi, pj, pk] = field_vals[0]
-                    else:
-                        img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord,
-                                                                       field_vals)
+            # Now our bounding box intersects, so we get the extents of our pixel
+            # region which overlaps with the bounding box, and we'll check each
+            # pixel in there.
+            for pi in range(pstart[0], pend[0] + 1):
+                ppoint[0] = (pi + 0.5) * dds[0] + pLE[0]
+                for pj in range(pstart[1], pend[1] + 1):
+                    ppoint[1] = (pj + 0.5) * dds[1] + pLE[1]
+                    for pk in range(pstart[2], pend[2] + 1):
+                        ppoint[2] = (pk + 0.5) * dds[2] + pLE[2]
+                        # Now we just need to figure out if our ppoint is within
+                        # our set of vertices.
+                        sampler.map_real_to_unit(mapped_coord, vertices, ppoint)
+                        if not sampler.check_inside(mapped_coord):
+                            continue
+                        if (num_field_vals == 1):
+                            img[pi, pj, pk] = field_vals[0]
+                        else:
+                            img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord,
+                                                                           field_vals)
     free(vertices)
     free(field_vals)
     return img


https://bitbucket.org/yt_analysis/yt/commits/a359a8288468/
Changeset:   a359a8288468
Branch:      yt
User:        atmyers
Date:        2016-06-16 01:32:57+00:00
Summary:     remove unused imports
Affected #:  1 file

diff -r 0cf71d5686543dfd597cb88429c542905175673e -r a359a8288468890ce7833a465a967fa800394f68 yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -31,7 +31,6 @@
     P1Sampler2D, \
     Q1Sampler2D, \
     W1Sampler3D
-from cython.parallel cimport prange, parallel
 
 cdef extern from "pixelization_constants.h":
     enum:


https://bitbucket.org/yt_analysis/yt/commits/03a2de258276/
Changeset:   03a2de258276
Branch:      yt
User:        xarthisius
Date:        2016-06-29 18:22:52+00:00
Summary:     Merged in atmyers/yt (pull request #2241)

[OPT] Disable bounds checking on pixelize_element_mesh
Affected #:  2 files

diff -r f44aacc05874d84296ec4ffbe53f4f0a66d425b2 -r 03a2de258276003f6e70140a850ab2acee80aeee yt/utilities/lib/fp_utils.pxd
--- a/yt/utilities/lib/fp_utils.pxd
+++ b/yt/utilities/lib/fp_utils.pxd
@@ -50,11 +50,11 @@
                       np.float64_t a, np.float64_t b) nogil:
     return fmin(fmax(f, a), b)
 
-cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1):
+cdef inline np.int64_t i64max(np.int64_t i0, np.int64_t i1) nogil:
     if i0 > i1: return i0
     return i1
 
-cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1):
+cdef inline np.int64_t i64min(np.int64_t i0, np.int64_t i1) nogil:
     if i0 < i1: return i0
     return i1
 

diff -r f44aacc05874d84296ec4ffbe53f4f0a66d425b2 -r 03a2de258276003f6e70140a850ab2acee80aeee yt/utilities/lib/pixelization_routines.pyx
--- a/yt/utilities/lib/pixelization_routines.pyx
+++ b/yt/utilities/lib/pixelization_routines.pyx
@@ -32,7 +32,6 @@
     Q1Sampler2D, \
     W1Sampler3D
 
-
 cdef extern from "pixelization_constants.h":
     enum:
         MAX_NUM_FACES
@@ -618,57 +617,58 @@
         else:
             idds[i] = 1.0 / dds[i]
 
-    for ci in range(conn.shape[0]):
+    with cython.boundscheck(False):
+        for ci in range(conn.shape[0]):
 
-        # Fill the vertices
-        LE[0] = LE[1] = LE[2] = 1e60
-        RE[0] = RE[1] = RE[2] = -1e60
+            # Fill the vertices
+            LE[0] = LE[1] = LE[2] = 1e60
+            RE[0] = RE[1] = RE[2] = -1e60
 
-        for n in range(num_field_vals):
-            field_vals[n] = field[ci, n]
+            for n in range(num_field_vals):
+                field_vals[n] = field[ci, n]
 
-        for n in range(nvertices):
-            cj = conn[ci, n] - index_offset
+            for n in range(nvertices):
+                cj = conn[ci, n] - index_offset
+                for i in range(ndim):
+                    vertices[ndim*n + i] = coords[cj, i]
+                    LE[i] = fmin(LE[i], vertices[ndim*n+i])
+                    RE[i] = fmax(RE[i], vertices[ndim*n+i])
+
+            use = 1
             for i in range(ndim):
-                vertices[ndim*n + i] = coords[cj, i]
-                LE[i] = fmin(LE[i], vertices[ndim*n+i])
-                RE[i] = fmax(RE[i], vertices[ndim*n+i])
+                if RE[i] < pLE[i] or LE[i] >= pRE[i]:
+                    use = 0
+                    break
+                pstart[i] = i64max(<np.int64_t> ((LE[i] - pLE[i])*idds[i]) - 1, 0)
+                pend[i] = i64min(<np.int64_t> ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1)
 
-        use = 1
-        for i in range(ndim):
-            if RE[i] < pLE[i] or LE[i] >= pRE[i]:
-                use = 0
-                break
-            pstart[i] = i64max(<np.int64_t> ((LE[i] - pLE[i])*idds[i]) - 1, 0)
-            pend[i] = i64min(<np.int64_t> ((RE[i] - pLE[i])*idds[i]) + 1, img.shape[i]-1)
+            # override for the 2D case
+            if ndim == 2:
+                pstart[2] = 0
+                pend[2] = 0
 
-        # override for the 2D case
-        if ndim == 2:
-            pstart[2] = 0
-            pend[2] = 0
+            if use == 0:
+                continue
 
-        if use == 0:
-            continue
-
-        # Now our bounding box intersects, so we get the extents of our pixel
-        # region which overlaps with the bounding box, and we'll check each
-        # pixel in there.
-        for pi in range(pstart[0], pend[0] + 1):
-            ppoint[0] = (pi + 0.5) * dds[0] + pLE[0]
-            for pj in range(pstart[1], pend[1] + 1):
-                ppoint[1] = (pj + 0.5) * dds[1] + pLE[1]
-                for pk in range(pstart[2], pend[2] + 1):
-                    ppoint[2] = (pk + 0.5) * dds[2] + pLE[2]
-                    # Now we just need to figure out if our ppoint is within
-                    # our set of vertices.
-                    sampler.map_real_to_unit(mapped_coord, vertices, ppoint)
-                    if not sampler.check_inside(mapped_coord):
-                        continue
-                    if (num_field_vals == 1):
-                        img[pi, pj, pk] = field_vals[0]
-                    else:
-                        img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord,
-                                                                       field_vals)
+            # Now our bounding box intersects, so we get the extents of our pixel
+            # region which overlaps with the bounding box, and we'll check each
+            # pixel in there.
+            for pi in range(pstart[0], pend[0] + 1):
+                ppoint[0] = (pi + 0.5) * dds[0] + pLE[0]
+                for pj in range(pstart[1], pend[1] + 1):
+                    ppoint[1] = (pj + 0.5) * dds[1] + pLE[1]
+                    for pk in range(pstart[2], pend[2] + 1):
+                        ppoint[2] = (pk + 0.5) * dds[2] + pLE[2]
+                        # Now we just need to figure out if our ppoint is within
+                        # our set of vertices.
+                        sampler.map_real_to_unit(mapped_coord, vertices, ppoint)
+                        if not sampler.check_inside(mapped_coord):
+                            continue
+                        if (num_field_vals == 1):
+                            img[pi, pj, pk] = field_vals[0]
+                        else:
+                            img[pi, pj, pk] = sampler.sample_at_unit_point(mapped_coord,
+                                                                           field_vals)
     free(vertices)
     free(field_vals)
     return img

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