Jose,


I have been revisiting the issue of SLEPc/NEP for shell matrices T(lambda) and 
T'(lambda).

I am having problems running SLEPc/NEP with -nep_type nleigs.



I have compiled two versions of PETSc/SLEPc:



            petsc-arch-real / slepc-arch-real

            ./configure --with-cc=gcc-13 --with-cxx=g++-13 --with-fc=gfortran 
--COPTFLAGS='-O3 -fopenmp' --CXXOPTFLAGS='-O3 -fopenmp'

                        --FOPTFLAGS='-O3 -fopenmp' --with-debugging=1 
--with-logging=1 --with-scalar-type=real --with-precision=double

                        --download-fblaslapack --with-openmp --with-mpi=0





            petsc-arch-complex / slepc-arch-complex

            ./configure --with-cc=gcc-13 --with-cxx=g++-13 --with-fc=gfortran 
--COPTFLAGS='-O3 -fopenmp' --CXXOPTFLAGS='-O3 -fopenmp'

                        --FOPTFLAGS='-O3 -fopenmp' --with-debugging=1 
--with-logging=1 --with-scalar-type=complex --with-precision=double

                        --download-fblaslapack --with-openmp --with-mpi=0



I use gfortran on an Apple Mac Mini M1.  Both the PETSc and SLEPc versions are 
the latest development versions as of today (a6690fd8 and 267bd1cd, 
respectively).



I ran the ex54f90 test cases:



            %  main-arch-real -nep_type slp -nep_slp_ksp_type gmres 
-nep_slp_pc_type none

           %  main-arch-complex -nep_type slp -nep_slp_ksp_type gmres 
-nep_slp_pc_type none

           %  main-arch-real  -nep_type nleigs -rg_interval_endpoints 0.2,1.1 
-nep_nleigs_ksp_type gmres -nep_nleigs_pc_type none

           %  main-arch-complex -nep_type nleigs -rg_interval_endpoints 
0.2,1.1,-.1,.1 -nep_nleigs_ksp_type gmres -nep_nleigs_pc_type none



Both the slp cases ran as expected and gave the correct answer.

However, both the real and complex architectures failed for the nleigs case.



For the complex case, none of the callback functions appear to have been called.

For the real case, only the MatMult_A routine appears to be called, 100 times 
and returns each time, sweeping over lambda from 0.2 to 1.1.



Any suggestions would be welcome.



Best regards,

Kenneth Hall





On 10/18/23, 9:16 AM, "Jose E. Roman" <jro...@dsic.upv.es 
<mailto:jro...@dsic.upv.es>> wrote:





By the way, the MATOP_DESTROY stuff produced segmentation fault in some 
compilers (in gfortran it worked well). The reason was having the callback 
functions inside CONTAINS, that is why we have removed it and used regular 
subroutines instead.





Jose









> El 18 oct 2023, a las 15:11, Kenneth C Hall <kenneth.c.h...@duke.edu 
> <mailto:kenneth.c.h...@duke.edu>> escribió:

>

> Jose,

>

> Thank you. I have downloaded and will take a look. I will try the new example 
> and then implement in my actual problem. I will keep you posted as to my 
> results.

>

> Thank you and best regards,

> Kenneth

>

> From: Jose E. Roman <jro...@dsic.upv.es <mailto:jro...@dsic.upv.es>>

> Sent: Tuesday, October 17, 2023 2:31 PM

> To: Kenneth C Hall <kenneth.c.h...@duke.edu <mailto:kenneth.c.h...@duke.edu>>

> Cc: petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> 
> <petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov>>

> Subject: Re: [petsc-users] SLEPc/NEP for shell matrice T(lambda) and 
> T'(lambda)

>

> Kenneth,

>

> I have worked a bit more on your example and put it in SLEPc 
> https://urldefense.com/v3/__https://gitlab.com/slepc/slepc/-/merge_requests/596__;!!OToaGQ!oSqCpmczx5VDi5025aO5T3WqW-MwGnKUSzxKVkdyXTHo9vuxP4GYnDfMoYxavvWRAA0WdcwX3tiVaiXWT0dh2-o$
>  
> <https://urldefense.com/v3/__https://gitlab.com/slepc/slepc/-/merge_requests/596__;!!OToaGQ!oSqCpmczx5VDi5025aO5T3WqW-MwGnKUSzxKVkdyXTHo9vuxP4GYnDfMoYxavvWRAA0WdcwX3tiVaiXWT0dh2-o$>

> This version also has MATOP_DESTROY to avoid memory leaks.

>

> Thanks.

> Jose

>

>

> > El 12 oct 2023, a las 20:59, Kenneth C Hall <kenneth.c.h...@duke.edu 
> > <mailto:kenneth.c.h...@duke.edu>> escribió:

> >

> > Jose,

> >

> > Thanks very much for this. I will give it a try and let you know how it 
> > works.

> >

> > Best regards,

> > Kenneth

> >

> > From: Jose E. Roman <jro...@dsic.upv.es <mailto:jro...@dsic.upv.es>>

> > Date: Thursday, October 12, 2023 at 2:12 PM

> > To: Kenneth C Hall <kenneth.c.h...@duke.edu 
> > <mailto:kenneth.c.h...@duke.edu>>

> > Cc: petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov> 
> > <petsc-users@mcs.anl.gov <mailto:petsc-users@mcs.anl.gov>>

> > Subject: Re: [petsc-users] SLEPc/NEP for shell matrice T(lambda) and 
> > T'(lambda)

> >

> > I am attaching your example modified with the context stuff.

> >

