Typically you would use this, for which there are a few examples (at the bottom of the page).
http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatMatMult.html If that doesn't fix your problem, please set up a test case or at least give us verbose diagnostics. On Tue, Jan 8, 2013 at 8:26 AM, Johannes Huber <johannes.huber at unibas.ch>wrote: > Hi, > I have a valgrind "invalid read" in MatGetBrowsOfAoCols_MPIAIJ in the lines > rvalues = gen_from->values; /* holds the length of receiving row */ > svalues = gen_to->values; /* holds the length of sending row */ > (and others, but that are the first). This function is called indirectly > via MatMatMultSymbolic. > All invalid reads apear in MatGetBrowsOfAoCols_MPIAIJ. > The calling sequence for the matrix factors are > MatCreate(PETSC_COMM_WORLD,A); > MatSetSizes(A,NumLocRows,NumLocCols,PETSC_DETERMINE,PETSC_DETERMINE); > MatSetType(A,MATMPIAIJ); > MatMPIAIJSetPreallocation(A,PETSC_NULL,nnz,PETSC_NULL,onz); > MatSetValues(...); > MatAssemblyBegin(...) > MatAssemblyEnd(...) > and then a call to MatMatMultSymbolic. > I want the result matrix to be created. In the documentation I see, that > this happens, if I pass MAT_REUSE_MATRIX as scall, but how can I pass the > value, I don't the parameter. > Where can I find an example for MatMatMultSymbolic / MatMatMultNumeric? > Thanks, > Hannes > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130108/2406bd4e/attachment.html>
