<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;font-size:14px;font-family:arial"><div>    Besides, I have a puzzle about the process (mpiexec -n 2).As you know,I only use PETSc in the subroutine(a function named PETSCSOLVE,may be taken as a tool function) and the main program call it for many times. So,where should I call "PetscInitialize" and "PetscFinalize",in the main program or in the subroutine PETSCSOLVE?<br>
    Thanks.                                                  Jim<br></div></div></blockquote><div><br></div><div>You should call PetscInitialize as soon as possible and PetscFinalize as late as possible.  Please read the PETSc user's guide and consult it before asking questions that are clearly answered in the manual.</div>
<div><br></div><div>-Aron</div></div></div>