[SciPy-Dev] vectorized scipy.integrate.quad

Christoph Groth christoph at grothesque.org
Thu Sep 24 12:49:12 EDT 2015


Dear SciPy experts,

We would like to speed-up some numerical integrations that we do by
parallelizing them with MPI (our integrands take a very long time to
evaluate).

Looking at the implementation of QAGSE (that is
performing the work for scipy.integrate.quad) I see that there is
potential for 21-fold vectorization in the first pass and subsequently for
42-fold vectorization of the evaluation of the integrand.  That’s quite
good!

Once a vectorized scipy.integrand.quad is available, any parallelization
technique can be used in the integrand can use.  But even without
parallelization a vectorized integrand could already provide significant
speedups.

On the Python level, I think that the interface to the new function
could remain the same as that of the existing quad routine, with the
only difference that the first argument of the integrand will be not a
number, but a 1d-array of numbers.

Would such a vectorized quad be a welcome addition to SciPy?  I imagine
proceeding as follows:

(1) Download the relevant parts of QUADPACK and convert them to C using
f2c.

(2) Vectorize the C code.

(3) Add Python bindings.

(4) Write a test that verifies that the vectorized routine evaluates the same
points and gives the same results as the sequential one.

Cheers
Christoph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150924/146777e6/attachment.sig>


More information about the SciPy-Dev mailing list