<div dir="ltr">Dear  Petsc-Dev, <div><br></div><div>Over the last few year we have contributed several pipelined Krylov solvers.  Such as KSPPIPECG and  most recently pipelined bicgstab (<span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px">pipebcgs). </span></div><div>These make use of asynchronous global reductions using VecDotBegin en VecDotEnd to overlap the calculation of a dot product with the matrix vector product. </div><div>Experiments by various authors show that these methods can offere better scaling in the extremely large system limit. </div><div><br></div><div>We are now trying to introduce Krylov methods with longer  pipelines.  Such that the dot-product can take multiple matrix vector products to complete. </div><div><br></div><div>Below is a scetch.  After the first SpMV we would like to start a VecDotBegin,  That would only complete 2 Spmv's, or more, later. </div><div>After each SpMV we would start such global reduction. </div><div><img src="cid:ii_j0mhvuy30_15afb9339eebcde9" width="562" height="196"></div><div><span style="font-size:12.8px">While trying to implement a length-l version of pipelined CG in PETSc, we ran across some trouble with the following type of construction </span></div><div><span style="font-size:12.8px">that are representative for the problem abouve.  Let R,U,V,W,X and Y  be KSP work vectors, and gamma, delta and psi are PetscScalar:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = VecDotBegin(R,U,&gamma); CHKERRQ(ierr);</span></div><div><br></div><div><span style="font-size:12.8px"> ierr = KSP_MatMult(ksp,Amat, ..., ... ); CHKERRQ(ierr);</span><br style="font-size:12.8px"></div><div><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = VecDotBegin(W,V,&delta); CHKERRQ(ierr);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = KSP_MatMult(ksp,Amat,M,N); CHKERRQ(ierr);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = VecDotEnd(R,U,&gamma); CHKERRQ(ierr);</span><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = VecDotBegin(X,Y,&psi); CHKERRQ(ierr);</span></div><div>.... <br></div><div><br><span style="font-size:12.8px"> ierr = VecDotEnd(W,V,&delta); CHKERRQ(ierr);</span><br style="font-size:12.8px"><span style="font-size:12.8px"> ierr = VecDotEnd(X,Y,&psi); CHKERRQ(ierr);</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Maybe this is a trivial remark, but it appears that it is not possible to put a new VecDotBegin (line 7) in between two VecDotEnd's (lines 6 and 8). Do you have any ideas on why this can't be done (is it intrinsic to VecDotBegin?), and whether a work-around for this issue is available?</span><br style="font-size:12.8px"><br>Are there other methods in Petsc  that we should use?   Or are the VecDotBegin and VecDotEnd not designed to be used in this way?<br><br style="font-size:12.8px"><span style="font-size:12.8px">Thanks a lot for the input,</span><br> ​   </div></div>