<div dir="ltr"><div>Thanks Barry, for the quick reply,</div><div><br></div>I tried doing that once recently, not for this problem though, but it looks like the model i'm working on isn't optimized at all for memory leaks, and valgrind stopped with thousands of errors before reaching this part of the execution.<div><br></div><div>Is there maybe an alternative approach ? or it would be better to just get the model in better shape already ? </div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 10:53 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  Run with valgrind to find the exact location of the first memory corruption. <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html#<wbr>valgrind</a><br>
<div><div class="h5"><br>
> On Sep 23, 2016, at 12:47 PM, Manuel Valera <<a href="mailto:mvalera@mail.sdsu.edu">mvalera@mail.sdsu.edu</a>> wrote:<br>
><br>
> Hello all,<br>
><br>
> I'm trying to load my laplacian matrix into a fortran module, and i have implemented it and it works for the first iteration of laplacian solver, but when starts the second step the laplacian matrix object becomes corrupts and looks like it loses one of it's dimensions.<br>
><br>
> Can you help me understand whats happening?<br>
><br>
> The modules are attached, the error i get is the following, i bolded the lines where i detected corruption:<br>
><br>
>  ucmsSeamount Entering MAIN loop.<br>
>  RHS loaded, size:       213120 /      213120<br>
>  CSRMAt loaded, sizes:      213120 x      213120<br>
>    8.39198399     s<br>
>  solveP pass:           1      !Iteration number<br>
>  RHS loaded, size:       213120 /      213120<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: Invalid argument<br>
> [0]PETSC ERROR: Wrong type of object: Parameter # 1<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown<br>
> [0]PETSC ERROR: ./ucmsSeamount                                                                                                                                                                                                                                                  �J� on a arch-linux2-c-debug named valera-HP-xw4600-Workstation by valera Fri Sep 23 10:27:21 2016<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1<br>
> [0]PETSC ERROR: #1 MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/mat/interface/<wbr>matrix.c<br>
>  CSRMAt loaded, sizes:      213120 x           0<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: Invalid argument<br>
> [0]PETSC ERROR: Wrong type of object: Parameter # 2<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown<br>
> [0]PETSC ERROR: ./ucmsSeamount                                                                                                                                                                                                                                                  �J� on a arch-linux2-c-debug named valera-HP-xw4600-Workstation by valera Fri Sep 23 10:27:21 2016<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1<br>
> [0]PETSC ERROR: #2 KSPSetOperators() line 531 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/ksp/ksp/interface/<wbr>itcreate.c<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: Nonconforming object sizes<br>
> [0]PETSC ERROR: Preconditioner number of local rows -1 does not equal resulting vector number of rows 213120<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown<br>
> [0]PETSC ERROR: ./ucmsSeamount                                                                                                                                                                                                                                                  �J� on a arch-linux2-c-debug named valera-HP-xw4600-Workstation by valera Fri Sep 23 10:27:21 2016<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1<br>
> [0]PETSC ERROR: #3 PCApply() line 474 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/ksp/pc/interface/<wbr>precon.c<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------<wbr>------------------------------<wbr>--<br>
> [0]PETSC ERROR: Object is in wrong state<br>
> [0]PETSC ERROR: Mat object's type is not set: Argument # 1<br>
> [0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown<br>
> [0]PETSC ERROR: ./ucmsSeamount                                                                                                                                                                                                                                                  �J� on a arch-linux2-c-debug named valera-HP-xw4600-Workstation by valera Fri Sep 23 10:27:21 2016<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1<br>
> [0]PETSC ERROR: #4 MatGetFactorAvailable() line 4286 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/mat/interface/<wbr>matrix.c<br>
> [0]PETSC ERROR: #5 PCGetDefaultType_Private() line 28 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/ksp/pc/interface/<wbr>precon.c<br>
> [0]PETSC ERROR: #6 PCSetFromOptions() line 159 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/ksp/pc/interface/<wbr>pcset.c<br>
> [0]PETSC ERROR: #7 KSPSetFromOptions() line 400 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/ksp/ksp/interface/<wbr>itcl.c<br>
> application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0<br>
> [unset]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0<br>
><br>
</div></div>> <LoadPetscMatrix.f90><<wbr>SolvePetscLinear.f90><br>
<br>
</blockquote></div><br></div>