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

Gaetan Kenway gaetank at gmail.com
Wed Apr 12 11:04:00 CDT 2017


One other quick note:

Sometimes it appears that mpi4py for petsc4py do not always play nicely
together. I think you want to do the petsc4py import first and then the
mpi4py import. Then you can split the MPI.COMM_WORLD all you want and
create any petsc4py objects on them.  Or if that doesn't work, swap the
import order. If I recall correctly, you could get a warning on exit that
something in mpi4py wasn't cleaned up correctly.

Gaetan

On Wed, Apr 12, 2017 at 7:30 AM, Rodrigo Felicio <Rodrigo.Felicio at iongeo.com
> wrote:

> Thanks Jed and Gaetan.
> I will try that approach of splitting PETSc.COMM_WORLD,  but I still need
> to load mpi4py (probably after PETSc), because PETSc.Comm is very limited,
> i.e., it does not have the split function, for example. My goal is to be
> able to set different matrices and vectors for each subcommunicator, and I
> am guessing that I can create them using something like
> PETSc.Mat().createAij(comm=subcomm)
>
> Kind regards
> Rodrigo
>
> ________________________________
>
>
> This email and any files transmitted with it are confidential and are
> intended solely for the use of the individual or entity to whom they are
> addressed. If you are not the original recipient or the person responsible
> for delivering the email to the intended recipient, be advised that you
> have received this email in error, and that any use, dissemination,
> forwarding, printing, or copying of this email is strictly prohibited. If
> you received this email in error, please immediately notify the sender and
> delete the original.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170412/3aaa7a35/attachment.html>


More information about the petsc-users mailing list