<div dir="ltr">Ok, i got this: <div><br></div><div><font face="monospace, monospace"> RHS loaded, size: 213120 / 213120</font><div><div><font face="monospace, monospace"> CSRMAt loaded, sizes: 213120 x 213120</font></div><div><font face="monospace, monospace"> 8.43036175 s</font></div><div><font face="monospace, monospace"> solveP pass: 1</font></div></div><div><div><font face="monospace, monospace"> RHS loaded, size: 213120 / 213120</font></div><div><font face="monospace, monospace">[0]PETSC ERROR: MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c Wrong type of object: Parameter # 1</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Program received signal SIGABRT: Process abort signal.</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Backtrace for this error:</font></div><div><font face="monospace, monospace">#0 0x7F2A35AEA777</font></div><div><font face="monospace, monospace">#1 0x7F2A35AEAD7E</font></div><div><font face="monospace, monospace">#2 0x7F2A34FC6CAF</font></div><div><font face="monospace, monospace">#3 0x7F2A34FC6C37</font></div><div><font face="monospace, monospace">#4 0x7F2A34FCA027</font></div><div><font face="monospace, monospace">#5 0x7F2A35F6F6AA</font></div><div><font face="monospace, monospace">#6 0x7F2A35F6A2EA</font></div><div><font face="monospace, monospace">#7 0x7F2A362E2FEF</font></div><div><font face="monospace, monospace">#8 0x7F2A36326681</font></div><div><font face="monospace, monospace">#9 0x799AFF in solvepetsclinear_ at SolvePetscLinear.f90:137 (discriminator 2)</font></div><div><font face="monospace, monospace">#10 0x798F6A in solvep_rhs_ at SolveP_Rhs.f90:284</font></div><div><font face="monospace, monospace">#11 0x80D028 in ucmsmain at ucmsMain.f90:472</font></div></div><div><font face="monospace, monospace"><br></font></div><div>.-.-.-.-.-.-.-.-</div><div><br></div><div>What is weird for me is why it loads everything as it should for the first timestep of the problem and then it breaks on the second one, shouldnt the matrix be loaded at modules and shared with all subroutines? also, shouldnt the matrix be locked after assembly_final was used ? that matrix call is Ap which is inside LoadPetscMatrix module, and it looks like its changed after the first timestep.</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 12:18 PM, 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>
Ok, so the problem is not memory corruption.<br>
<span class=""><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>
</span><span class="">> [0]PETSC ERROR: #1 MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/<wbr>petsc/src/mat/interface/<wbr>matrix.c<br>
<br>
</span> So it looks like the matrix has not been created yet in this call. You can run with -start_in_debugger noxterm and then type cont in the debugger and it should stop at this error so you can look at the mat object to see what its value is.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Sep 23, 2016, at 2:07 PM, Manuel Valera <<a href="mailto:mvalera@mail.sdsu.edu">mvalera@mail.sdsu.edu</a>> wrote:<br>
><br>
> Barry, that was awesome, all the valgrind error dissappeared after using the mpiexec from petsc folder, the more you know...<br>
><br>
> Anyway this is my output from valgrind running with those options:<br>
><br>
> Last Update: 9/23/2016 12: 5:12<br>
> ucmsSeamount Entering MAIN loop.<br>
> RHS loaded, size: 213120 / 213120<br>
> CSRMAt loaded, sizes: 213120 x 213120<br>
> 8.32709217 s<br>
> solveP pass: 1<br>
> RHS loaded, size: 213120 / 213120<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 # 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 12:05:03 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>
> [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 12:05:03 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 12:05:03 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 12:05:03 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>
> [cli_0]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0<br>
><br>
> ==============================<wbr>==============================<wbr>=======================<br>
> = BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES<br>
> = PID 6490 RUNNING AT valera-HP-xw4600-Workstation<br>
> = EXIT CODE: 73<br>
> = CLEANING UP REMAINING PROCESSES<br>
> = YOU CAN IGNORE THE BELOW CLEANUP MESSAGES<br>
> ==============================<wbr>==============================<wbr>=======================<br>
> ==6488==<br>
> ==6488== HEAP SUMMARY:<br>
> ==6488== in use at exit: 131,120 bytes in 2 blocks<br>
> ==6488== total heap usage: 1,224 allocs, 1,222 frees, 249,285 bytes allocated<br>
> ==6488==<br>
> ==6488== LEAK SUMMARY:<br>
> ==6488== definitely lost: 0 bytes in 0 blocks<br>
> ==6488== indirectly lost: 0 bytes in 0 blocks<br>
> ==6488== possibly lost: 0 bytes in 0 blocks<br>
> ==6488== still reachable: 131,120 bytes in 2 blocks<br>
> ==6488== suppressed: 0 bytes in 0 blocks<br>
> ==6488== Rerun with --leak-check=full to see details of leaked memory<br>
> ==6488==<br>
> ==6488== For counts of detected and suppressed errors, rerun with: -v<br>
> ==6488== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)<br>
><br>
><br>
> On Fri, Sep 23, 2016 at 11:15 AM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> > On Sep 23, 2016, at 1:09 PM, Manuel Valera <<a href="mailto:mvalera@mail.sdsu.edu">mvalera@mail.sdsu.edu</a>> wrote:<br>
> ><br>
> > Thanks Barry, for the quick reply,<br>
> ><br>
> > 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.<br>
><br>
> Some MPI implementations by default produce many meaningless valgrind messages. So make sure you ./configure PETSc with --download-mpich this version will not produce any meaningless valgrind messages about MPI.<br>
><br>
> You are not concerned with "memory leaks" in this exercise, only with using uninitialized memory or overwriting memory you should not overwrite. So you want valgrind arguments like -q --tool=memcheck --num-callers=20 --track-origins=yes you do not need --leak-check=yes<br>
><br>
> So run with valgrind and email use the output and we may have suggestions on the cause.<br>
><br>
> Barry<br>
><br>
><br>
><br>
> ><br>
> > Is there maybe an alternative approach ? or it would be better to just get the model in better shape already ?<br>
> ><br>
> > Thanks<br>
> ><br>
> > On Fri, Sep 23, 2016 at 10:53 AM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> ><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>
> ><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>
> > > <LoadPetscMatrix.f90><<wbr>SolvePetscLinear.f90><br>
> ><br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>