<div dir="ltr"><div dir="ltr">On Wed, Dec 1, 2021 at 9:32 AM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
PETSc uses Elemental to perform such operations. <br>
<br>
PetscErrorCode MatMatMultNumeric_Elemental(Mat A,Mat B,Mat C)<br>
{<br>
Mat_Elemental *a = (Mat_Elemental*)A->data;<br>
Mat_Elemental *b = (Mat_Elemental*)B->data;<br>
Mat_Elemental *c = (Mat_Elemental*)C->data;<br>
PetscElemScalar one = 1,zero = 0;<br>
<br>
PetscFunctionBegin;<br>
{ /* Scoping so that constructor is called before pointer is returned */<br>
El::Gemm(El::NORMAL,El::NORMAL,one,*a->emat,*b->emat,zero,*c->emat);<br>
}<br>
C->assembled = PETSC_TRUE;<br>
PetscFunctionReturn(0);<br>
}<br>
<br>
<br>
You can consult Elemental's documentation and papers for how it manages the communication.<br></blockquote><div><br></div><div>Elemental uses all collective communication operations as a fundamental aspect of the design.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Barry<br>
<br>
<br>
> On Dec 1, 2021, at 8:33 AM, Hannes Brandt <<a href="mailto:Hannes_Brandt@gmx.de" target="_blank">Hannes_Brandt@gmx.de</a>> wrote:<br>
> <br>
> Hello,<br>
> <br>
> <br>
> I am interested in the communication scheme Petsc uses for the multiplication of dense, parallel distributed matrices in MatMatMult. Is it based on collective communication or on single calls to MPI_Send/Recv, and is it done in a blocking or a non-blocking way? How do you make sure that the processes do not receive/buffer too much data at the same time?<br>
> <br>
> <br>
> Best Regards,<br>
> <br>
> Hannes Brandt<br>
> <br>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>