<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>I see, but I am still puzzeled, why are the communicators different on different notes eventhough it is the same object.</div>
<div>
<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"> </div>
<div name="quoted-content">PETSc creates a duplicate of the communicator during object creation.<br/>
<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscCommDuplicate.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscCommDuplicate.html</a><br/>
<br/>
Jose<br/>
<br/>
<br/>
> El 22 abr 2020, a las 8:40, Marius Buerkle <mbuerkle@web.de> escribió:<br/>
><br/>
> Hi Dave,<br/>
><br/>
> I want to use it in Fortran if possible. But I tried both C and Fortran just to see if it works in general. I am using MPICH 3.3.2. I attached the MWE for C and Fortran with the output I get.<br/>
><br/>
> Marius<br/>
><br/>
><br/>
><br/>
><br/>
><br/>
> Hi,<br/>
><br/>
> What is PetscObjectGetComm expected to return?<br/>
><br/>
> As Patrick said, it returns the communicator associated with the petsc object.<br/>
><br/>
> 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.<br/>
><br/>
> 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?<br/>
><br/>
><br/>
> That said, is there a way to get the MPI communicator a matrix lives on?<br/>
><br/>
> You are using the correct function. There is a macro as well but it’s best to use the function.<br/>
><br/>
> Thanks,<br/>
> Dave<br/>
><br/>
><br/>
><br/>
><br/>
> Best,<br/>
> Marius<br/>
> <test_comm.tar.gz><br/>
</div>
</div>
</div>
</div></div></body></html>