John :<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Should MatRARt work for SeqAIJ matrices? I don't understand what is<br>
wrong with this test code:<br></blockquote><div><br></div><div>The code runs well on Mac and Linux using petsc-3.3 or petsc-dev. I cannot repeat the error. </div><div>However, as you noticed, MatRARt calls coloring, which is experimental,</div>
<div>not well-tested, and the code needs to be cleaned :-(</div><div><br></div><div>Can you test MatRARt on</div><div>petsc-3.3/src/mat/examples/tests/ex94 with attached matrix data file by</div><div><br></div><div>./ex94 -f0 medium -f1 medium</div>
<div><br></div><div>Do it crash?</div><div><br></div><div>From flops analysis and experiments, MatRARt() is not as efficient as MatPtAP,</div><div>likely costs twice as MatPtAP. </div><div><br></div><div>Hong</div><div><br>
</div><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
#include <petsc.h><br>
<br>
#undef __FUNCT__<br>
#define __FUNCT__ "main"<br>
int main(int argc,char **args)<br>
{<br>
Mat A,R,C;<br>
PetscInt ai[5] = {0,2,4,6,8};<br>
PetscInt aj[8] = {0,3,1,2,1,2,0,3};<br>
PetscReal av[8] = {1,2,3,4,5,6,7,8};<br>
PetscInt ri[3] = {0,1,2};<br>
PetscInt rj[2] = {1,2};<br>
PetscReal rv[2] = {1,1};<br>
PetscErrorCode ierr;<br>
<br>
PetscInitialize(&argc,&args,(char *)0,(char *)0);<br>
<br>
ierr = MatCreateSeqAIJWithArrays(PETSC_COMM_WORLD,4,4,ai,aj,av,&A);CHKERRQ(ierr);<br>
ierr = MatCreateSeqAIJWithArrays(PETSC_COMM_WORLD,2,4,ri,rj,rv,&R);CHKERRQ(ierr);<br>
<br>
//this is ok:<br>
//ierr = MatMatMult(R,A,MAT_INITIAL_MATRIX,1.0,&C);CHKERRQ(ierr);<br>
<br>
//this is not:<br>
ierr = MatRARt(A,R,MAT_INITIAL_MATRIX,1.0,&C);CHKERRQ(ierr);<br>
<br>
ierr = PetscFinalize();<br>
return 0;<br>
}<br>
<br>
<br>
When I run it, it says:<br>
<br>
[0]PETSC ERROR: --------------------- Error Message<br>
------------------------------------<br>
[0]PETSC ERROR: No support for this operation for this object type!<br>
[0]PETSC ERROR: MatGetColumnIJ() not supported for matrix type seqaij!<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13<br>
15:42:00 CDT 2012<br>
[0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
[0]PETSC ERROR: See docs/index.html for manual pages.<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: ./rart_simple on a linux-deb named lagrange.tomato by<br>
jfe Wed Jul 18 13:07:33 2012<br>
[0]PETSC ERROR: Libraries linked from<br>
/home/jfe/local/petsc-3.3-p2/linux-debug/lib<br>
[0]PETSC ERROR: Configure run at Wed Jul 18 13:00:59 2012<br>
[0]PETSC ERROR: Configure options --with-x=0<br>
--download-f-blas-lapack=1 --with-mpi=1 --with-mpi-shared=1<br>
--with-mpi=1 --download-mpich=1 --with-debugging=1<br>
--with-gnu-compilers=yes --with-shared-libraries=1 --with-c++-support<br>
--with-clanguage=C<br>
[0]PETSC ERROR:<br>
------------------------------------------------------------------------<br>
[0]PETSC ERROR: MatTransposeColoringCreate_SeqAIJ() line 1294 in<br>
/home/jfe/local/petsc-3.3-p2/src/mat/impls/aij/seq/matmatmult.c<br>
[0]PETSC ERROR: MatTransposeColoringCreate() line 9318 in<br>
/home/jfe/local/petsc-3.3-p2/src/mat/interface/matrix.c<br>
[0]PETSC ERROR: MatRARtSymbolic_SeqAIJ_SeqAIJ() line 342 in<br>
/home/jfe/local/petsc-3.3-p2/src/mat/impls/aij/seq/matrart.c<br>
[0]PETSC ERROR: MatRARt_SeqAIJ_SeqAIJ() line 541 in<br>
/home/jfe/local/petsc-3.3-p2/src/mat/impls/aij/seq/matrart.c<br>
[0]PETSC ERROR: MatRARt() line 8405 in<br>
/home/jfe/local/petsc-3.3-p2/src/mat/interface/matrix.c<br>
[0]PETSC ERROR: main() line 25 in src/ksp/ksp/examples/tutorials/rart_simple.c<br>
<br>
What am I doing wrong?<br>
<br>
Thanks,<br>
John<br>
</blockquote></div><br>