dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #07899
Re: profiling an assembly
> Hello!
>
> I'm looking at a "suspiciously slow" assembly and would like to
> determine what is going on. In general, what should one expect the most
> time-consuming step to be?
>
> This is what my gprof looks like:
>
> Time:
> 61.97% unsigned int const* std::lower_bound
> 25.84% dolfin::uBlasMatrix<...>::add
> 8.27% UFC_NSEMomentum3DBilinearForm_cell_integral_0::tabulate_tensor
> 1.1% dolfin::uBlasMatrix<...>::init
I got these numbers also. I understand that it is very painful in large
computations.
I see what is a problem with adding into the stiffness matrix A. Searching
the position of the element which needs to be added takes very long time,
especially if you are solving big problems with thousands unknowns and
repeating the assembling a lot of times!
One way could be finding the global indices of the matrix A once, and use
it in the assembly process. By this way we avoid of searching the element
position and it makes the process significantly fast. But, there is a
problem: somehow I cannot get access to the global index of cell in the A
and change it instead of using MatSetValues (in PETSc).
I am pretty sure that we may speed up the A.set() and A.get() processes as
well by the above method.
I am not sure how the dofmap to get rows and cols indices of the cells is
implemented. We could avoid repeating this operation as well.
We did some comparison with another free fem toolbox, FemLego, the
assembly process in Dolfin is 3 times slower than FemLego in 2D. I believe
this number will increase in 3D. FemLego uses quadrature rule for
computing integrals.
I hope some PETSc guys will help us to do this improvements. Any other
ideas are welcome!
Murtazo
>
> The element is linear on tetrahedra, and with a mesh of roughly 90k
> vertices assembling a system of size 290k x 290k takes about 20 seconds
> on my workstation (second swing takes about half that time if the matrix
> is not reset).
>
> Thanks!
> Dag
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
Follow ups
References