[petsc-users] Loading Laplacian as Module

Barry Smith bsmith at mcs.anl.gov
Fri Sep 23 14:18:24 CDT 2016


   Ok, so the problem is not memory corruption. 

> 0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Invalid argument
> [0]PETSC ERROR: Wrong type of object: Parameter # 1
> [0]PETSC ERROR: #1 MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c

   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.

  Barry



> On Sep 23, 2016, at 2:07 PM, Manuel Valera <mvalera at mail.sdsu.edu> wrote:
> 
> Barry, that was awesome, all the valgrind error dissappeared after using the mpiexec from petsc folder, the more you know...
> 
> Anyway this is my output from valgrind running with those options:
> 
>  Last Update:  9/23/2016    12: 5:12
>  ucmsSeamount Entering MAIN loop.
>  RHS loaded, size:       213120 /      213120
>  CSRMAt loaded, sizes:      213120 x      213120
>    8.32709217     s
>  solveP pass:           1
>  RHS loaded, size:       213120 /      213120
>  CSRMAt loaded, sizes:      213120 x           0
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Invalid argument
> [0]PETSC ERROR: Wrong type of object: Parameter # 1
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown 
> [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
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> [0]PETSC ERROR: #1 MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Invalid argument
> [0]PETSC ERROR: Wrong type of object: Parameter # 2
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown 
> [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
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> [0]PETSC ERROR: #2 KSPSetOperators() line 531 in /home/valera/v5PETSc/petsc/petsc/src/ksp/ksp/interface/itcreate.c
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Nonconforming object sizes
> [0]PETSC ERROR: Preconditioner number of local rows -1 does not equal resulting vector number of rows 213120
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown 
> [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
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> [0]PETSC ERROR: #3 PCApply() line 474 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/precon.c
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: Object is in wrong state
> [0]PETSC ERROR: Mat object's type is not set: Argument # 1
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown 
> [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
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> [0]PETSC ERROR: #4 MatGetFactorAvailable() line 4286 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c
> [0]PETSC ERROR: #5 PCGetDefaultType_Private() line 28 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/precon.c
> [0]PETSC ERROR: #6 PCSetFromOptions() line 159 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/pcset.c
> [0]PETSC ERROR: #7 KSPSetFromOptions() line 400 in /home/valera/v5PETSc/petsc/petsc/src/ksp/ksp/interface/itcl.c
> application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
> [cli_0]: aborting job:
> application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
> 
> ===================================================================================
> =   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
> =   PID 6490 RUNNING AT valera-HP-xw4600-Workstation
> =   EXIT CODE: 73
> =   CLEANING UP REMAINING PROCESSES
> =   YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
> ===================================================================================
> ==6488== 
> ==6488== HEAP SUMMARY:
> ==6488==     in use at exit: 131,120 bytes in 2 blocks
> ==6488==   total heap usage: 1,224 allocs, 1,222 frees, 249,285 bytes allocated
> ==6488== 
> ==6488== LEAK SUMMARY:
> ==6488==    definitely lost: 0 bytes in 0 blocks
> ==6488==    indirectly lost: 0 bytes in 0 blocks
> ==6488==      possibly lost: 0 bytes in 0 blocks
> ==6488==    still reachable: 131,120 bytes in 2 blocks
> ==6488==         suppressed: 0 bytes in 0 blocks
> ==6488== Rerun with --leak-check=full to see details of leaked memory
> ==6488== 
> ==6488== For counts of detected and suppressed errors, rerun with: -v
> ==6488== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> 
> 
> On Fri, Sep 23, 2016 at 11:15 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> > On Sep 23, 2016, at 1:09 PM, Manuel Valera <mvalera at mail.sdsu.edu> wrote:
> >
> > Thanks Barry, for the quick reply,
> >
> > 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.
> 
>    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.
> 
>    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
> 
>    So run with valgrind and email use the output and we may have suggestions on the cause.
> 
>    Barry
> 
> 
> 
> >
> > Is there maybe an alternative approach ? or it would be better to just get the model in better shape already ?
> >
> > Thanks
> >
> > On Fri, Sep 23, 2016 at 10:53 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> >   Run with valgrind to find the exact location of the first memory corruption. http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
> >
> > > On Sep 23, 2016, at 12:47 PM, Manuel Valera <mvalera at mail.sdsu.edu> wrote:
> > >
> > > Hello all,
> > >
> > > 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.
> > >
> > > Can you help me understand whats happening?
> > >
> > > The modules are attached, the error i get is the following, i bolded the lines where i detected corruption:
> > >
> > >  ucmsSeamount Entering MAIN loop.
> > >  RHS loaded, size:       213120 /      213120
> > >  CSRMAt loaded, sizes:      213120 x      213120
> > >    8.39198399     s
> > >  solveP pass:           1      !Iteration number
> > >  RHS loaded, size:       213120 /      213120
> > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> > > [0]PETSC ERROR: Invalid argument
> > > [0]PETSC ERROR: Wrong type of object: Parameter # 1
> > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> > > [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
> > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> > > [0]PETSC ERROR: #1 MatGetSize() line 6295 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c
> > >  CSRMAt loaded, sizes:      213120 x           0
> > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> > > [0]PETSC ERROR: Invalid argument
> > > [0]PETSC ERROR: Wrong type of object: Parameter # 2
> > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> > > [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
> > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> > > [0]PETSC ERROR: #2 KSPSetOperators() line 531 in /home/valera/v5PETSc/petsc/petsc/src/ksp/ksp/interface/itcreate.c
> > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> > > [0]PETSC ERROR: Nonconforming object sizes
> > > [0]PETSC ERROR: Preconditioner number of local rows -1 does not equal resulting vector number of rows 213120
> > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> > > [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
> > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> > > [0]PETSC ERROR: #3 PCApply() line 474 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/precon.c
> > > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> > > [0]PETSC ERROR: Object is in wrong state
> > > [0]PETSC ERROR: Mat object's type is not set: Argument # 1
> > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> > > [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
> > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack=1 --download-mpich=1 --download-ml=1
> > > [0]PETSC ERROR: #4 MatGetFactorAvailable() line 4286 in /home/valera/v5PETSc/petsc/petsc/src/mat/interface/matrix.c
> > > [0]PETSC ERROR: #5 PCGetDefaultType_Private() line 28 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/precon.c
> > > [0]PETSC ERROR: #6 PCSetFromOptions() line 159 in /home/valera/v5PETSc/petsc/petsc/src/ksp/pc/interface/pcset.c
> > > [0]PETSC ERROR: #7 KSPSetFromOptions() line 400 in /home/valera/v5PETSc/petsc/petsc/src/ksp/ksp/interface/itcl.c
> > > application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
> > > [unset]: aborting job:
> > > application called MPI_Abort(MPI_COMM_WORLD, 73) - process 0
> > >
> > > <LoadPetscMatrix.f90><SolvePetscLinear.f90>
> >
> >
> 
> 



More information about the petsc-users mailing list