Thread Previous • Date Previous • Date Next • Thread Next |
Anders Logg wrote:
I have updated the assembly benchmark in src/bench/fem/assembly and added a simple straight-forward assembly that just uses a std::vector<std::map<int, double> > to store the sparse matrix. Here are the results: Current assembly: 1.37 (with DofMap) Old assembly: 0.814 (without DofMap) Simple assembly: 0.425 (without DofMap and with STL) Simple assembly is 3 times faster than our current assembly.
The picture changes with PETSc matrices, with old assembly and simple assembly being almost the same (5% difference). The problem is slow insertion into uBLAS matrices and the overhead in converting a vector-of-compressed-vectors into a CSR matrix. The current implementation using uBLAS matrices is a compromise between ease, assembly time and conversion to a CSR matrix.
If you take a look at the benchmarks on http://www.bauv.unibw-muenchen.de/~winkler/ublas/sparse_comparison.htmlDOLFIN currently assembles a "GVOV & CRS" corresponding to "fill 3" (random) and then converts it to a CSR matrix. If DofMap would be used to initialise the layout of a CSR matrix, this would correspond to assembling a "compressed matrix" corresponding to "fill 2". This gives a speed up of at least 2, plus it will avoid the overhead (and memory use) of converting from one matrix format to another.
Garth
/Anders _______________________________________________ DOLFIN-dev mailing list DOLFIN-dev@xxxxxxxxxx http://www.fenics.org/mailman/listinfo/dolfin-dev
Thread Previous • Date Previous • Date Next • Thread Next |