<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>Just a quick comment re: users being incapable of using -start_in_debugger etc.: when I started using PETSc a couple of years ago, it was very surprising and strange to me that PETSc augmented my code such that it now accepted command line arguments.
It probably took me quite a few months to figure this out, it was simply unexpected. Perhaps it could be spelled out more clearly?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Åsmund</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="font-size:75%;color:#575757">Sent from my VT-102</div>
</div>
<br>
petsc-dev-request@mcs.anl.gov skrev:<br>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
Message: 1<br>
Date: Fri, 25 Apr 2014 10:27:30 -0500<br>
From: Barry Smith <bsmith@mcs.anl.gov><br>
To: For users of the development version of PETSc<br>
<petsc-dev@mcs.anl.gov><br>
Subject: [petsc-dev] debugging server<br>
Message-ID: <86BFDDD0-3C0D-45BE-AA93-264AE61C4280@mcs.anl.gov><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
<br>
Since PETSc users seem to have a great deal of difficulty using a debugger (even though they profile their code with debugging turned on) is there any way we could somehow host/manage/develop/something a debugging server that would automatically give back
information information about the process state on a crash? We have have -start_in_debugger and -on_error_attach_debugger but those seem beyond the capabilities of most users.<br>
<br>
When I started PETSc 2.0 I investigated having a "library interface? to the debugger so that PETSc library code itself could get stack frame information, variable values etc from the debugger but given the horrible horrible state of gdb source at that time
it was hopeless. Is there any system that is not hopeless, lldb? What about having an extra thread that ?talks? to the debugger on a crash, so the user doesn?t need to type bt, where, print variablename etc
<br>
<br>
Yes people should be comfortable with the basics of a debugger, but if they are not can we do something for them? (For example we keep stack traces manually to help users know where problems happen without using the debugger). Just seeing the full and accurate
stack trace after a segv would be a big step forward.<br>
<br>
Barry<br>
<br>
<br>
Begin forwarded message:<br>
<br>
> From: Matthew Knepley <knepley@gmail.com><br>
> Subject: Re: [petsc-users] Compiling program with program files dependencies (SLEPC )<br>
> Date: April 25, 2014 at 9:55:17 AM CDT<br>
> To: Steve Ndengue <steve.ndengue@gmail.com><br>
> Cc: petsc-users <petsc-users@mcs.anl.gov><br>
> <br>
> On Fri, Apr 25, 2014 at 9:45 AM, Steve Ndengue <steve.ndengue@gmail.com> wrote:<br>
> Dear all, <br>
> <br>
> Sorry, I had a typo: I was still editing the .f90 program file instead of the .F90 file.<br>
> <br>
> However, now I am having troubles forming the matrice I would like to diagonalize.<br>
> Presently the size is not yet huge and it could be held in a previously computed matrix of dimension N*N.<br>
> <br>
> I am using the following to build the matrix and the compiling from the example 1 and slightly modified:<br>
> <br>
> ***<br>
> !<br>
> CALL SlepcInitialize(PETSC_NULL_CHARACTER,ierr)<br>
> CALL MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr)<br>
> nn = N<br>
> ! CALL PetscOptionsGetInt(PETSC_NULL_CHARACTER,'-n',n,flg,ierr)<br>
> !<br>
> <br>
> !<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> ! Compute the operator matrix that defines the eigensystem, Ax=kx<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> <br>
> call MatCreate(PETSC_COMM_WORLD,A,ierr)<br>
> call MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,nn,nn,ierr)<br>
> call MatSetFromOptions(A,ierr)<br>
> call MatSetUp(A,ierr)<br>
> <br>
> call MatGetOwnershipRange(A,Istart,Iend,ierr)<br>
> do i=Istart,Iend-1<br>
> do j=0,nn-1<br>
> call MatSetValue(A,i,-1,j,-1,H_mat(i,j),INSERT_VALUES,ierr)<br>
> enddo<br>
> enddo<br>
> call MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY,ierr)<br>
> call MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY,ierr)! ** Create eigensolver context<br>
> CALL EPSCreate(PETSC_COMM_WORLD,solver,ierr)<br>
> ! ** Set operators. In this case, it is a standard eigenvalue problem<br>
> CALL EPSSetOperators(solver,A,PETSC_NULL_OBJECT,ierr)<br>
> print*,'here10,ierr',ierr<br>
> CALL EPSSetProblemType(solver,EPS_HEP,ierr)<br>
> ! ** Set working dimensions<br>
> CALL EPSSETDimensions(solver,nstates,10*nstates,2*nstates)<br>
> ! ** Set calculation of lowest eigenvalues<br>
> CALL EPSSetWhichEigenpairs(solver,EPS_SMALLEST_REAL)<br>
> <br>
> ! ** Set solver parameters at runtime<br>
> CALL EPSSetFromOptions(solver,ierr)<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> ! Solve the eigensystem<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> CALL EPSSolve(solver,ierr)<br>
> print*,'here6'<br>
> ! ** Optional: Get some information from the solver and display it<br>
> CALL EPSGetType(solver,tname,ierr)<br>
> if (rank .eq. 0) then<br>
> write(*,120) tname<br>
> endif<br>
> 120 format (' Solution method: ',A)<br>
> CALL EPSGetDimensions(solver,nstates,PETSC_NULL_INTEGER, &<br>
> & PETSC_NULL_INTEGER,ierr)<br>
> if (rank .eq. 0) then<br>
> write(*,130) nstates<br>
> endif<br>
> 130 format (' Number of requested eigenvalues:',I4)<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> ! Display solution and clean up<br>
> ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <br>
> CALL EPSPrintSolution(solver,PETSC_NULL_OBJECT,ierr)<br>
> CALL EPSDestroy(solver,ierr)<br>
> ***<br>
> <br>
> I get the following error message when making the code:<br>
> <br>
> Run in the debugger, -start_in_debugger, and get a stack trace for the error.<br>
> <br>
> Matt<br>
> <br>
> ***<br>
> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br>
> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>
> [0]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC" target="_BLANK">
http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC</a> ERROR: or try
<a href="http://valgrind.org" target="_BLANK">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors<br>
> [0]PETSC ERROR: likely location of problem given in stack below<br>
> [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------<br>
> [0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br>
> [0]PETSC ERROR: INSTEAD the line number of the start of the function<br>
> [0]PETSC ERROR: is given.<br>
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
> [0]PETSC ERROR: Signal received!<br>
> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: Petsc Release Version 3.4.4, Mar, 13, 2014 <br>
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>
> [0]PETSC ERROR: See docs/index.html for manual pages.<br>
> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: ./PgmPrincipal on a arch-linux2-c-debug named r10dawesr by ndengues Fri Apr 25 09:36:59 2014<br>
> [0]PETSC ERROR: Libraries linked from /usr/local/home/ndengues/Downloads/Libraries/petsc-3.4.4/arch-linux2-c-debug/lib<br>
> [0]PETSC ERROR: Configure run at Thu Apr 24 20:35:39 2014<br>
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran --download-f-blas-lapack --download-mpich<br>
> [0]PETSC ERROR: ------------------------------------------------------------------------<br>
> [0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file<br>
> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0<br>
> [cli_0]: aborting job:<br>
> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0<br>
> ***<br>
> <br>
> <br>
> <br>
> Once more, the program execute without troubles for all the examples in the package.<br>
> <br>
> Sincerely,<br>
> <br>
> <br>
> On 04/24/2014 10:14 PM, Satish Balay wrote:<br>
>> petsc examples work fine.<br>
>> <br>
>> send us the code that breaks. Also copy/paste the *complete* output from 'make' when<br>
>> you attempt to compile this code.<br>
>> <br>
>> Satish<br>
>> <br>
>> On Thu, 24 Apr 2014, Barry Smith wrote:<br>
>> <br>
>>> Try .F files instead of .F90 some Fortran compilers handle preprocessing in different ways for .F and .F90<br>
>>> <br>
>>> Please also send configure.log and make.log so we know what compilers etc you are using.<br>
>>> <br>
>>> Barry<br>
>>> <br>
>>> Note that we are using C pre processing directives, <br>
>>> <br>
>>> On Apr 24, 2014, at 7:57 PM, Steve Ndengue <steve.ndengue@gmail.com> wrote:<br>
>>> <br>
>>>> The results is the same with lower case letters...<br>
>>>> <br>
>>>> <br>
>>>> On 04/24/2014 07:39 PM, Matthew Knepley wrote:<br>
>>>>> On Thu, Apr 24, 2014 at 8:36 PM, Steve Ndengue <steve.ndengue@gmail.com> wrote:<br>
>>>>> Thank you for the quick reply.<br>
>>>>> <br>
>>>>> It partly solved the problem; the PETSC and SLEPC files are now included in the compilation.<br>
>>>>> <br>
>>>>> However the Warning are now error messages!<br>
>>>>> ***<br>
>>>>> pgm_hatom_offaxis_cyl.F90:880:0: error: invalid preprocessing directive #INCLUDE<br>
>>>>> pgm_hatom_offaxis_cyl.F90:887:0: error: invalid preprocessing directive #IF<br>
>>>>> pgm_hatom_offaxis_cyl.F90:890:0: error: invalid preprocessing directive #ELSE<br>
>>>>> pgm_hatom_offaxis_cyl.F90:893:0: error: invalid preprocessing directive #ENDIF<br>
>>>>> ***<br>
>>>>> <br>
>>>>> These should not be capitalized.<br>
>>>>> <br>
>>>>> Matt<br>
>>>>> <br>
>>>>> And the corresponding code lines are:<br>
>>>>> ***<br>
>>>>> #INCLUDE <finclude/slepcepsdef.h><br>
>>>>> USE slepceps<br>
>>>>> <br>
>>>>> !<br>
>>>>> IMPLICIT NONE<br>
>>>>> !----------------------<br>
>>>>> !<br>
>>>>> #IF DEFINED(PETSC_USE_FORTRAN_DATATYPES)<br>
>>>>> TYPE(Mat) A<br>
>>>>> TYPE(EPS) solver<br>
>>>>> #ELSE<br>
>>>>> Mat A<br>
>>>>> EPS solver<br>
>>>>> #ENDIF<br>
>>>>> ***<br>
>>>>> <br>
>>>>> Sincerely.<br>
>>>>> <br>
>>>>> On 04/24/2014 07:25 PM, Satish Balay wrote:<br>
>>>>>> On Thu, 24 Apr 2014, Steve Ndengue wrote:<br>
>>>>>> <br>
>>>>>> <br>
>>>>>>> Dear all,<br>
>>>>>>> <br>
>>>>>>> I am having trouble compiling a code with some dependencies that shall call<br>
>>>>>>> SLEPC.<br>
>>>>>>> The compilation however goes perfectly for the various tutorials and tests in<br>
>>>>>>> the package.<br>
>>>>>>> <br>
>>>>>>> A sample makefile looks like:<br>
>>>>>>> <br>
>>>>>>> ***<br>
>>>>>>> <br>
>>>>>>> /default: code//<br>
>>>>>>> //routines: Rout1.o Rout2.o Rout3.o Module1.o//<br>
>>>>>>> //code: PgmPrincipal//<br>
>>>>>>> //sources=Rout1.f Rout2.f Rout3.f Module1.f90//<br>
>>>>>>> <br>
>>>>>> Its best to rename your sourcefiles .F/.F90 [and not .f/.f90<br>
>>>>>> [this enables using default targets from petsc makefiles - and its<br>
>>>>>> the correct notation for preprocessing - which is required by petsc/slepc]<br>
>>>>>> <br>
>>>>>> <br>
>>>>>>> //objets=Rout1.o Rout2.o Rout3.o Module1.o Pgm//Principal//.o//<br>
>>>>>>> //<br>
>>>>>>> //%.o: %.f//<br>
>>>>>>> // -${FLINKER} -c $<//<br>
>>>>>>> <br>
>>>>>> And you shouldn't need to create the above .o.f target.<br>
>>>>>> <br>
>>>>>> Satish<br>
>>>>>> <br>
>>>>>> <br>
>>>>>> <br>
>>>>>>> //<br>
>>>>>>> //Module1_mod.mod Module1.o: //Module1//.f90//<br>
>>>>>>> // -${FLINKER} -c //Module1//.f90//<br>
>>>>>>> //<br>
>>>>>>> //include ${SLEPC_DIR}/conf/slepc_common//<br>
>>>>>>> //<br>
>>>>>>> //Pgm//Principal//: ${objets} chkopts//<br>
>>>>>>> // -${FLINKER} -o $@ ${objets} ${SLEPC_LIB}//<br>
>>>>>>> //<br>
>>>>>>> //.PHONY: clean//<br>
>>>>>>> // ${RM} *.o *.mod Pgm//Principal//<br>
>>>>>>> /<br>
>>>>>>> ***<br>
>>>>>>> <br>
>>>>>>> The code exits with Warning and error messages of the type:<br>
>>>>>>> <br>
>>>>>>> *Warning: Pgm**Principal**.f90:880: Illegal preprocessor directive**<br>
>>>>>>> **Warning: Pgm**Principal**.f90:889: Illegal preprocessor directive**<br>
>>>>>>> **Warning: Pgm**Principal**.f90:892: Illegal preprocessor directive**<br>
>>>>>>> **Warning: Pgm**Principal**.f90:895: Illegal preprocessor directive*<br>
>>>>>>> <br>
>>>>>>> and<br>
>>>>>>> <br>
>>>>>>> *USE slepceps**<br>
>>>>>>> ** 1**<br>
>>>>>>> **Fatal Error: Can't open module file 'slepceps.mod' for reading at (1): No<br>
>>>>>>> such file or directory<br>
>>>>>>> <br>
>>>>>>> <br>
>>>>>>> *I do not get these errors with the tests and errors files.<br>
>>>>>>> <br>
>>>>>>> <br>
>>>>>>> Sincerely,<br>
>>>>>>> <br>
>>>>>>> <br>
>>>>>>> <br>
>>>>> -- <br>
>>>>> Steve <br>
>>>>> <br>
>>>>> <br>
>>>>> <br>
>>>>> <br>
>>>>> -- <br>
>>>>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
>>>>> -- Norbert Wiener<br>
>>>> -- <br>
>>>> Steve <br>
>>>> <br>
>>>> <br>
>>>> <br>
> <br>
> <br>
> -- <br>
> Steve<br>
> <br>
> <br>
> <br>
> -- <br>
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
> -- Norbert Wiener<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140425/ccedf4f5/attachment-0001.html" target="_BLANK">http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20140425/ccedf4f5/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
petsc-dev mailing list<br>
petsc-dev@mcs.anl.gov<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/petsc-dev" target="_BLANK">https://lists.mcs.anl.gov/mailman/listinfo/petsc-dev</a><br>
<br>
<br>
End of petsc-dev Digest, Vol 64, Issue 36<br>
*****************************************<br>
</div>
</span></font>
</body>
</html>