- changed title to petsc4py applies own typemap for MPI_Comm
petsc4py applies own typemap for MPI_Comm
Issue #195
resolved
The below code illustrates the issues:
from dolfin import *
mesh = UnitSquareMesh(8, 8)
comm0 = mesh.mpi_comm()
print type(comm0)
comm1 = mpi_comm_world()
print type(comm1)
The output is:
<type 'petsc4py.PETSc.Comm'>
<class 'dolfin.cpp.common.MPI_Comm'>
The problems that DOLFIN function expecting a MPI_Comm throw and error if the type is petsc4py.PETSc.Comm
.
Comments (6)
-
reporter -
There are two easy ways we can fix this.
- Clear the greedy typemaps letting
MPI_Comm
just by a pointer stub. - Move the inclusion of
petscy4py.i
todolfin/swig/common/pre.i
instead ofdolfin/swig/la/pre.i
.
The latter will then turn all MPI_Comm objects into a a petsc4py object. It looks like both works. I vote for trying the latter and see if that just works. If so I think we then need a unit test for this functionality.
- Clear the greedy typemaps letting
-
reporter I don't have a good grip on all the ins and outs of this, so I'm happy to go with whatever you recommend.
-
I went with 2. So now basic attributes of the communicator can be accessed if DOLFIN is compiled with petsc4py.
-
- changed status to resolved
Fixed by: bda8fa2b0e0c1c4a6bfd30b74fd0b7b0b841cf2f
-
reporter - removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment