Hi

I am a rookie to PETSc, and I am wondering about whether I should call
MPI_Barrier to explicitly synchronize processes between PETSc calls.
For example, a piece of code like below

  ierr = MatMult(A,x,Ax); CHKERRQ(ierr);
  ierr = VecWAXPY(r, neg_one, Ax, b);CHKERRQ(ierr);

Should I add MPI_Barrier inbetween MatMult call and VecWAXPY call ?

My guess is that it is unnecessary. However, I am not so confident in this
guess, for I don't have much experience on using PETSc.

Thanks in advance.

Cong Li

Reply via email to