Just FYI, if you need fast kd-trees in C with a Python interface, scipy.spatial has them; additionally, scipy.spatial is largely separable from scipy as a whole, so any compilation problems with scipy will likely not apply to spatial.  ( http://docs.scipy.org/doc/scipy/reference/spatial.html )  This could be extremely useful for a number of problems with generating subsets of data in yt, clustering algorithms, and ray tracing algorithms.  And now it's multi-threaded.<br><br>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="padding: 4px; background-color: #c3d9ff;"><h3 style="margin:0px 3px;font-family:sans-serif">Sent to you by Matt via Google Reader:</h3></div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="font-family:sans-serif;overflow:auto;width:100%;margin: 0px 10px"><h2 style="margin: 0.25em 0 0 0"><div class=""><a href="http://permalink.gmane.org/gmane.comp.python.scientific.user/19675">Implementation of a parallel cKDTree</a></div></h2>
<div style="margin-bottom: 0.5em">via <a href="http://blog.gmane.org/gmane.comp.python.scientific.user" class="f">gmane.comp.python.scientific.user</a> by Sturla Molden on 2/27/09</div><br style="display:none">
<pre>
I have fiddled a bit with scipy.spatial.cKDTree for better performance 
on multicore CPUs. I have used threading.Thread instead of OpenMP, so no 
special compilation or compiler is required. The number of threads 
defaults to the number of processors if it can be determined. The 
performance is not much different from what I get with OpenMP. It is 
faster than using cKDTree with multiprocessing and shared memory.

Memory handling is also improved. There are checks for NULL pointers 
returned by malloc or realloc. setjmp/longjmp is used for error handling 
if malloc or realloc fail. A memory pool is used to make sure all 
complex data structures are cleaned up properly.

I have assumed that crt functions malloc, realloc and free are thread 
safe. This is usually the case. If they are not, they must be wrapped 
with calls to PyGILState_Ensure and PyGILState_Release. I have not done 
this as it could impair scalability.


Regards,
Sturla Molden
_______________________________________________
SciPy-user mailing list
SciPy-user< at >scipy.org
http://projects.scipy.org/mailman/listinfo/scipy-user
</pre></div>
<br>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="padding: 4px; background-color: #c3d9ff;"><h3 style="margin:0px 3px;font-family:sans-serif">Things you can do from here:</h3>
<ul style="font-family:sans-serif"><li><a href="http://www.google.com/reader/view/feed%2Fhttp%3A%2F%2Frss.gmane.org%2Fmessages%2Fcomplete%2Fgmane.comp.python.scientific.user?source=email">Subscribe to gmane.comp.python.scientific.user</a> using <b>Google Reader</b></li>
<li><a href="http://www.google.com/reader/?source=email">Get started using Google Reader</a> to easily keep up with <b>all your favorite sites</b></li></ul></div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;"> </div>