<div dir="ltr">Hi Hong,<div style>It's been a while but we have found that moving to PETSc3.4 solved this problem with MatMatMult() in PETSc3.3p5.</div><div style>Thanks,</div><div style>Jim</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Jan 15, 2013 at 4:43 PM, Hong Zhang <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jim :<br>
Can you switch to petsc-dev? MatMatMult()<br>
has been updated significantly in petsc-dev<br>
If you still see problem in petsc-dev, send us a short code that<br>
produce the error. We'll check it.<br>
<span class="HOEnZb"><font color="#888888"><br>
Hong<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> Hi,<br>
> We are in the process of upgrading from Petsc 3.2 to 3.3p5.<br>
><br>
> We are creating matrices A and B in this way.<br>
> petsc_matrix = new Mat;<br>
> ierr = MatCreateDense(comm, m, num_cols ,num_rows,num_cols,data,A);<br>
><br>
> Elsewhere, we have this. It gets called a few times, and on the 4th time,<br>
> the size of matrix is C is wrong. Please see the output below. What could be<br>
> the problem?<br>
> C = new Mat;<br>
> double fill = PETSC_DEFAULT;<br>
> MatMatMult(A,B,MAT_INITIAL_MATRIX, fill, C);<br>
> {<br>
> int m,n;<br>
> MatGetOwnershipRange(A, &m, &n);<br>
> cerr << "A.m = " << m << "\n";<br>
> cerr << "A.n = " << n << "\n";<br>
> MatGetSize(A,&m,&n);<br>
> cerr << "A global rows = " << m << "\n";<br>
> cerr << "A global cols = " << n << "\n";<br>
><br>
> MatGetOwnershipRange(B, &m, &n);<br>
> cerr << "B.m = " << m << "\n";<br>
> cerr << "B.n = " << n << "\n";<br>
> MatGetSize(B,&m,&n);<br>
> cerr << "B global rows = " << m << "\n";<br>
> cerr << "B global cols = " << n << "\n";<br>
><br>
> MatGetOwnershipRange(*C, &m, &n);<br>
> cerr << "C.m = " << m << "\n";<br>
> cerr << "C.n = " << n << "\n";<br>
><br>
> MatGetSize(*C,&m,&n);<br>
> cerr << "C global rows = " << m << "\n";<br>
> cerr << "C global cols = " << n << "\n";<br>
><br>
> }<br>
><br>
> A.m = 0<br>
> A.n = 59<br>
> A global rows = 59<br>
> A global cols = 320<br>
> B.m = 0<br>
> B.n = 320<br>
> B global rows = 320<br>
> B global cols = 320<br>
> C.m = 0<br>
> C.n = 59<br>
> C global rows = 59<br>
> C global cols = 320<br>
> A.m = 0<br>
> A.n = 59<br>
> A global rows = 59<br>
> A global cols = 320<br>
> B.m = 0<br>
> B.n = 320<br>
> B global rows = 320<br>
> B global cols = 59<br>
> C.m = 10922<br>
> C.n = -1389327096<br>
> C global rows = -1389327112<br>
> C global cols = -1389327112<br>
><br>
><br>
> Thanks,<br>
> Jim<br>
> --<br>
> Jim Fonseca, PhD<br>
> Research Scientist<br>
> Network for Computational Nanotechnology<br>
> Purdue University<br>
> 765-496-6495<br>
> <a href="http://www.jimfonseca.com" target="_blank">www.jimfonseca.com</a><br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jim Fonseca, PhD<div>Research Scientist</div><div>Network for Computational Nanotechnology</div><div>Purdue University</div><div>765-496-6495<br><div>
<a href="http://www.jimfonseca.com" target="_blank">www.jimfonseca.com</a></div><div><br><div><br></div></div></div>
</div>