[Numpy-discussion] (no subject)

Ioan-Alexandru Lazar alexlz at lmn.pub.ro
Wed Jul 21 21:04:29 EDT 2010


Hello everyone,

I'm currently planning to use a Python-based infrastructure for our HPC
project.
I've previously used NumPy and SciPy for basic scientific computing tasks,
but
performance hasn't been quite an issue for me until now. At the moment I'm
not too
sure as to what to do next though, and I was hoping that someone with more
experience in performance-related issues could point me to a way out of this.

The trouble lays in the following piece of code:

===
    w = 2 * math.pi * f
    M = A - (1j*w*E)
    n = M.shape[1]
    B1 = numpy.zeros(n)
    B2 = numpy.zeros(n)
    B1[n-2] = 1.0
    B2[n-1] = 1.0
-> slow part starts here
umfpack.numeric(M)
    x1 = umfpack.solve( um.UMFPACK_A, M, B1, autoTranspose = False)
    x2 = umfpack.solve( um.UMFPACK_A, M, B2, autoTranspose = False)
    solution = scipy.array([ [ x1[n-2], x2[n-2] ], [ x1[n-1], x2[n-1] ]])
    return solution
====

This isn't really too much -- it's generating a small



More information about the NumPy-Discussion mailing list