Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-09 Thread Patrick Alken
Jose,   Thank you so much for looking at my code and suggesting the VecScatterCreateToZero() idea. This has fixed the nan problem, and my eigenvectors are looking much better now. Best regards, Patrick On 9/9/22 01:21, Jose E. Roman wrote: First, I would suggest that you add preallocation

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-09 Thread Jose E. Roman
First, I would suggest that you add preallocation for SeqAIJ matrices, in this way you can run the program with 1 process: MatSeqAIJSetPreallocation(A, 0, d_nnz); MatSeqAIJSetPreallocation(B, 0, d_nnz); With 1 process, the output files are correct. But with more than one process the

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-09 Thread Patrick Alken
I have attached a minimal example, although it does have a dependency on the GSL library (sorry for this). The script mwe.sh shows how I am running the program with the various command line arguments. The program will write the computed eigenvectors to an output file called 'evec' in GNU

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-07 Thread Patrick Alken
It looks like my problem may be in using the older gcc 7.5.0 compiler. The nans seem to go away when I compile petsc/slepc and my code on a newer gcc 11.2 compiler. Also, the petsc/slepc "make check" tests have errors on gcc 7.5 which disappear on 11.2. On 9/7/22 01:20, Jose E. Roman wrote:

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-07 Thread Barry Smith
You can run with -fp_trap to have the program stop as soon as the first Nan or Inf appears, this can help track down why it is happening. In a debugger you can also set the debugger to trap on floating point exceptions (syntax is debugger dependent) to focus in on where it first happens.

Re: [petsc-users] [slepc] nan output for eigenvectors

2022-09-07 Thread Jose E. Roman
> El 7 sept 2022, a las 6:18, Patrick Alken > escribió: > > I sometimes get Nan output values in computed eigenvectors for the > generalized symmetric eigenvalue problem produced by slepc. Is this a known > issue, and is it related to the conditioning of the matrix pair (A,B)? Is > there

[petsc-users] [slepc] nan output for eigenvectors

2022-09-06 Thread Patrick Alken
I sometimes get Nan output values in computed eigenvectors for the generalized symmetric eigenvalue problem produced by slepc. Is this a known issue, and is it related to the conditioning of the matrix pair (A,B)? Is there some way to compute a "condition number" of the matrix pair ahead of time