The current stable Docker image still does not have the fix stated in this issue.
The bug is that one needs to initialize a PETSCVector like
v = PETScVector(mpi_comm_self())
to make sure that a gather
call collects the components from different processors correctly.
I am now trying to implement this in C++. Simply running
auto v = std::make_shared<PETScVector>(mesh->mpi_comm());
other_vector->gather(*v, indices);
does not seem to work. Note that I am giving mesh->mpi_comm()
as an argument because I could not find anything like mpi_comm_self()
in C++ demos.
How should I initialize the vector so that it is gathered correctly?