[petsc-users] A qustion of PETSc

w_ang_temp w_ang_temp at 163.com
Tue May 22 09:19:05 CDT 2012


Hello Matt
    What you said that "I suspect that you do not understand that only part of a Vec is stored on each MPI process" may be the reason.And I have spent lots of time testing this,especially get results from Vec x (the result of Ax=b)to the main program variable.  And I will have a try again.
    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?
    Thanks.                                                  Jim




在 2012-05-22 19:33:10,"Matthew Knepley" <knepley at gmail.com> 写道:
On Tue, May 22, 2012 at 5:17 AM, w_ang_temp <w_ang_temp at 163.com> wrote:

Hello
     I am a beginner of PETSc.I find the petsc-users lists is very useful, however I do not know how to ask a question in it. So can you tell me? And below is what I want to ask.
    I am solving Ax=b with PETSc. And I only use it in a fortran subroutine to get x ,then the main function of my program use x to do other things. The question is that: when the process is 1(mpiexec -n 1),the result of my program is ok, but when the process is more than 1 the result is wrong.



"Wrong" is not an acceptable description. I suspect that you do not understand that only part of a Vec
is stored on each MPI process. First, get the book Using MPI, and then read the PETSc manual
section on vectors.


  Thanks,


     Matt
 
    So where could be wrong? Can you give me some hints on how I can debug? Thanks.
                                  Jim
--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120522/9c9c78de/attachment.html>


More information about the petsc-users mailing list