I have a matrix of particle collision times: times[i,j] gives the time for particle "i" to collide with particle "j". If I do, in order to get the first expected collision time for each particle, the following (random array for testing purposes) :
N=30 times = rnd.random([N,N]) choose(argmin(times,transpose(times)) Segmentation fault (of the python interactive shell!!!)
With N=100 I get a more informative traceback, and rest within the shell: Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1670, in choose return _choose(selector, population, outarr, clipmode) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1579, in __call__ result = self._doit(computation_mode, woutarr, cfunc, ufargs, 0) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1564, in _doit blockingparameters) ValueError: _operator_compute: too many inputs + outputs For N=10,N=15 I get the expected output, but for N=20 I get again the brutal segfault... regards, á. -- Álvaro Tejero Cantero http://alqua.org -- documentos libres free documents
On Thu, 2004-05-13 at 07:13, Álvaro Tejero Cantero wrote:
I have a matrix of particle collision times: times[i,j] gives the time for particle "i" to collide with particle "j".
If I do, in order to get the first expected collision time for each particle, the following (random array for testing purposes) :
N=30 times = rnd.random([N,N]) choose(argmin(times,transpose(times)) Segmentation fault (of the python interactive shell!!!)
With N=100 I get a more informative traceback, and rest within the shell:
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1670, in choose return _choose(selector, population, outarr, clipmode) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1579, in __call__ result = self._doit(computation_mode, woutarr, cfunc, ufargs, 0) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1564, in _doit blockingparameters) ValueError: _operator_compute: too many inputs + outputs
For N=10,N=15 I get the expected output, but for N=20 I get again the brutal segfault...
regards, á.
I was able to reproduce this bug, logged it on Source Forge, and will get to it as soon as possible... probably tomorrow or Monday. Regards, Todd
On Thu, 2004-05-13 at 12:57, Todd Miller wrote:
On Thu, 2004-05-13 at 07:13, Álvaro Tejero Cantero wrote:
I have a matrix of particle collision times: times[i,j] gives the time for particle "i" to collide with particle "j".
If I do, in order to get the first expected collision time for each particle, the following (random array for testing purposes) :
N=30 times = rnd.random([N,N]) choose(argmin(times,transpose(times)) Segmentation fault (of the python interactive shell!!!)
With N=100 I get a more informative traceback, and rest within the shell:
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1670, in choose return _choose(selector, population, outarr, clipmode) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1579, in __call__ result = self._doit(computation_mode, woutarr, cfunc, ufargs, 0) File "/usr/lib/python2.3/site-packages/numarray/ufunc.py", line 1564, in _doit blockingparameters) ValueError: _operator_compute: too many inputs + outputs
For N=10,N=15 I get the expected output, but for N=20 I get again the brutal segfault...
regards, á.
I tracked this down today and understand the problem: there's a bug in the ufunc error checking and a ridiculous limit in choose. I'm still working out the "real" solution but a quick workaround is to edit numarray.h and set MAXARGS to a larger number, say N+10. Regards, Todd -- Todd Miller <jmiller@stsci.edu>
I need to solve a matrix equation of the form A u = q for u, where u and q are N-vectors and A is a symmetric-positive-definite matrix. For now, at least, A is a 2-D matrix. I would like to use Python and numarray. Are there Python modules that I could use to obtain a solution for u? Thanks, Craig
participants (3)
-
Craig Rasmussen
-
Todd Miller
-
Álvaro Tejero Cantero