[petsc-users] PetscObjectGetComm

Dave May dave.mayhem23 at gmail.com
Wed Apr 22 01:20:59 CDT 2020


On Wed 22. Apr 2020 at 07:11, Marius Buerkle <mbuerkle at web.de> wrote:

> Hi,
>
> What is PetscObjectGetComm expected to return?


As Patrick said, it returns the communicator associated with the petsc
object.

I thought it would give the MPI communicator the object lives on. So if I
> create A matrix on PETSC_COMM_WORLD a call of PetscObjectGetComm for A it
> would return PETSC_COMM_WORLD? But it seems to return something else, and
> while most of the nodes return a similar communicator some are giving a
> different one.


How are you actually comparing the communicators (send code snippet)? Which
MPI implementation are you using? And when are comparing comms is the
comparison code written in C it FORTRAN?


That said, is there a way to get the MPI communicator a matrix lives on?


You are using the correct function. There is a macro as well but it’s best
to use the function.

Thanks,
Dave



>
> Best,
> Marius
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200422/0f2392dc/attachment.html>


More information about the petsc-users mailing list