[petsc-users] Where to restrict MPI Communicator

Matthew Knepley knepley at gmail.com
Tue Feb 7 08:14:27 CST 2017


On Tue, Feb 7, 2017 at 8:06 AM, Florian Lindner <mailinglists at xgm.de> wrote:

> Hello,
>
> so far we have happily set PETSC_COMM_WORLD anywhere in our code and we
> were not having trouble with that.
>
> However http://www.mcs.anl.gov/petsc/petsc-current/docs/
> manualpages/Sys/PETSC_COMM_WORLD.html states that:
>
> "Notes: By default PETSC_COMM_WORLD and MPI_COMM_WORLD are identical
> unless you wish to run PETSc on ONLY a subset of
> MPI_COMM_WORLD. In that case create your new (smaller) communicator, call
> it, say comm, and set PETSC_COMM_WORLD = comm
> BEFORE calling PetscInitialize(), but after MPI_Init() has been called."
>
> So, you should never modify PETSC_COMM_WORLD after PetscInitialize has
> been called. Is that warning still in effect?
>

Yes.


> What other ways are to set the MPI comm used by PETSc. There is an comm
> argument on most (all?) functions like
> VecCreate, PetscViewer*Open, PetscRandomCreate, MatCreate). Is it
> sufficient to use that argument to supply an alternate
> communicator?
>

Yes.

  Thanks,

     Matt


> Thanks,
> Florian
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170207/bdf684de/attachment.html>


More information about the petsc-users mailing list