> On 31 Jan 2024, at 11:31 AM, Alain O' Miniussi <alain.miniu...@oca.eu> wrote:
> 
> Hi,
> 
> It is indicated in:
> https://petsc.org/release/manualpages/Sys/PetscInitialize/
> that the init function will call MPI_Init.
> 
> What if MPI_Init was already called (as it is the case in my application) and 
> what about MPI_Init_thread.

Then, MPI_Init() is not called, see the call to MPI_Initialized() in 
https://petsc.org/release/src/sys/objects/pinit.c.html#PetscInitialize.

> Wouldn't it be more convenient to have a Petsc init function taking a already 
> initialized communicator as argument ?
> 
> Also, that initialization seems to imply that it is not possible to have 
> multiple instance of PETSc on different communicators. Is that the case ?

No, you can initialize MPI yourself and then set PETSC_COMM_WORLD to whatever 
you need before calling PetscInitialize().

Thanks,
Pierre

> Thanks
> 
> ----
> Alain Miniussi
> DSI, Pôles Calcul et Genie Log.
> Observatoire de la Côte d'Azur
> Tél. : +33609650665

Reply via email to