> > With the PETSc branch that I indicated, now it works with NLEIGS, for 
> > instance:

> >

> > $ ./test_nep -nep_nleigs_ksp_type gmres -nep_nleigs_pc_type none 
> > -rg_interval_endpoints 0.2,1.1 -nep_target 0.8 -nep_nev 5 -n 400 
> > -nep_monitor -nep_view -nep_error_relative ::ascii_info_detail

> >

> > And also other solvers such as SLP:

> >

> > $ ./test_nep -nep_type slp -nep_slp_ksp_type gmres -nep_slp_pc_type none 
> > -nep_target 0.8 -nep_nev 5 -n 400 -nep_monitor -nep_error_relative 
> > ::ascii_info_detail

> >

> > I will clean the example code an add it as a SLEPc example.

> >

> > Regards,

> > Jose

> >

> >

> > > El 11 oct 2023, a las 17:27, Kenneth C Hall <kenneth.c.h...@duke.edu 
> > > <mailto:kenneth.c.h...@duke.edu>> escribió:

> > >

> > > Jose,

> > >

> > > Thanks very much for your help with this. Greatly appreciated. I will 
> > > look at the MR. Please let me know if you do get the Fortran example 
> > > working.

> > >

> > > Thanks, and best regards,

> > > Kenneth

> > >








% main-arch-real -nep_type slp -nep_slp_ksp_type gmres -nep_slp_pc_type none

Nonlinear eigenproblem with shell matrices, n = 400
 Number of converged approximate eigenpairs: 3

 Nonlinear eigensolve converged (3 eigenpairs) due to CONVERGED_TOL; iterations 
4
 ---------------------- --------------------
            k              ||T(k)x||/||kx||
 ---------------------- --------------------
        1.000000            1.68026e-10
        0.500000            7.90935e-10
        0.333333            7.26827e-10
 ---------------------- --------------------
% main-arch-complex -nep_type slp -nep_slp_ksp_type gmres -nep_slp_pc_type none

Nonlinear eigenproblem with shell matrices, n = 400
 Number of converged approximate eigenpairs: 3

 Nonlinear eigensolve converged (3 eigenpairs) due to CONVERGED_TOL; iterations 
4
 ---------------------- --------------------
            k              ||T(k)x||/||kx||
 ---------------------- --------------------
   1.000000+0.000000i       4.43573e-10
   0.500000-0.000000i       2.38586e-10
   0.333333-0.000000i       1.20929e-09
 ---------------------- --------------------
% main-arch-real -nep_type nleigs -rg_interval_endpoints 0.2,1.1 
-nep_nleigs_ksp_type gmres -nep_nleigs_pc_type none

Nonlinear eigenproblem with shell matrices, n = 400
[0]PETSC ERROR: 
------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to 
memory corruption
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and 
https://petsc.org/release/faq/
[0]PETSC ERROR: ---------------------  Stack Frames 
------------------------------------
[0]PETSC ERROR: The line numbers in the error traceback are not always exact.
[0]PETSC ERROR: #1 NEPNLEIGSAAAComputation() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:225
[0]PETSC ERROR: #2 NEPNLEIGSAAASingularities() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:337
[0]PETSC ERROR: #3 NEPNLEIGSLejaBagbyPoints() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:382
[0]PETSC ERROR: #4 NEPSetUp_NLEIGS() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:894
[0]PETSC ERROR: #5 NEPSetUp() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/interface/nepsetup.c:133
[0]PETSC ERROR: #6 NEPSolve() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/interface/nepsolve.c:85

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x103efdad3 in ???
#1  0x103efcb53 in ???
#2  0x1a50374a3 in ???
#3  0x1a501fedf in ???
#4  0x1a4f5a33f in ???
#5  0x10765af4b in ???
#6  0x105976dd7 in ???
#7  0x105976ee3 in ???
#8  0x1a50374a3 in ???
zsh: abort      main-arch-real -nep_type nleigs -rg_interval_endpoints 0.2,1.1  
gmres  non
% main-arch-complex -nep_type nleigs -rg_interval_endpoints 0.2,1.1,-.1,.1 
-nep_nleigs_ksp_type gmres -nep_nleigs_pc_type none

Nonlinear eigenproblem with shell matrices, n = 400
[0]PETSC ERROR: 
------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to 
memory corruption
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and 
https://petsc.org/release/faq/
[0]PETSC ERROR: ---------------------  Stack Frames 
------------------------------------
[0]PETSC ERROR: The line numbers in the error traceback are not always exact.
[0]PETSC ERROR: #1 RGComputeContour() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/sys/classes/rg/interface/rgbasic.c:558
[0]PETSC ERROR: #2 NEPNLEIGSLejaBagbyPoints() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:362
[0]PETSC ERROR: #3 NEPSetUp_NLEIGS() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/impls/nleigs/nleigs.c:894
[0]PETSC ERROR: #4 NEPSetUp() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/interface/nepsetup.c:133
[0]PETSC ERROR: #5 NEPSolve() at 
/Users/hall/Documents/Fortran_Codes/Packages/slepc-main-2/src/nep/interface/nepsolve.c:85

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x102c95ad3 in ???
#1  0x102c94b53 in ???
#2  0x1a50374a3 in ???
#3  0x1a501fedf in ???
#4  0x1a4f5a33f in ???
#5  0x1075099f7 in ???
#6  0x1055b54b7 in ???
#7  0x1055b55c3 in ???
#8  0x1a50374a3 in ???
#9  0x103696e1f in ???
zsh: abort      main-arch-complex -nep_type nleigs -rg_interval_endpoints 
0.2,1.1,-.1,.1  

Reply via email to