I'm not sure now with MatDestroy/VecDestroy. Following snippet should
deadlock at two places but it does not. Possible explanations are at
least:
- Mat/VecDestroy do not communicate at all
- Mat/VecDestroy communicate using communnication which is
implemented as non-blocking; MPI-2 does not guarantee whether
collective communication (except barrier) is blocking or not
http://www.mpi-forum.org/docs/mpi-2.2/mpi22-report/node87.htm
- Mat/VecDestroy communicate using point-to-point non-blocking
communcation; (PETSc collective may not imply MPI collective
communication)
Jan
=============================================
from dolfin import *
comm = mpi_comm_world()
rank = MPI.rank(comm)
mesh = UnitSquareMesh(3, 3)
V = FunctionSpace(mesh, 'CG', 1)
u = TrialFunction(V)
v = TestFunction(V)
A = assemble(u*v*dx)
b = assemble(v*dx)
# Should deadlock if MatDestroy is collective
if rank==0:
as_backend_type(A).mat().destroy()
MPI.barrier(comm)
# Should deadlock if VecDestroy is collective
if rank==0:
as_backend_type(b).vec().destroy()
MPI.barrier(comm)
=============================================
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics