<div>OK, Im not familiar with debugger (!!) but I will try to see something with valgrind... I thougth I have already checked the prototypes of all functions when upgrading with petsc-3.1.p8 and petsc-3.2.p5, but will do that again.</div>
<div> </div>
<div>Thanks anyway.</div>
<div>Best Regards.</div>
<div>John<br><br></div>
<div class="gmail_quote">Le 23 novembre 2011 17:44, Satish Balay <span dir="ltr"><<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>></span> a écrit :<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">> [1]PETSC ERROR: d_nnz cannot be less than 0: local row 78 value -750763693!<br><br>There is something wrong in your code. You'll have to verify the<br>
prototypes of all functions - with the petsc-3.2 documentation.<br><br>And valgrind is an easy way to pinpoint to the problem source. [also a<br>debugger should show you whats going wrong]<br>
<div>
<div></div>
<div class="h5"><br>Satish<br><br><br>On Wed, 23 Nov 2011, jean-frederic thebault wrote:<br><br>> Well, actually, when I call MatSetFromOption, with the right arguments, the<br>> whole simulation is running, but there are some PETSC-ERROR about nnz, and<br>
> when I comment the calling of MatSetFromOption, the simulation (program)<br>> stop at the first calculation. This time, I'm putting in this email the<br>> log-file with calling of MatSetFromOption (then with PETSC-ERROR on nnz)...<br>
><br>> Le 23 novembre 2011 17:17, Satish Balay <<a href="mailto:balay@mcs.anl.gov">balay@mcs.anl.gov</a>> a écrit :<br>><br>> > Since you get a SEGV - I would suggest running the code in the<br>> > debugger - to check where its crashing.<br>
> ><br>> > Also run with valgrind to see where problems start.. Mostlikely the<br>> > issues would be change in prototypes for PETSc functions - between<br>> > releases.<br>> ><br>> > Satish<br>
> ><br>> > On Wed, 23 Nov 2011, jean-frederic thebault wrote:<br>> ><br>> > > Thanks for your response.<br>> > ><br>> > > Sorry about that, to reduce the size of the log file, unfortunetly, I did<br>
> > > took out the bad lines... In the out.log I've put in this email, I've<br>> > make<br>> > > sure there are...<br>> > ><br>> > > Actually, I don't use MatSetOption, but MatSetFromOption instead.<br>
> > However,<br>> > > when I called MatSetFromOption, the PETSC_COMM_WORLD was missing. But<br>> > now,<br>> > > it's getting worse !! (as you could see in the out.log included in this<br>
> > > email).<br>> > ><br>> > > Le 23 novembre 2011 15:55, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>> a écrit :<br>> > ><br>> > > > On Wed, Nov 23, 2011 at 08:24, jean-frederic thebault <<br>
> > > > <a href="mailto:jean-frederic@thebault-net.com">jean-frederic@thebault-net.com</a>> wrote:<br>> > > ><br>> > > >> I'm wondering what's wrong in my code. I'm using PETSc to solve a<br>
> > linear<br>> > > >> system, and willing to use a multi-processor computer. 9 years ago, I<br>> > used<br>> > > >> petsc-2.1.3 with success. Few weeks ago, I've update petsc with the<br>
> > 3.1-p8<br>> > > >> version and made the necessary changes to work with. No problem. And<br>> > > >> recently, I've migrate to petsc-3.2-p5. Compilation is OK. But when I<br>> > do<br>
> > > >> simulation, now, I have some PETSC-ERROR in the log file, even using<br>> > only<br>> > > >> one processor (see the out.log file in this email).<br>> > > >><br>> > > ><br>
> > > > You are calling MatSetOption() with the wrong number of arguments. C<br>> > > > compilers tell you about this, but Fortran compilers do not.<br>> > > ><br>> > > ><br>
> > > ><br>> > <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetOption.html" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetOption.html</a><br>
> > > ><br>> > > ><br>> > > >> However, I think I defined MatMPI and VecMPI correctly, according to<br>> > the<br>> > > >> doc. The log file tell that something wrong with the nnz which should<br>
> > not<br>> > > >> be greater than row length (??).<br>> > > >><br>> > > ><br>> > > > The log you sent does not say anything about nnz. Fix the call to<br>> > > > MatSetOption().<br>
> > > ><br>> > > > And also, with the previous version of PETSc I've used, the were no<br>> > > >> problem using -pc_type bjacobi and -sub_pc_type sor, juste to solve<br>> > linear<br>
> > > >> system doing parallel computations and because SOR is not<br>> > parallelized. But<br>> > > >> now, when I use -pc_type bjacobi and -sub_pc_type sor, with 3 rank, I<br>> > > >> experiment some convergence problem during my simulation.<br>
> > > >><br>> > > ><br>> > > > These options should do the same thing they used to do. Make sure you<br>> > are<br>> > > > assembling correctly. If it's still confusing, run the old and new<br>
> > code with<br>> > > ><br>> > > > -ksp_monitor_true_residual -ksp_converged_reason -ksp_view -pc_type<br>> > > > bjacobi -sub_pc_type sor<br>> > > ><br>> > > > and send the output of both for us to look at.<br>
> > > ><br>> > > > Also note that you can use -pc_type sor even in parallel. There are<br>> > > > options for local iterations and full iterations.<br>> > > ><br>> > ><br>
> ><br>><br></div></div></blockquote></div><br>