[CP2K:3992] creating a sparse dbcsr matrix

Urban Borštnik urban.b... at gmail.com
Mon Aug 27 08:35:28 UTC 2012

Hi Adam,

On Fri, 2012-08-24 at 16:34 -0700, Adam wrote:
> Hi,
> I'm creating dbcsr matrices out of dense 2d fortran arrays. However
> few elements are non-zero values, and I'd like to build a dbcsr matrix
> in sparse format so I can see speed ups when doing multiplication. The
> examples provided with the dbcsr package only show how to build dense
> random matrices. Is there any examples on building sparse matrices, or
> can you tell me how a sparse matrix is built? Right now timing my code
> it is scaling closer to order n^3 than n. Any help is much
> appreciated.

There are generally two basic approaches to having a sparse matrix:
either you know the sparsity pattern beforehand and store only the
appropriate blocks in the matrix or you completely fill the matrix and
then filter it (using the dbcsr_filter* subroutine(s)).  The latter is
easier to do but it's really only a hack.  It only works in cases where
dense the matrix fits in memory; however, since it's still distributed,
it's usually not a show-stopper.


> Thanks,
> Adam
> -- 
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/cp2k/-/sn_p2BvQTe0J.
> To post to this group, send email to cp... at googlegroups.com.
> To unsubscribe from this group, send email to cp2k
> +unsub... at googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/cp2k?hl=en.

More information about the CP2K-user mailing list