Roy Stogner writes:
> On Tue, 23 Aug 2005, John Peterson wrote:
> > Does anybody (Ben) have a suggestion on calling dof_indices less, or possibly
> > optimizing it in some way? This is a performance log for a 2D code, where
> > dof_indices is called about 9.7 million times comprising about 9% of the
> > active run time. I've looked at the function itself, and it's
> > extremely clean, there aren't any N^2 algorithms hiding inside it --
> > hell each call to the function is barely measurable! So I think the
> > answer may be to call it less, but I'm not sure how that can
> > possibly be done...suggestions?
> Well, half of the dof_indices and old_dof_indices calls are occuring
> during the project_vector functions, which currently get called at
> least twice as often as necessary. We need to implement an
> "add_unprojected_vector" version of "add_vector" which marks the new
> vector (i.e. the rhs vector) to be zeroed instead of projected at each
> remeshing, and we need to redo the arguments to project_vector so that
> it can be used to project a bunch of vectors at once rather than one
> at a time.
> That shouldn't be too complicated and it'll cut 25% or more out of the
> dof_indices time - I've just been putting it off because I didn't
> realize the inefficiency was causing noticeable problems.
As an aside, my results are a bit exaggerated by the fact that I was
also doing a predictor-corrector timestepping scheme, so there were about
three extra vectors being projected at each timestep than there normally
would have been for Crank-Nicolson.