<div dir="ltr"><div class="gmail_extra"><div><div>Thanks Jack, Barry and Matt.</div></div><div><br></div><div>I patched my PETSc 3.5.2 as follows, but I am not really sure that this is the correct way (for example, I see in MatSetValues_Elemental two calls to functions P2RO and RO2E for the computation of the local row index but I do not understand what is their purpose, nor if I should apply them also to rowInd[s]).</div><div><br></div><div>Thanks</div><div><br></div><div>======</div><div><div><br></div><div><div>diff --git a/petsc/src/mat/impls/elemental/matelem.cxx b/petsc/src/mat/impls/elemental/matelem.cxx</div><div>--- a/petsc/src/mat/impls/elemental/matelem.cxx</div><div>+++ b/petsc/src/mat/impls/elemental/matelem.cxx</div><div>@@ -772,6 +772,36 @@ static PetscErrorCode MatZeroEntries_Elemental(Mat A)</div><div> }</div><div> </div><div> #undef __FUNCT__</div><div>+#define __FUNCT__ "MatZeroRows_Elemental"</div><div>+PetscErrorCode MatZeroRows_Elemental(Mat AA,PetscInt N,const PetscInt rows[],PetscScalar diag,Vec /*x*/,Vec /*b*/)</div><div>+{</div><div>+ // TODO: consider also the optional arguments x and b.</div><div>+ Mat_Elemental * a( (Mat_Elemental*)AA->data );</div><div>+ elem::DistMatrix<PetscElemScalar> * A( a->emat );</div><div>+ </div><div>+ PetscFunctionBegin;</div><div>+ std::vector<PetscInt> rowInd(rows,rows+N);</div><div>+ const elem::Int localWidth( A->LocalWidth() );</div><div>+ for( elem::Int s(0); s < N; ++s )</div><div>+ {</div><div>+ const elem::Int row = rowInd[s];</div><div>+ if( A->IsLocalRow(row) )</div><div>+ {</div><div>+ const elem::Int iLoc(A->LocalRow(row));</div><div>+ for( elem::Int jLoc(0); jLoc < localWidth; ++jLoc )</div><div>+ {</div><div>+ const elem::Int j(A->GlobalCol(jLoc));</div><div>+ if( row == j )</div><div>+ A->SetLocal( iLoc, jLoc, diag );</div><div>+ else</div><div>+ A->SetLocal( iLoc, jLoc, 0. );</div><div>+ }</div><div>+ }</div><div>+ }</div><div>+ PetscFunctionReturn(0);</div><div>+}</div><div>+</div><div>+#undef __FUNCT__</div><div> #define __FUNCT__ "MatGetOwnershipIS_Elemental"</div><div> static PetscErrorCode MatGetOwnershipIS_Elemental(Mat A,IS *rows,IS *cols)</div><div> {</div><div>@@ -957,7 +987,7 @@ static struct _MatOps MatOps_Values = {</div><div> MatAssemblyEnd_Elemental,</div><div> 0, //MatSetOption_Elemental,</div><div> MatZeroEntries_Elemental,</div><div>-/*24*/ 0,</div><div>+/*24*/ MatZeroRows_Elemental,</div><div> MatLUFactorSymbolic_Elemental,</div><div> MatLUFactorNumeric_Elemental,</div><div> MatCholeskyFactorSymbolic_Elemental,</div></div><div><br></div><div>======<br></div></div><div dir="ltr"><br></div><div dir="ltr"><br></div>
<br><div class="gmail_quote">On Mon, Oct 27, 2014 at 11:00 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><br>
> On Oct 26, 2014, at 4:32 AM, Francesco Ballarin <<a href="mailto:francesco.ballarin@polimi.it" target="_blank">francesco.ballarin@polimi.it</a>> wrote:<br>
><br>
> Dear PETSc users,<br>
> I have a code for PETSc 3.3 in which the PLAPACK interface, now discontinued, was used. I am trying to update it to PETSc 3.5.2, using the Elemental interface.<br>
><br>
> I see that MatZeroRows is not implemented for MATELEMENTAL. What function should I use instead? Does it also support the version with optional arguments x and b?<br>
<br>
</div></div> Unfortunately due to Elemental’s complicated parallel storage of matrix entries we don’t have any routines to do this. (We don’t even have routines to generically set values INSERT_VALUES) on other processes. cc:ing Elemental’s author to see what he suggests.<br>
<br>
Barry<br>
<br>
><br>
> Thanks,<br>
> best regards,<br>
> Francesco<br>
<br>
</blockquote></div><br></div></div>