<div dir="ltr">I’m working with Fande on this and I would like to add a bit more. There are many circumstances where we aren’t working on COMM_WORLD at all (e.g. working on a sub-communicator) but PETSc was initialized using MPI_COMM_WORLD (think multi-level solves)… and we need to create arbitrarily many PETSc vecs/mats/solvers/preconditioners and solve. We definitely can’t rely on using PETSC_COMM_WORLD to avoid triggering duplication.<div><br></div><div>Can you explain why PETSc needs to duplicate the communicator so much?</div><div><br></div><div>Thanks for your help in tracking this down!</div><div><br></div><div>Derek</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 2, 2018 at 5:44 PM Kong, Fande <<a href="mailto:fande.kong@inl.gov">fande.kong@inl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Why we do not use user-level MPI communicators directly? What are potential risks here? <br><br><br></div>Fande,<br></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Apr 2, 2018 at 5:08 PM, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">PETSC_COMM_WORLD [via PetscCommDuplicate()] attempts to minimize calls to MPI_Comm_dup() - thus potentially avoiding such errors<br>
<br>
</blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mcs.anl.gov_petsc_petsc-2Dcurrent_docs_manualpages_Sys_PetscCommDuplicate.html&d=DwIBAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=DUUt3SRGI0_JgtNaS3udV68GRkgV4ts7XKfj2opmiCY&m=jgv7gpZ3K52d_FWMgkK9yEScbLA7pkrWydFuJnYflsU&s=_zpWRcyk3kHuEHoq02NDqYExnXIohXpNnjyabYnnDjU&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mcs.anl.gov_petsc_petsc-2Dcurrent_docs_manualpages_Sys_PetscCommDuplicate.html&d=DwIBAg&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=DUUt3SRGI0_JgtNaS3udV68GRkgV4ts7XKfj2opmiCY&m=jgv7gpZ3K52d_FWMgkK9yEScbLA7pkrWydFuJnYflsU&s=_zpWRcyk3kHuEHoq02NDqYExnXIohXpNnjyabYnnDjU&e=</a></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<div class="m_4751003220532036395HOEnZb"><div class="m_4751003220532036395h5"><br>
Satish<br>
<br>
On Mon, 2 Apr 2018, Kong, Fande wrote:<br>
<br>
> On Mon, Apr 2, 2018 at 4:23 PM, Satish Balay <<a href="mailto:balay@mcs.anl.gov" target="_blank">balay@mcs.anl.gov</a>> wrote:<br>
><br>
> > Does this 'standard test' use MPI_COMM_WORLD' to crate PETSc objects?<br>
> ><br>
> > If so - you could try changing to PETSC_COMM_WORLD<br>
> ><br>
><br>
><br>
> I do not think we are using PETSC_COMM_WORLD when creating PETSc objects.<br>
> Why we can not use MPI_COMM_WORLD?<br>
><br>
><br>
> Fande,<br>
><br>
><br>
> ><br>
> > Satish<br>
> ><br>
> ><br>
> > On Mon, 2 Apr 2018, Kong, Fande wrote:<br>
> ><br>
> > > Hi All,<br>
> > ><br>
> > > I am trying to upgrade PETSc from 3.7.6 to 3.8.3 for MOOSE and its<br>
> > > applications. I have a error message for a standard test:<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > *preconditioners/pbp.lots_of_variables: MPI had an<br>
> > > errorpreconditioners/pbp.lots_of_variables:<br>
> > > ------------------------------------------------<br>
> > preconditioners/pbp.lots_of_variables:<br>
> > > Other MPI error, error stack:preconditioners/pbp.lots_of_variables:<br>
> > > PMPI_Comm_dup(177)..................: MPI_Comm_dup(comm=0x84000001,<br>
> > > new_comm=0x97d1068) failedpreconditioners/pbp.lots_of_variables:<br>
> > > PMPI_Comm_dup(162)..................:<br>
> > > preconditioners/pbp.lots_of_variables:<br>
> > > MPIR_Comm_dup_impl(57)..............:<br>
> > > preconditioners/pbp.lots_of_variables:<br>
> > > MPIR_Comm_copy(739).................:<br>
> > > preconditioners/pbp.lots_of_variables:<br>
> > > MPIR_Get_contextid_sparse_group(614): Too many communicators (0/2048<br>
> > free<br>
> > > on this process; ignore_id=0)*<br>
> > ><br>
> > ><br>
> > > I did "git bisect', and the following commit introduces this issue:<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > *commit 49a781f5cee36db85e8d5b951eec29f10ac13593Author: Stefano Zampini<br>
> > > <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a> <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</a>>>Date: Sat Nov 5<br>
> > > 20:15:19 2016 +0300 PCHYPRE: use internal Mat of type MatHYPRE<br>
> > > hpmat already stores two HYPRE vectors*<br>
> > ><br>
> > > Before I debug line-by-line, anyone has a clue on this?<br>
> > ><br>
> > ><br>
> > > Fande,<br>
> > ><br>
> ><br>
> ><br>
><br>
<br>
</div></div></blockquote></div></div></blockquote></div>