From your code sample I guess you are using the C++ interface which I do not use so much. If you need full control in parallel of your vector entries the only proper way is to use the PETSc (and perhaps Trilinos?) backends (in conjunction with PETSc4py if you are using Python).
In Python, if you assemble a vector:
A = PETScVector()
assemble(a, tensor=A)
A_petsc = as_backend_type(A.vector())
Will give you a fully-fledged petsc4py Vec which you can do whatever you wish with. Something similar is possible in the C++ backend as well.