[petsc-users] how to use petsc4py with mpi subcommunicators?

Jed Brown jed at jedbrown.org
Tue Apr 11 21:40:45 CDT 2017


Rodrigo Felicio <Rodrigo.Felicio at iongeo.com> writes:

> I think they are linked to the same MPI, but I am not sure how to confirm that. Looking into mpi4py/mpi.cfg I see the expected mpicc. On petsc4py/lib/petsc.cfg points to the petsc install directory and in there on the configure.log file I see the same path for the same intel mpi compiler...
>
> I noticed that if I instead of
> petsc4py.init(comm=newcomm)
>
> using
> petsc4py.init()
>
> the works, but then PETSc.COMM_WORLD = MPI.COMM_WORLD
>
> Further searching on the web suggest you are right and that the error msg that I am getting points to mismatch between mpirun and linked libraries, but why does it only happens if trying to initiate petsc with petsc4py.init(comm=newcomm)?

If you don't load mpi4py then PETSc would be the only library directly
calling MPI, so all would be consistent.

Note that you can initialize PETSc on MPI_COMM_WORLD (the default) and
still create a subcommunicator for individual objects.  That is normally
recommended because the debugging and profiling tools can be more
accurate and produce cleaner output.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170411/7398414c/attachment.pgp>


More information about the petsc-users mailing list