On Wed, Jan 31, 2024 at 10:10 AM Alain O' Miniussi <[email protected]>
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)


>From the page: " PetscInitialize() calls MPI_Init() if that has yet to be
called,". Also
"Note
If for some reason you must call MPI_Init() separately, call it before
PetscInitialize()."


> and what about MPI_Init_thread.
>

https://petsc.org/release/manualpages/Sys/PETSC_MPI_THREAD_REQUIRED/


> Wouldn't it be more convenient to have a Petsc init function taking a
> already initialized communicator as argument ?
>

Probably not.


> 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, 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

  https://petsc.org/release/manualpages/Sys/PETSC_COMM_WORLD/

  Thanks,

      Matt

  Thanks,

     Matt


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


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>

Reply via email to