<div dir="ltr">Dear Petsc users,<br><br>I would like to confirm that the asynchronous calculation of the vector norm is faster than the synchronous calculation with the following code.<div><br><div><br></div><div><font color="#0000ff">PetscLogDouble tt1,tt2;    <br>     ierr = VecSet(c,one);<br> ierr = VecSet(u,one);<br> ierr = VecSet(b,one);<br><br>       ierr = KSPCreate(PETSC_COMM_WORLD,&ksp); CHKERRQ(ierr);<br>   ierr = KSP_MatMult(ksp,A,x,Ax); CHKERRQ(ierr);<br><br><br>ierr = PetscTime(&tt1);CHKERRQ(ierr);<br><br>       ierr = VecNormBegin(u,NORM_2,&norm1);<br>     ierr = PetscCommSplitReductionBegin(PetscObjectComm((PetscObject)Ax)); <br>       ierr = KSP_MatMult(ksp,A,c,Ac); <br>      ierr = VecNormEnd(u,NORM_2,&norm1);<br><br><br> ierr = PetscTime(&tt2);CHKERRQ(ierr);<br> ierr = PetscPrintf(PETSC_COMM_WORLD, "The time used for the asynchronous calculation: %f\n",tt2-tt1); CHKERRQ(ierr);<br>    ierr = PetscPrintf(PETSC_COMM_WORLD,"+ |u| =  %g\n",(double) norm1); CHKERRQ(ierr);<br><br><br> ierr = PetscTime(&tt1);CHKERRQ(ierr);<br>       ierr = VecNorm(b,NORM_2,&norm2); CHKERRQ(ierr);<br>   ierr = KSP_MatMult(ksp,A,c,Ac); <br><br><br>ierr = PetscTime(&tt2);CHKERRQ(ierr);<br>ierr = PetscPrintf(PETSC_COMM_WORLD, "The time used for the synchronous calculation: %f\n",tt2-tt1); CHKERRQ(ierr);<br>        ierr = PetscPrintf(PETSC_COMM_WORLD,"+ |b| =  %g\n",(double) norm2); CHKERRQ(ierr);<br></font></div><div><font color="#0000ff"><br></font></div><div><br></div><div>This code computes a matrix-vector product and a vector norm asynchronously and synchronously.<br><br>The calculation is carried out on a single node PC with a Xeon CPU.<br>The result of the code above shows that the synchronous calculation is faster than the asynchronous calculation. The MPI library is MPICH 3.3 and the parallel number is n = 20.<br><br><font color="#0000ff">The time used for the asynchronous calculation: 0.001622 <br>+ |u| =  100.<br>The time used for the synchronous calculation: 0.000062 <br>+ |b| =  100.</font><br><br><br>Is there anything I should consider in order to properly take advantage of the Petsc's asynchronous progress?<br></div></div><div><br></div><div>Thank you for any help you can provide.<br></div><div><span style="background-color:transparent">Sincerely, </span><br></div><div>Teiv.</div><div><br></div></div>