Use MatGetOwnershipIS() and set only the entries in your owned rows and columns. What you're doing is nonscalable anyway because every process is filling the global matrix. If you want a cheap hack for small problems on small numbers of cores, you can run your insertion loop on only rank 0.
"Eric D. Robertson" <eric.robert...@cfdrc.com> writes: > I am trying to multiply two dense matrices using the Elemental interface. I > fill the matrix using MatSetValue( ) like below: > > for ( i = 0; i < Matrix.M; i++){ > for ( j = 0; j < Matrix.N; j++) { > PetscScalar temp = i + one + (j*three); > MatSetValue(Matrix.A, i, j, temp, INSERT_VALUES); > > } > } > > > However, I seem to get the following error: > > [0]PETSC ERROR: No support for this operation for this object type > [0]PETSC ERROR: Only ADD_VALUES to off-processor entry is supported > > But if I use ADD_VALUES, I get a different matrix depending on the number of > processors used. The entries become multiplied by the number of processors. > How do I reconcile this? > > > <redir.aspx?REF=hVEx-ekIltbV6NDJuYjzplTZG3ymEirNPcO9eR2dIGrvJzCyE4XTCAFtYWlsdG86ZXJpYy5yb2JlcnRzb25AY2ZkcmMuY29t>
signature.asc
Description: PGP signature