<div dir="ltr">Dear Petsc Developers, <div><br></div><div>We are writing a pipelined CG with deep pipelines.    For this algorithm I need to </div><div>store   "pipe_l +1"  auxiliary variables  Z_Vec.    I create these vectors as follows:</div><div><br></div><div><div> Vec *Z_VEC;</div></div><div><div> ierr = KSPCreateVecs(ksp,pipe_l+1,&Z_VEC,0,NULL);CHKERRQ(ierr);</div></div><div><br></div><div><br></div><div>Then we have a loop of iterations.   However at some point I have to drop the last </div><div>the auxiliary vector and shift the remaining vectors one position, and replace the first vector with the result of a matvec. </div><div><br></div><div>This is in the current prototype implemented as </div><div><br></div><div>      for(int i = pipe_l;  i>0; i--){</div><div>        VecCopy( Z_VEC[i-1], Z_VEC[i] );</div><div>      }</div><div><br></div><div>      ierr = MatMult(A, Z_VEC[1], Z_VEC[0]);CHKERRQ(ierr);</div><div><br></div><div>It looks very inefficient to me to copy the vector, if we only want to shift the data. </div><div><br></div><div>Do you have examples code where this is done more efficiently?  Or is this already a good way to do it?</div><div>Do you have suggestions?  </div><div><br></div><div><br></div><div>Wim</div><div> </div><div><br></div><div><br></div></div>