<div dir="ltr"><div>I'm sending one with a bit less time.</div><div>I'm timing the functions also with std::chronos and for the case of 180 seconds the program runs out of memory (and crushes) before the PETSc log gets to be printed, so I know the time only from my function. Anyway, in every case, the times between std::chronos and the PETSc log match.</div><div><br></div><div>(The large times are in part "4b- Building offdiagonal part" or "Event Stage 5: Offdiag").</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie., 21 jun. 2019 a las 16:09, Zhang, Junchao (<<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 8:07 AM Ale Foggia <<a href="mailto:amfoggia@gmail.com" target="_blank">amfoggia@gmail.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Thanks both of you for your answers,<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">El jue., 20 jun. 2019 a las 22:20, Smith, Barry F. (<<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>>) escribió:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Note that this is a one time cost if the nonzero structure of the matrix stays the same. It will not happen in future MatAssemblies.<br>
<br>
> On Jun 20, 2019, at 3:16 PM, Zhang, Junchao via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
> <br>
> Those messages were used to build MatMult communication pattern for the matrix. They were not part of the matrix entries-passing you imagined, but indeed happened in MatAssemblyEnd. If you want to make sure processors do not set remote entries, you can use
MatSetOption(A,MAT_NO_OFF_PROC_ENTRIES,PETSC_TRUE), which will generate an error when an off-proc entry is set.<br>
</blockquote>
<div><br>
</div>
<div>I started being concerned about this when I saw that the assembly was taking a few hundreds of seconds in my code, like 180 seconds, which for me it's a considerable time. Do you think (or maybe you need more information to answer this) that this time
is "reasonable" for communicating the pattern for the matrix? I already checked that I'm not setting any remote entries.
<br>
</div>
</div>
</div>
</blockquote>
<div>It is not reasonable. Could you send log view of that test with 180 seconds MatAssembly?</div>
<div> <br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div class="gmail_quote">
<div></div>
<div>Also I see (in my code) that even if there are no messages being passed during MatAssemblyBegin, it is taking time and the "ratio" is very big.<br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> <br>
> --Junchao Zhang<br>
> <br>
> <br>
> On Thu, Jun 20, 2019 at 4:13 AM Ale Foggia via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:<br>
> Hello all!<br>
> <br>
> During the conference I showed you a problem happening during MatAssemblyEnd in a particular code that I have. Now, I tried the same with a simple code (a symmetric problem corresponding to the Laplacian operator in 1D, from the SLEPc Hands-On exercises).
As I understand (and please, correct me if I'm wrong), in this case the elements of the matrix are computed locally by each process so there should not be any communication during the assembly. However, in the log I get that there are messages being passed.
Also, the number of messages changes with the number of processes used and the size of the matrix. Could you please help me understand this?<br>
> <br>
> I attach the code I used and the log I get for a small problem.<br>
> <br>
> Cheers,<br>
> Ale<br>
> <br>
<br>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote></div>