Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-07 Thread Florian Lindner
Hey, I've modified my code that it counts the total number of non-zeros (trivial to put in the preallocation code) and decides upon that wheather to create a MATSBAIJ or MATDENSE matrix. Using sparse matrices (for one that is really dense) I've made good experiences with -pc_factor_shift_type

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-07 Thread Barry Smith
On Nov 7, 2014, at 7:03 AM, Florian Lindner mailingli...@xgm.de wrote: Hey, I've modified my code that it counts the total number of non-zeros (trivial to put in the preallocation code) and decides upon that wheather to create a MATSBAIJ or MATDENSE matrix. Using sparse matrices

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-06 Thread Jed Brown
Florian Lindner mailingli...@xgm.de writes: I'm more or less aware of that, but I'm surprised that the performance is such poor. If you've ever written a naive triply-nested loop dgemm, you'd know that it gives up orders of magnitude. I changed the format of matrixC to dense now, but the

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-05 Thread Florian Lindner
Am Dienstag, 4. November 2014, 19:14:58 schrieb Jed Brown: Barry Smith bsm...@mcs.anl.gov writes: I've tried to use a direct solver like suggested on pp 72, but: ./petBench 600 1 -ksp_type preonly -pc_type lu You cannot use LU with SBAIJ format. Only Cholesky. So use -pc_type

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-05 Thread Florian Lindner
Am Dienstag, 4. November 2014, 10:08:27 schrieb Barry Smith: There are a lot of questions here. Yes, thanks for replying! On Nov 4, 2014, at 328 AM, Florian Lindner mailingli...@xgm.de wrote: Hello, I have a fulll matrix of size e.g. 603x603 of which I'm very disappointed

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-05 Thread Barry Smith
So you have a dense, very ill-conditioned matrix. Seems to me you should just be using the dense LU/Cholesky factorization unless you know how to preconditioner these types of matrices. http://scicomp.stackexchange.com/questions/7561/do-rbf-kernel-matrices-tend-to-be-ill-conditioned You

[petsc-users] Speed up KSPSolve of dense matrix

2014-11-04 Thread Florian Lindner
Hello, I have a fulll matrix of size e.g. 603x603 of which I'm very disappointed with the runtime, compared to a naive LU / forward / backward solution. My petsc solution takes about 14s, while the old one takes just 0.5s. (when you're looking at sparse matrices the figures are almost

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-04 Thread Barry Smith
There are a lot of questions here. On Nov 4, 2014, at 3:28 AM, Florian Lindner mailingli...@xgm.de wrote: Hello, I have a fulll matrix of size e.g. 603x603 of which I'm very disappointed with the runtime, compared to a naive LU / forward / backward solution. My petsc solution

Re: [petsc-users] Speed up KSPSolve of dense matrix

2014-11-04 Thread Jed Brown
Barry Smith bsm...@mcs.anl.gov writes: I've tried to use a direct solver like suggested on pp 72, but: ./petBench 600 1 -ksp_type preonly -pc_type lu You cannot use LU with SBAIJ format. Only Cholesky. So use -pc_type cholesky And using a sparse matrix format for a dense matrix is a