<div dir="ltr"><div dir="ltr">On Wed, Jan 31, 2024 at 10:10 AM Alain O' Miniussi <<a href="mailto:alain.miniussi@oca.eu">alain.miniussi@oca.eu</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">Hi,<br>
<br>
It is indicated in:<br>
<a href="https://petsc.org/release/manualpages/Sys/PetscInitialize/" rel="noreferrer" target="_blank">https://petsc.org/release/manualpages/Sys/PetscInitialize/</a><br>
that the init function will call MPI_Init.<br>
<br>
What if MPI_Init was already called (as it is the case in my application) </blockquote><div><br></div><div>From the page: " PetscInitialize() calls MPI_Init() if that has yet to be called,". Also</div><div>"Note</div>If for some reason you must call MPI_Init() separately, call it before PetscInitialize()."<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">and what about MPI_Init_thread.<br></blockquote><div><br></div><div><a href="https://petsc.org/release/manualpages/Sys/PETSC_MPI_THREAD_REQUIRED/">https://petsc.org/release/manualpages/Sys/PETSC_MPI_THREAD_REQUIRED/</a><br></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">
Wouldn't it be more convenient to have a Petsc init function taking a already initialized communicator as argument ?<br></blockquote><div><br></div><div>Probably not.</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">
Also, that initialization seems to imply that it is not possible to have multiple instance of PETSc on different communicators. Is that the case ?<br></blockquote><div><br></div><div>No, this is possible. We have examples for this. You call MPI_init() yourself, set PETSC_COMM_WORLD to the communicator you want, and then call PetscInitialize(). See</div><div><br></div><div> <a href="https://petsc.org/release/manualpages/Sys/PETSC_COMM_WORLD/">https://petsc.org/release/manualpages/Sys/PETSC_COMM_WORLD/</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</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">
Thanks<br>
<br>
----<br>
Alain Miniussi<br>
DSI, Pôles Calcul et Genie Log.<br>
Observatoire de la Côte d'Azur<br>
Tél. : +33609650665<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>