On Sun, May 18, 2008 at 09:40:34PM +0200, Dag Lindbo wrote: > > On Sun, May 18, 2008 at 09:07:08PM +0200, Dag Lindbo wrote: > >> > > >> > Dag: A test suite/benchmark would be very good to have. We need to > >> > have something in bench/fem/assembly that we can trust and run > >> > regularly to make sure we don't have regressions. > >> > > >> > >> Here is a suite of performance tests for the dolfin assembler: > >> http://www.csc.kth.se/~dag/dolfin/dolfin_assembler_bench.tar.gz > >> > >> It does seven tests. Assembly and reassembly of the following (bilinear) > >> forms: > >> Elasticity (3d), Incompressible NS Momentum (3d), Laplace on linear > >> (2d), > >> Laplace on quadratic (2d), Laplace on cubic (2d), Stokes TH (2d), Stokes > >> stabilized (2d). This seems to me to be a blend of different types of > >> forms. > >> > >> The design of these tests is as modular as possible, so one can easily > >> add > >> more tests. The top-level SConstruct builds the whole thing. Run with > >> run_tests.py > >> > >> The output as produced by by workstation (2.4GHz Core2Duo, 2gb ddr2, > >> 32bit > >> os) using the uBlas backend: > >> http://www.csc.kth.se/~dag/dolfin/results_uBlas_opt > >> There clearly is a spread in assembler performance for different forms. > >> > >> I suspect that you want to tweak the assembly_tester function to make it > >> backend-invariant. > >> > >> Enjoy! > >> /Dag > > > > Nice. Have you used anything backend-specific? Otherwise it would be > > nice to present the results for all backends. This should be fairly > > simple to do using the newly added option to specify the backend > > dynamically: > > > > dolfin_set("linear algebra backend", "PETSc"); > > // Run code, using Vector and Matrix > > > > dolfin_set("linear algebra backend", "uBLAS"); > > // Run code, using Vector and Matrix > > > > dolfin_set("linear algebra backend", "Epetra"); > > // Run code, using Vector and Matrix > > > > I had to pick out the underlying ublas::Matrix<> in order to get the > number of nonzero elements, since I could not find such a function in the > generic interface. /Dag
I think we need to add something to the GenericMatrix interface to extract this. My suggestion would be to add a function that can be called to compute the sparsity pattern for any matrix. We can currently initialize a matrix from a sparsity pattern but it would be good to be able to do it the other way around, initializing a sparsity pattern from a matrix. In the meantime, maybe you could just iterate over the rows, call getRow() and add columns.size()? -- Anders _______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
