<p dir="ltr">We cannot see the error message. Use CHKERRXX</p>
<p dir="ltr">   Matt</p>
<div class="gmail_quote">On Jan 3, 2013 1:11 PM, "Hesameddin Ilatikhameneh" <<a href="mailto:hilatikh@purdue.edu">hilatikh@purdue.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The point is the problem occurs when I'm assembling the matrix and since it is unsuccessful MatView gives error.<br>
I assemble the matrix:<br>
<br>
                this->Petsc_Error = MatAssemblyBegin(*(this->Petsc_Mat),MAT_FINAL_ASSEMBLY);<br>
                this->Check_Petsc_Error();<br>
                this->Petsc_Error = MatAssemblyEnd(*(this->Petsc_Mat),MAT_FINAL_ASSEMBLY);<br>
                this->Check_Petsc_Error();<br>
<br>
Thanks<br>
Hesam<br>
----- Original Message -----<br>
From: "Jed Brown" <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>><br>
To: "For users of the development version of PETSc" <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>><br>
Cc: "petsc-maint" <<a href="mailto:petsc-maint@mcs.anl.gov">petsc-maint@mcs.anl.gov</a>><br>
Sent: Thursday, January 3, 2013 2:07:40 PM<br>
Subject: Re: [petsc-dev] Problem Assembling MatCreateAIJ (Parallel Sparse       Matrix)<br>
<br>
<br>
<br>
You have to assemble the matrix, just like the error message says.<br>
On Jan 3, 2013 1:00 PM, "Hesameddin Ilatikhameneh" < <a href="mailto:hilatikh@purdue.edu">hilatikh@purdue.edu</a> > wrote:<br>
<br>
<br>
Hello,<br>
<br>
When I try to assemble a parallel sparse matrix (MatCreateAIJ) I get the following error. But when I try to set the parallel matrix in dense format I don't get any error. I used PETSC_DECIDE for number of local elements and number of local nonzeros and PETSC_NULL for nonzeros array in MatCreateAIJ.<br>

<br>
<br>
[0]PETSC ERROR: [1]PETSC ERROR: VecScatterCreateCommon_PtoS() line 2013 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vpscat.c<br>
[0]PETSC ERROR: VecScatterCreate_PtoS() line 1807 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vpscat.c<br>
[0]PETSC ERROR: VecScatterCreate() line 1331 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vscat.c<br>
[0]PETSC ERROR: MatSetUpMultiply_MPIAIJ() line 150 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/impls/aij/mpi/mmaij.c<br>
[0]PETSC ERROR: MatAssemblyEnd_MPIAIJ() line 702 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/impls/aij/mpi/mpiaij.c<br>
[0]PETSC ERROR: MatAssemblyEnd() line 4879 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/interface/matrix.c<br>
[0]PETSC ERROR: User provided function() line 65 in "unknowndirectory/"/home/Codes/trunk/HSim2/Include/Math/PetscMatrix.h<br>
VecScatterCreateCommon_PtoS() line 2003 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vpscat.c<br>
[1]PETSC ERROR: VecScatterCreate_PtoS() line 1807 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vpscat.c<br>
[1]PETSC ERROR: VecScatterCreate() line 1331 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/vec/vec/utils/vscat.c<br>
[1]PETSC ERROR: MatSetUpMultiply_MPIAIJ() line 150 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/impls/aij/mpi/mmaij.c<br>
[1]PETSC ERROR: MatAssemblyEnd_MPIAIJ() line 702 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/impls/aij/mpi/mpiaij.c<br>
[1]PETSC ERROR: MatAssemblyEnd() line 4879 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/interface/matrix.c<br>
[1]PETSC ERROR: User provided function() line 65 in "unknowndirectory/"/home/Codes/trunk/HSim2/Include/Math/PetscMatrix.h<br>
[0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[0]PETSC ERROR: Operation done in wrong order!<br>
[0]PETSC ERROR: Must call MatAssemblyBegin/End() before viewing matrix!<br>
[0]PETSC ERROR: ------------------------------------------------------------------------<br>
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec 1 15:10:41 CST 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>
[0]PETSC ERROR: ./bin_Ubuntu/HSim2 on a linux-gnu named hesam2-VirtualBox by hesam2 Thu Jan 3 13:44:28 2013<br>
[0]PETSC ERROR: Libraries linked from /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/linux-gnu-real/lib<br>
[0]PETSC ERROR: Configure run at Fri Dec 21 08:15:55 2012<br>
[0]PETSC ERROR: Configure options PETSC_DIR=/home/Codes/trunk/Libs/Petsc/PETSC_Build_Real PETSC_ARCH=linux-gnu-real --with-shared-libraries --download-f-blas-lapack=1 --with-single-library=0 --with-shared-libraries --with-debugging=1 --with-scalar-type=real<br>

[0]PETSC ERROR: ------------------------------------------------------------------------<br>
[0]PETSC ERROR: MatView() line 740 in /home/Codes/trunk/Libs/Petsc/PETSC_Build_Real/src/mat/interface/matrix.c<br>
<br>
================================================================================<br>
<br>
<br>
Many Thanks<br>
Hesam<br>
</blockquote></div>