← Back to team overview

dolfin team mailing list archive

Re: MatSetValues profiling

 

> On Sat 2008-05-17 21:19, Murtazo Nazarov wrote:
>> This is from 3D Navier-Stokes equation with linear elements. The first
>> time assembly takes longer because it does initialization of the matrix,
>> it calculates the sparsity pattern. But, then the sparsity pattern and
>> A.init() is not done. Maybe I cannot gain so much, but as I posted in
>> previous posts, I did exactly the same test with another package, with
>> the
>> same mesh, the same elements and the same equations, and that was at
>> least
>> 3 times faster than assembly we have in dolfin. So, instead of 7 seconds
>> it is spent 7/3 seconds which I can gain 10 days from my simulation
>> which
>> takes now 14 days.
>
> I don't understand.  Don't you solve a system with these matrices?  Your
> numbers
> indicate that the solve takes negative time.

What do you mean? In the test I sent you I do not solve the system, it was
just testing the assembly process.

>
> If you want to speed up the insertion of element matrices, I think the
> correct
> way is to do clever caching so that, for instance, an entire row
> contribution
> can be inserted at once.  Anders mentioned this earlier in this thread.
> My
> understanding is that computing the element matrices is supposed to be
> very fast
> in Dolfin since it uses FFC-optimized code.  Can you profile and see
> exactly
> where the time is being spent?  Is it in FFC-generated code or in
> insertion?
>

I think that the FFC is pretty fast and there is no problem with that so
far. The element matrices is calculated fast. I did profiling and posted
previously, here it is again:

Dolfin::Assembler::assembleCells:

1. tabulate_tensor for bilinearform of Momentum in NSE: 6.04%
    tabulate_tensor for    linearform of Momentum in NSE: 11.98%

2. Dolfin::GeneriMatrix::add: 68.98%

3. Dolfin::Function::Interpolate: 9.05%

The most time is spent to add, which calls MatSetValues.

murtazo

> Jed
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>




Follow ups

References