differents Communicator MPI
Issue #1003
invalid
import dolfin
mesh = dolfin.UnitSquareMesh(10,10)
V = dolfin.FunctionSpace(mesh, dolfin.FiniteElement("Lagrange",mesh.ufl_cell(),1))
u = dolfin.Function(V)
print(V.mesh().mpi_comm() == dolfin.Function(V).vector().mpi_comm())
The last line is expected to be True, but it returns False. About the type , they are both mpi4py.MPI.Intracomm
There is another way to compare MPI communicators ?
Comments (4)
-
reporter -
reporter An idea to fix it:
-
modify MPI.h and MPI.cpp adding the operator==
-
modify python/MPIWrapper.h and cpp ?
-
modify pybind11 part on MPIWrapper.h ?
-
add unit test
When it occurs: in constructor of branch chris/petsc-matnest
-
-
- changed status to invalid
This isn't a bug. Objects create copies the communicator so that changes to a communicator in one place don't screw up an object elsewhere that is defined on it.
-
reporter I agree that the object that is defined is not broken. But the comparison between duplicate communicator by "==" produces wrong result. I could create an operator == in MPI.h and pull request as an improvement?
- Log in to comment
Using mpi4py and check the comparison of communicator, using compare i get the correct results.
However, every comparison in c++ in dolfin needs to replace by