[Getdp] GetDP speed: Can parts of calculations be reused?

John_V jvillar.john at gmail.com
Fri Dec 10 22:55:33 CET 2010


In my application I am repeatedly solving almost the same electrostatic 
problem. It is a 3-D problem with a large mesh (a bit less than 400 
thousand nodes), and it takes GetDP about 15 minutes on my computer. 
Then I re-run the calculation a few seconds later with the same mesh. 
The only thing that has changed is the charge density distribution. This 
naturally makes me wonder whether some (possibly large) part of the work 
is being needlessly repeated, and if so whether there is a way to 
greatly speed up this calculation.

To put it another way: GetDP is solving a linear problem, K.V = S where 
K is a matrix that depends only on the mesh geometry, V is a vector of 
potentials at my mesh nodes, and S is a vector of source terms 
(apologies if these are not the standard notation). In my repeated 
problems, the mesh (and therefore K) is the same every time. The only 
thing that changes is S. GetDP could invert K, save Kinverse, and then 
simply multiply each new S vector by Kinverse to obtain the new 
solution. I realize this isn't what it does. A full inversion is 
ordinarily slow, so an iterative method is used instead. Nevertheless, 
one wonders whether some of the work can be saved and reused rather than 
repeated.

How do you suppose those 15 minutes are being spent? I have noticed that 
the output showing the convergence to a solution (over approx. 100 
iterations) all comes in the last minute or less of the 15. What is it 
doing for the first 14 minutes? Does it take that long to load the K matrix?

John