Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-16 Thread Burlen Loring
On 06/14/2016 01:05 PM, Nathaniel Smith wrote: On Jun 14, 2016 12:38 PM, "Burlen Loring" <mailto:blor...@lbl.gov>> wrote: > > On 06/14/2016 12:28 PM, Julian Taylor wrote: >> >> On 14.06.2016 19:34, Burlen Loring wrote: >> >>> >>>

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Burlen Loring
On 06/14/2016 12:28 PM, Julian Taylor wrote: On 14.06.2016 19:34, Burlen Loring wrote: here's my question: given Py_BEGIN_ALLOW_THREADS is used by numpy how can numpy be thread safe? and how can someone using the C-API know where it's necessary to acquire the GIL? Maybe someone c

Re: [Numpy-discussion] numpy threads crash when allocating arrays

2016-06-14 Thread Burlen Loring
2:#define NPY_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS ./numpy/core/include/numpy/ndarraytypes.h:952:#define NPY_BEGIN_ALLOW_THREADS On 06/13/2016 07:07 PM, Nathaniel Smith wrote: Hi Burlen, On Jun 13, 2016 5:24 PM, "Burlen Loring" wrote: Hi All, I'm working on a th

[Numpy-discussion] numpy threads crash when allocating arrays

2016-06-13 Thread Burlen Loring
Hi All, I'm working on a threaded pipeline where we want the end user to be able to code up Python functions to do numerical work. Threading is all done in C++11 and in each thread we've acquired gill before we invoke the user provided Python callback and release it only when the callback ret

[Numpy-discussion] numpy in python callback from threaded c++

2016-03-28 Thread Burlen Loring
Hi All, in my c++ code I've added Python binding via swig. one scenario is to pass a python function to do some computational work. the Python program runs in serial in the main thread but work is handled by a thread pool, the callback is invoked from another thread on unique data. Before a t

Re: [Numpy-discussion] [EXTERNAL] segv PyArray_Check

2013-11-14 Thread Burlen Loring
() call inside a C++ singleton, and put > that singleton in a dynamic library that all my packages link to, thus > insuring that it gets called once and only once. > > -Bill > > On Nov 14, 2013, at 11:10 AM, Burlen Loring wrote: > >> Hi David, >> >> Yes, that t

Re: [Numpy-discussion] segv PyArray_Check

2013-11-14 Thread Burlen Loring
foo_wrap.c by a typemap, > for example a typemap from numpy.i . > > Do you use PyArray_Check in the foo_wrap.c or in another file? Is > PyArray_Check in called in another C library, that _foo.so is linked > with? > > David > > Quoting Burlen Loring (2013-11-14 02:21:19) >&

[Numpy-discussion] segv PyArray_Check

2013-11-13 Thread Burlen Loring
Hi, I'd like to add numpy support to an existing code that uses swig. I've changed the source file that has code to convert python lists into native data from c to c++ so I can use templates to handle data conversions. The problem I'm having is a segfault on PyArray_Check called from my c++ so

Re: [Numpy-discussion] fft help

2011-12-29 Thread Burlen Loring
nal image? (allclose returned > True for a little test I did here) > 2) does scipy.fftpack.fft2 yield the same result? > > //Torgil > > > On Thu, Dec 29, 2011 at 6:32 PM, Burlen Loring > wrote: >> hmmph, I used both fftn and fft2, they both produce the same result. Is >>

Re: [Numpy-discussion] fft help

2011-12-29 Thread Burlen Loring
l discrete Fourier Transform. > > > On Wed, Dec 28, 2011 at 10:05 PM, Burlen Loring > wrote: >> Hi >> >> I have an image I need to do an fft on, I tried numpy.fft but results are >> not what I expected, and differ from matlab. >> >> My input image is a

[Numpy-discussion] fft help

2011-12-28 Thread Burlen Loring
Hi I have an image I need to do an fft on, I tried numpy.fft but results are not what I expected, and differ from matlab. My input image is a weird size, 5118x1279, I think numpy fft is not liking it. In numpy the fft appears to be computed multiple times and tiled across the output image. In o