[SciPy-User] Parallelizing a for loop

Scott Askey scotta_2002@yahoo....
Thu Dec 24 08:50:13 CST 2009


Anne:

A pointer to the tools in numpy to apply array operation to my function would be appreciated.
I found found the scipy.vectorize but it did not seem applicable to my 42 input 

As best I could tell I seemed that the time required to calculate two elements (2 x dof in residual 500 times) was the same as calculating  1 x dof residual 1000 times in a for loop.

Chuck:

It is a time marching structural dynamics 1-d beam problem.  The 100 or so parameters are the initial conditions, geometric and material properties.  The 42 dof are the configuration of the  element at the end of the time step.  Given the array of (42 * elements) initial conditions the residuals for each element may be independently calculated. 

Currently I calculate the 42*elements residual by running  "for i in range(element)" and getting  42 residuals in each iteration.

My element residual function is at most at worst cubic polynomials.
The element wise residual and fprime functions are lambdafiedsympy functions.  

Cheers,

Scott


      


More information about the SciPy-User mailing list