The PETSC function VecSwap after a few layers of abstraction calls the BLAS primitive swap, which  essentially copies data around (unless I am missing something).It seems to me that there should be a O(1) implementation that can be obtained just by exchanging pointers, at least if the vectors are identical in all their characteristics (underlying storage and distribution between the nodes).So, is there a way to swap vectors without a deep copy in PETSC?
Efficiently swap vectors in PETSC
parallel computing;petsc