- edited description
PETScVector::init should not take comm as an argument
This fails on two processes:
from dolfin import*
vec = PETScVector()
vec.init(mpi_comm_self(), 1)
assert vec.mpi_comm() == mpi_comm_self()
As a result PETScVector::gather
which uses init()
does not work properly. See, https://groups.google.com/forum/#!topic/fenics-support/C3uIwxMGhws, thanks Giorgos Grekas for reporting.
Moreoever the condition on y.mpi_comm()
here looks incorrect.
Comments (12)
-
reporter -
The bug is that
PETSc::init
shouldn't take a communicator. The underlying PETSc object is created in the constructor, and this is when the communicator is set.Use in the report is incorrect. Correct usage is:
from dolfin import * # create communicator vec = PETScVector(comm) vec.init(mpi_comm_self(), 1) # PETSc::init should be fixed to not require a communicator assert vec.mpi_comm() == mpi_comm_self()
-
reporter Ok. This check needs to be called in any case, not just when
!_y.empty()
, and fixed (dolfin::MPI::size(y.mpi_comm())
is incorrect.) -
reporter I'll fix gather now and keep
PETScVector::init
for later. -
reporter Fix for gather in https://bitbucket.org/fenics-project/dolfin/branch/jan/fix-petsc-vec-gather#diff. @garth-wells, can you overlook it?
-
reporter - changed title to PETScVector::init should not take comm as an argument
-
assigned issue to
-
reporter -
- changed status to resolved
Fix issue
#789.→ <<cset c0fdc4da7a0a>>
-
reporter - changed status to open
Forgotten call to
TpetraVector::init(comm, N)
here: https://bitbucket.org/fenics-project/dolfin/src/8373103148eb09b7f96b19e440215467447c4e9a/dolfin/la/TpetraVector.cpp?at=master&fileviewer=file-view-default#TpetraVector.cpp-44 -
I confess that it wasn't exactly forgotten. I don't have Trilinos installed, and the wrappers are in too poor shape for me to have had a go blind.
We need to have test coverage for the Trilinos backend, or remove it. @chris_richardson ?
-
I have made a fix in a branch. Maybe we can get a cutdown trilinos into bamboo.
-
- changed status to resolved
- Log in to comment