Re: [petsc-users] petsc4py and PCMGGetSmoother

2024-05-28 Thread Jose E. Roman via petsc-users
It should be: smoother=pc. getMGSmoother(0) The general rule is to drop the class name and move "Get" or "Set" to the front (in small letters). But sometimes this does not hold. It is better that you check the source code, for instance do "git ZjQcmQRYFpfptBannerStart

Re: [petsc-users] [SLEPc] Best method to compute all eigenvalues of a MatShell

2024-05-13 Thread Jose E. Roman via petsc-users
Please respond to the list. The mpd parameter means "maximum projected dimension". You can think of the projected problem as the "sequential" part of the computation, that is not parallelized ("small" dense eigenproblem). When you run with ZjQcmQRYFpfptBannerStart This

Re: [petsc-users] [SLEPc] Best method to compute all eigenvalues of a MatShell

2024-05-13 Thread Jose E. Roman via petsc-users
Computing the full spectrum is always an unpleasant task. But if you cannot avoid it, I would suggest that you compute the eigenvalues in two runs: n/2 largest real eigenvalues and n/2 smallest real. If your matrix-vector product is cheap, ZjQcmQRYFpfptBannerStart This

Re: [petsc-users] Help with SLEPc eigenvectors convergence.

2024-03-07 Thread Jose E. Roman
7360, > 3769.78800, 3771.15894 > > > So is it intended to write these 2 warnings? > Anyway thanks a lot! :) > Eric > > On 2024-03-07 02:24, Jose E. Roman wrote: >> Pierre's diagnostic is right, but the suggested option is wrong: it should be -eps_target >

Re: [petsc-users] Help with SLEPc eigenvectors convergence.

2024-03-06 Thread Jose E. Roman
Pierre's diagnostic is right, but the suggested option is wrong: it should be -eps_target Also, I would suggest using a larger value, such as -eps_target 0. 1, otherwise the tolerance 1e-14 might not be attained. Jose > El 7 mar 2024, a las ZjQcmQRYFpfptBannerStart

Re: [petsc-users] ScaLAPACK EPS error

2024-01-19 Thread Jose E. Roman
> Sendt: 18. januar 2024 21:06 > Til: Jose E. Roman > Cc: petsc-users@mcs.anl.gov > Emne: Sv: [petsc-users] ScaLAPACK EPS error > I set up the matrix using MatCreateDense(), passing PETSC_DECIDE for the > local dimensions. > > The same error appears with 8, 12, and 1

Re: [petsc-users] ScaLAPACK EPS error

2024-01-18 Thread Jose E. Roman
How are you setting up your input matrix? Are you giving the local sizes or setting them to PETSC_DECIDE? Do you get the same error for different number of MPI processes? Can you send a small code reproducing the error? Jose > El 18 ene 2024, a las 18:59, Peder Jørgensgaard Olesen via

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

2023-12-21 Thread Jose E. Roman
The errors are strange. The traceback points to harmless operations. Likely memory corruption, as the message says. Those tests are included in SLEPc pipelines, they are run with serveral Linux distributions, with several compilers. Also, on my macOS it runs cleanly, although my configuration

Re: [petsc-users] Error handling in petsc4py

2023-11-27 Thread Jose E. Roman
The exception has been caught and the execution reaches the print() statement. I think you just need to disable the PETSc error handler, try with this: PETSc.Sys.pushErrorHandler("ignore") Jose > El 27 nov 2023, a las 16:41, Barry Smith escribió: > > > I see > > cdef extern from *

Re: [petsc-users] Copying PETSc Objects Across MPI Communicators

2023-10-28 Thread Jose E. Roman
Currently MATSCALAPACK does not support MatCreateSubMatrix(). I guess it would not be difficult to implement. Jose > El 27 oct 2023, a las 21:53, Damyn Chipman > escribió: > > Yeah, I’ll make an issue and use a modified version of this test routine. > > Does anything change if I will be

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

2023-10-17 Thread Jose E. Roman
; 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 > Date: Thursday, October 12, 2023 at 2:12 PM > To: Kenneth C Hall > Cc: petsc-users@mcs.anl.gov > Subject: Re: [petsc-users] SLEPc/NEP

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

2023-10-12 Thread Jose E. Roman
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

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

2023-10-11 Thread Jose E. Roman
gt; FORTRAN_MATOP_CREATE_VECS= 14, > FORTRAN_MATOP_GET_DIAGONAL_BLOCK = 15, > FORTRAN_MATOP_COPY = 16, > FORTRAN_MATOP_SCALE = 17, > FORTRAN_MATOP_SET_RANDOM = 18, > FORTRAN_MATOP_ASSEMBLY_BEGIN = 19, > FORTRAN_MATO

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

2023-10-06 Thread Jose E. Roman
I am getting an error in a different place than you. I started to debug, but don't have much time at the moment. Can you try something? Comparing to ex21.c, I see that a difference that may be relevant is the MATOP_DUPLICATE operation. Can you try defining it for your A matrix? Note: If you

Re: [petsc-users] Orthogonalization of a (sparse) PETSc matrix

2023-09-25 Thread Jose E. Roman
should now be able to do bv = SLEPc.BV().createFromMat(A)) instead of bv = SLEPc.BV().createFromMat(A.convert('dense')) without error or cost penalty. Thanks. Jose > El 30 ago 2023, a las 9:17, Jose E. Roman escribió: > > The conversion from MATAIJ to MATDENSE should be very c

Re: [petsc-users] Orthogonalization of a (sparse) PETSc matrix

2023-08-30 Thread Jose E. Roman
This works indeed. However, I was under the impression that this conversion > might be very costly for big matrices with low sparsity and it would scale > with the number of non-zero values. > > Do you have any idea of the efficiency of this operation? > > Thanks > >> O

Re: [petsc-users] Orthogonalization of a (sparse) PETSc matrix

2023-08-29 Thread Jose E. Roman
The result of bv.orthogonalize() is most probably a dense matrix, and the result replaces the input matrix, that's why the input matrix is required to be dense. You can simply do this: bv = SLEPc.BV().createFromMat(A.convert('dense')) Jose > El 29 ago 2023, a las 18:50, Thanasis

Re: [petsc-users] eigenvalue problem involving inverse of a matrix

2023-08-15 Thread Jose E. Roman
; > > > > > > > On Mon, Aug 14, 2023 at 1:20 PM maitri ksh wrote: > got it, thanks Pierre & Jose. > > On Mon, Aug 14, 2023 at 12:50 PM Jose E. Roman wrote: > See for instance ex3.c and ex9.c > https://slepc.upv.es/documentation/current/src/eps/tutor

Re: [petsc-users] eigenvalue problem involving inverse of a matrix

2023-08-14 Thread Jose E. Roman
See for instance ex3.c and ex9.c https://slepc.upv.es/documentation/current/src/eps/tutorials/index.html Jose > El 14 ago 2023, a las 10:45, Pierre Jolivet escribió: > > > >> On 14 Aug 2023, at 10:39 AM, maitri ksh wrote: >> >>  >> Hi, >> I need to solve an eigenvalue problem

Re: [petsc-users] New to using PETSc, running into issue

2023-07-19 Thread Jose E. Roman
You are mixing up KSPSetType() and KSPCGSetType(). KSPTCQMR can be passed as an argument of KSPSetType(), not KSPCGSetType(). The former has an argument of type KSPType, which is a string, while the latter has an argument of type KSPCGType, which is an enumerate. Jose > El 20 jul 2023, a las

Re: [petsc-users] Matrix-free generalised eigenvalue problem

2023-07-17 Thread Jose E. Roman
oid computing (or writing a shell > matrix about it) B^-1... But you seem to stress that there's no way > around it. > > Quentin > > > > On Mon, 17 Jul 2023 at 11:56, Jose E. Roman wrote: >> >> The B-inner product is independent of the ST operator. See T

Re: [petsc-users] Matrix-free generalised eigenvalue problem

2023-07-17 Thread Jose E. Roman
it up, but I'm > unsure which one allows for shell matrices. > > Thank you for your time, > > Quentin > > > On Wed, 12 Jul 2023 at 19:24, Jose E. Roman wrote: > > > > By default, it is solving the problem as B^{-1}*A*x=lambda*x (see chapter > > on Sp

Re: [petsc-users] Matrix-free generalised eigenvalue problem

2023-07-12 Thread Jose E. Roman
By default, it is solving the problem as B^{-1}*A*x=lambda*x (see chapter on Spectral Transformation). That is why A can be a shell matrix without problem. But B needs to be an explicit matrix in order to compute an LU factorization. If B is also a shell matrix then you should set an iterative

Re: [petsc-users] [SLEPc] With the increasing of processors, result change in 1e-5 and solving time increase. krylovschur for MATSBAIJ matrix's smallest eigenvalue

2023-07-12 Thread Jose E. Roman
The computed eigenvalue has 7 matching digits, which agrees with the used tolerance. If you want more matching digits you have to reduce the tolerance. The performance seems reasonable for up to 64 processes, so yes the problem may be too small for more processes. But performance depends also a

Re: [petsc-users] Is it necessary to call MatAssembly*() with MatSetValue()

2023-05-06 Thread Jose E. Roman
Fixed in https://gitlab.com/petsc/petsc/-/merge_requests/6423 Jose > El 6 may 2023, a las 9:16, gaochenyi14 escribió: > > Hi, > > By `find` and `grep`, I find that in many PETSc examples `MatAssembly*()` are > called after `MatSetValue()`. But in the C/Fortran API manual, the man page > of

Re: [petsc-users] Issue accessing SLEPc documentation

2023-04-11 Thread Jose E. Roman
I have fixed this a few minutes ago. Try again using the reload button of your browser. Jose > El 11 abr 2023, a las 15:49, 张治愚 escribió: > > Dear SLEPc support team, > > > I am a new user of SLEPc and I am having trouble accessing the online > documentation. When I try to access the link

Re: [petsc-users] help: use real and complex petsc together

2023-03-31 Thread Jose E. Roman
I don't know enough about dlopen to answer you question. Maybe other people can comment. My suggestion is that you do everything in complex scalars and avoid complications trying to mix real and complex. Regarding the second question, if I am not wrong PetscInitialize/PetscFinalize can be

Re: [petsc-users] Restarting a SLEPC run to refine an eigenvector

2023-03-29 Thread Jose E. Roman
> El 29 mar 2023, a las 9:58, LUTSKO James escribió: > > I withdraw my question. In trying to put together an example to illustrate > the problem, I found thatEPSSetInitialSubspace() does indeed "work" - in the > sense that the eigenvalue, which decreases monotonically during the >

Re: [petsc-users] Restarting a SLEPC run to refine an eigenvector

2023-03-28 Thread Jose E. Roman
What do you mean that EPSSetInitialSubspace() does not work? Doesn't it improve convergence with respect to not using it? Is your smallest eigenvalue positive? And do you have many eigenvalues close to the smallest one? Jose > El 28 mar 2023, a las 17:32, LUTSKO James via petsc-users >

Re: [petsc-users] SLEPc: GPU accelerated shift-invert

2023-03-18 Thread Jose E. Roman
When using an aijcusparse matrix by default it will select the cusparse solver, i.e., as if you have added the option -st_pc_factor_mat_solver_type cusparse The problem is that CUSPARSE does not have functionality for computing the LU factorization on the GPU, as far as I know. So what PETSc

Re: [petsc-users] Does petsc4py support matrix-free iterative solvers?

2023-03-14 Thread Jose E. Roman
reply. >> >> Eric >> >>> On Mar 13, 2023, at 08:10, Jose E. Roman wrote: >>> >>> Both ode/vanderpol.py and poisson2d/poisson2d.py use shell matrices via a >>> mult(self,mat,X,Y) function defined in the python side. Another example is >&g

Re: [petsc-users] Does petsc4py support matrix-free iterative solvers?

2023-03-13 Thread Jose E. Roman
Both ode/vanderpol.py and poisson2d/poisson2d.py use shell matrices via a mult(self,mat,X,Y) function defined in the python side. Another example is ex3.py in slepc4py. Jose > El 13 mar 2023, a las 15:58, Eric Hester via petsc-users > escribió: > > Hello everyone, > > Does petsc4py

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Jose E. Roman
The matrix can be a shell matrix, only the matrix-vector product operation is required. Jose > El 30 ene 2023, a las 22:23, Guglielmo, Tyler Hardy via petsc-users > escribió: > > I have an implementation of the slepc MFN matrix exponential which is > implicitly using ExpoKit. You have to

Re: [petsc-users] MUMPS icntl for petsc4py

2023-01-23 Thread Jose E. Roman
tin Chevalier > escribió: > > Many thanks Jose, it works beautifully ! > > I'm at a loss as to why, but thanks for the quick fix ! > > Quentin > > > > Quentin CHEVALIER – IA parcours recherche > > LadHyX - Ecole polytechnique > > __ >

Re: [petsc-users] MUMPS icntl for petsc4py

2023-01-22 Thread Jose E. Roman
You have to call ST.getOperator() as is done in this C example: https://slepc.upv.es/documentation/current/src/eps/tutorials/ex43.c.html Jose > El 22 ene 2023, a las 10:40, Quentin Chevalier > escribió: > > Hello PETSc users, > > I'm getting an INFOG(1)=-9 and INFO(2)=27 error on an

Re: [petsc-users] error when trying to compile with HPDDM

2023-01-06 Thread Jose E. Roman
This happens because you have typed 'make -j128'. If you just do 'make', PETSc will choose a reasonable value (-j59 in your case). Satish: do we want to support this use case? Then a possible fix is: diff --git a/config/BuildSystem/config/packages/slepc.py

Re: [petsc-users] Using slepc MFN

2022-12-15 Thread Jose E. Roman
You don't need to destroy the solver object, it should be sufficient to just call MFNSetOperator() with the new matrix. Jose > El 15 dic 2022, a las 21:56, Guglielmo, Tyler Hardy via petsc-users > escribió: > > Not sure if there are many slepc users here, but I have a question regarding >

Re: [petsc-users] Action of inverse of Cholesky factors in parallel

2022-12-05 Thread Jose E. Roman
gt; > Doing this trick gives for the above example: > tilde f(y) := f(L^-T y) = 1/2 y^T L^{-1} (M + S) L^{-T} y = 1/2 y^T y > and gradient descent in y with step size 1 yields y_1 = y_0 - y_0 = 0. > Therefore, also x_1 = L^{-T} y_1 = 0 (i.e., convergence in 1 iteration). > > Johannes &

Re: [petsc-users] Action of inverse of Cholesky factors in parallel

2022-12-02 Thread Jose E. Roman
As far as I know, the solveForward/Backward operations are not implemented for external packages. What are you trying to do? One may be tempted to use the Cholesky decomposition to transform a symmetric-definite generalized eigenvalue problem into a standard eigenvalue problem, as is done e.g.

Re: [petsc-users] About MatMumpsSetIcntl function

2022-11-29 Thread Jose E. Roman
You have to call PCFactorGetMatrix() first. See any of the examples that use MatMumpsSetIcntl(), for instance https://petsc.org/release/src/ksp/ksp/tutorials/ex52.c.html Jose > El 30 nov 2022, a las 6:52, 김성익 escribió: > > Hello, > > > I tried to adopt METIS option in MUMPS by using > '

Re: [petsc-users] Initializing a large sparse matrix

2022-10-17 Thread Jose E. Roman
r an 8x8 matrix on 3 cpu > X * * > * X * > * * X > > On Mon, Oct 17, 2022 at 9:02 AM Jose E. Roman wrote: > You have to preallocate, see > https://petsc.org/release/docs/manual/mat/#sec-matsparse > > > El 17 oct 2022, a las 8:37, fujisan escribió: > > > &

Re: [petsc-users] Initializing a large sparse matrix

2022-10-17 Thread Jose E. Roman
You have to preallocate, see https://petsc.org/release/docs/manual/mat/#sec-matsparse > El 17 oct 2022, a las 8:37, fujisan escribió: > > Hi everyone, > > I initialize a large sparse matrix (5x2) using MatCreate() and then > filling it with MatSetValues() line by line > but it takes

Re: [petsc-users] Slepc, shell matrix, parallel, halo exchange

2022-10-10 Thread Jose E. Roman
mal. If you want to get the same convergence history, use a constant initial vector set via EPSSetInitialSpace(), or alternatively use the undocumented option -bv_reproducible_random Jose > > Thanks, > Feng > From: Matthew Knepley > Sent: 09 October 2022 12:11 > To: feng wan

Re: [petsc-users] Differences between main and release branches?

2022-10-03 Thread Jose E. Roman
'main' is the development version, 'release' is the latest release version. You can select the branch when cloning or later with git checkout. See https://petsc.org/release/install/download/#recommended-download Jose > El 3 oct 2022, a las 11:08, fujisan escribió: > > Hi everyone, > What are

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Jose E. Roman
he option --download-suitesparse. > > The error is more like this: > PETSC ERROR: Could not locate a solver type for factorization type QR and > matrix type mpiaij. > > Fuji > > On Mon, Sep 26, 2022 at 10:25 AM Jose E. Roman wrote: > If the error messag

Re: [petsc-users] Problem solving Ax=b with rectangular matrix A

2022-09-26 Thread Jose E. Roman
If the error message is "Could not locate a solver type for factorization type QR" then you should configure PETSc with --download-suitesparse Jose > El 26 sept 2022, a las 9:06, fujisan escribió: > > Thank you Pierre, > > I used PCNONE along with KSPLSQR and it worked. > But as for PCQR,

Re: [petsc-users] Slepc, shell matrix, parallel, halo exchange

2022-09-21 Thread Jose E. Roman
rwards? Eigenvectors are stored in parallel vectors, which are used in subsequent parallel computation in most applications. If for some reason you need to gather them in a single MPI process you can use e.g. VecScatterCreateToZero() > > Thanks, > Feng > > From: Jose E. Ro

Re: [petsc-users] Slepc, shell matrix, parallel, halo exchange

2022-09-21 Thread Jose E. Roman
rwards? Eigenvectors are stored in parallel vectors, which are used in subsequent parallel computation in most applications. If for some reason you need to gather them in a single MPI process you can use e.g. VecScatterCreateToZero() > > Thanks, > Feng > > From: Jose E. Ro

Re: [petsc-users] Slepc, shell matrix, parallel, halo exchange

2022-09-21 Thread Jose E. Roman
If you define the MATOP_CREATE_VECS operation in your shell matrix so that it creates a ghost vector, then all vectors within EPS will be ghost vectors, including those that are received as arguments of MatMult(). Not sure if this will work. A simpler solution is that you store a ghost vector

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

2022-09-09 Thread Jose E. Roman
nd the eigenvector values are all > between about -0.01 and +0.01. On this system, the petsc/slepc 'make check' > tests pass. > > At first I thought it was a compiler bug in the old GCC 7.5 version, but 10.2 > also seems to have the same problem. I need to do more testing with 11.2.

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

Re: [petsc-users] compile warnings

2022-09-02 Thread Jose E. Roman
Set this in your environment: export MACOSX_DEPLOYMENT_TARGET=11.6 Jose > El 2 sept 2022, a las 7:50, Yuyun Yang escribió: > > Hello team, > > I recently reconfigured PETSc on my Mac terminal, and running makefile gives > me the following warnings. Will these affect running the code, and how

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-25 Thread Jose E. Roman
e in the shell matrix. It simply computes the > non-linear residuals twice with perturbed flow variables. I have attached my > code. Any suggestions are welcome. > > Thanks, > Feng > From: Jose E. Roman > Sent: 25 August 2022 9:45 > To: feng wang > Cc: petsc-users &g

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-25 Thread Jose E. Roman
||Ax-kx||/||kx|| > -- >0.03+0.02i 7.90447e-09 >0.03-0.02i 7.90447e-09 > -- > > If I use the shell matrix directly, the relative norm is still large. This > really

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-25 Thread Jose E. Roman
vert(slepc_A_mf,MATDENSE,MAT_INITIAL_MATRIX,)); and > If I do MatView(Adense,viewer), All I see was NAN. Have I missed anything > here? > > Thanks, > Feng > > From: Jose E. Roman > Sent: 24 August 2022 16:23 > To: feng wang > Cc: petsc-users > Subject: Re: [petsc-users]

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-24 Thread Jose E. Roman
of slepc. I can set -eps_tol > to a low value, but the final relative residual norm is still high , what > does this tell me? I don't know. It should not happen. Jose > > Best regards, > Feng > > From: Jose E. Roman > Sent: 23 August 2022 11:06 > To: feng wa

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-23 Thread Jose E. Roman
with finite volume method and > trying to do a global stability analysis by looking at the Jacobian matrix. > > Thanks, > Feng > > From: Jose E. Roman > Sent: 23 August 2022 10:32 > To: feng wang > Cc: petsc-users > Subject: Re: [petsc-users] Slepc Question, shell-m

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-23 Thread Jose E. Roman
00161+0.22i 0.0773339 > -0.000161-0.22i 0.0774536 > -- > > The values in the brackets are the absolute error (I believe) and they seem > very low. The relative error seems quite large. Could you please comment on > this? > > > B

Re: [petsc-users] [Slepc] eigensolver not running in parallel

2022-08-22 Thread Jose E. Roman
Which version of SLEPc are you using? You should get an error unless you have configure PETSc with a parallel direct linear solver. Which option did you use to configure PETSc? Send the output when using the option -eps_view_pre Jose > El 23 ago 2022, a las 2:11, Patrick Alken > escribió:

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-22 Thread Jose E. Roman
of code to compute the right hand side. so it produces a NAN when it > tries to compute the matrix-vector product. > > Many thanks for your help! > > Best regards, > Feng > From: Jose E. Roman > Sent: 22 August 2022 19:32 > To: feng wang > Cc: petsc-users@mcs.anl.

Re: [petsc-users] Slepc Question, shell-matrix

2022-08-22 Thread Jose E. Roman
This is very strange. This error appears when the solver employs the B-inner product, but in your case you don't have a B matrix, so you should never see that error. Try running under valgrind to see if it gives more hints. Jose > El 22 ago 2022, a las 20:45, feng wang escribió: > > Hello,

Re: [petsc-users] [SLEPc] generalized symmetric eigensystem

2022-08-05 Thread Jose E. Roman
You are setting the matrix values in the lower triangular part only. You are assuming that SLEPc uses the same storage as LAPACK, but this is not true. EPSSolve() does not work correctly because you are specifying a symmetric problem EPS_GHEP but your matrices are not symmetric. You should set

Re: [petsc-users] Solution of normal equations

2022-07-19 Thread Jose E. Roman
I guess you could try LSQR on the matrix M=[ sqrt(D); sqrt(R)*J ], given that M'*M=D+J'*R*J. This will attempt to solve a least squares system with coefficient matrix M, without forming the ill-conditioned M'*M. But the question is how to update your right-hand-side vector so that it solves the

Re: [petsc-users] SLEPc EPSGD: Can not converge, error estimation floats over 1e-6

2022-07-13 Thread Jose E. Roman
round a target > About this, I want to compute only three smallest real eigenvalues, should > this be the situation suitable for GD and JD? No, try Krylov-Schur or LOBPCG. > > Runfeng > > Jose E. Roman 于2022年7月13日周三 12:36写道: > Does it work with -eps_gd_blocksize 1 ? >

Re: [petsc-users] SLEPc EPSGD: Can not converge, error estimation floats over 1e-6

2022-07-12 Thread Jose E. Roman
Does it work with -eps_gd_blocksize 1 ? Why do you want to use GD? JD and GD are best when you need to compute eigenvalues around a target. For your case, I would try with the default solver (Krylov-Schur) or with LOBPCG. Jose > El 13 jul 2022, a las 4:59, Runfeng Jin escribió: > > Hi! > I

Re: [petsc-users] Solving singular system via direct solvers

2022-07-12 Thread Jose E. Roman
The interface functions are https://petsc.org/release/docs/manualpages/PC/PCFactorSetShiftType.html https://petsc.org/release/docs/manualpages/PC/PCFactorSetShiftAmount.html To check for success you can use https://petsc.org/release/docs/manualpages/KSP/KSPGetConvergedReason.html You can also

Re: [petsc-users] unable to find "petscconf_poison.h" header file

2022-07-08 Thread Jose E. Roman
This file is generated by configure and placed in $PETSC_DIR/$PETSC_ARCH/include Jose > El 8 jul 2022, a las 15:21, Altaf Ahmed escribió: > > Hi, > "petscmacros.h" header file uses "petscconf_poison.h" file but I am > unable to locate this file. Any help would be appreciated. > Thank you.

Re: [petsc-users] Parallel matrix-vector product with Matrix Shell

2022-06-18 Thread Jose E. Roman
ario Rossi ha > scritto: > Thanks a lot, Jose! > I looked at the eps folder (where I found the test8.c that has been my > starting point) but I did not look at the nep folder (my fault!) > Thanks again, > Mario > > Il giorno ven 17 giu 2022 alle ore 17:34 Jose E. Roma

Re: [petsc-users] Parallel matrix-vector product with Matrix Shell

2022-06-17 Thread Jose E. Roman
You can use VecGetOwnershipRange() to determine the range of global indices corresponding to the local portion of a vector, and VecGetArray() to access the values. In SLEPc, you can assume that X and Y will have the same parallel distribution. For an example of a shell matrix that implements

Re: [petsc-users] SLEPc EPSGD: too much time in single iteration

2022-06-15 Thread Jose E. Roman
n can cost more epssolve time? Is this due to the structure > of matrix? IF so, is there any ways to increase the solve speed? > > Or this is weired and should be fixed by some ways? > Thank you! > > Runfeng Jin > > >

Re: [petsc-users] SLEPc EPSGD: too much time in single iteration

2022-06-12 Thread Jose E. Roman
t much time. Is > there anything else I can do? Attachment is log when use PETSC_DEFAULT for > eps_ncv. > > Thank you ! > > Runfeng Jin > > Jose E. Roman 于2022年6月10日周五 20:50写道: > The value -eps_ncv 5000 is huge. > Better let SLEPc use the default value. > > Jo

Re: [petsc-users] SLEPc EPSGD: too much time in single iteration

2022-06-10 Thread Jose E. Roman
time. But I can not see why > it cost so much time. Can you see something from it? > > Thank you ! > > Runfeng Jin > > On 6月 4 2022, at 1:37 凌晨, Jose E. Roman wrote: > Convergence depends on distribution of eigenvalues you want to compute. On > the other hand, the cost

Re: [petsc-users] Accelerating eigenvalue computation / removing portion of spectrum

2022-06-07 Thread Jose E. Roman
0.8702293.19166e-13 -- > El 31 may 2022, a las 22:28, Jose E. Roman escribió: > > Probably MUMPS is taking most of the time... > > If the matrices are not too large, send them to my personal email and I will > have

Re: [petsc-users] SLEPc EPSGD: too much time in single iteration

2022-06-03 Thread Jose E. Roman
Convergence depends on distribution of eigenvalues you want to compute. On the other hand, the cost also depends on the time it takes to build the preconditioner. Use -log_view to see the cost of the different steps of the computation. Jose > El 3 jun 2022, a las 18:50, jsfaraway escribió:

Re: [petsc-users] Accelerating eigenvalue computation / removing portion of spectrum

2022-05-31 Thread Jose E. Roman
erval region to exclude the unneeded > eigenvalues will still be faster than forming a larger constrained system. > Specifying an interval appears to run in a similar amount of time. > > Lucas > From: Jose E. Roman > Sent: Tuesday, May 31, 2022 2:08 PM > To: Lucas Banting &

Re: [petsc-users] Accelerating eigenvalue computation / removing portion of spectrum

2022-05-31 Thread Jose E. Roman
input? > > Lucas > From: Jose E. Roman > Sent: Tuesday, May 31, 2022 1:11 PM > To: Lucas Banting > Cc: petsc-users@mcs.anl.gov > Subject: Re: [petsc-users] Accelerating eigenvalue computation / removing > portion of spectrum > > Caution: This message was sent from o

Re: [petsc-users] Accelerating eigenvalue computation / removing portion of spectrum

2022-05-31 Thread Jose E. Roman
If you know how to cheaply compute a basis of the nullspace of S, then you can try passing it to the solver via EPSSetDeflationSpace() https://slepc.upv.es/documentation/current/docs/manualpages/EPS/EPSSetDeflationSpace.html Jose > El 31 may 2022, a las 19:28, Lucas Banting escribió: > >

Re: [petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Jose E. Roman
The matrix inv(A)*B can be represented with a shell matrix that calls MatMult() followed by KSPSolve(), if you only need to apply this operator to a vector. It depends on what you are trying to do. Jose > El 21 may 2022, a las 18:41, Mateo José Moinelo > escribió: > > Hi. I am working on a

Re: [petsc-users] Matrix free generalized eigenvalue problem

2022-05-15 Thread Jose E. Roman
g eigenvalue iterations of Ax = k Bx is > trying to calculate the inverse of B or y = Bx. So the question is don't you > know maybe there exist methods or ways for generalized eigenproblems without > inverting of B? Again thanks a lot for the answer > > вс, 15 мая 2022 г. в 1

Re: [petsc-users] Matrix free generalized eigenvalue problem

2022-05-15 Thread Jose E. Roman
You cannot compute the LU factorization of a shell matrix. You will have to use a preconditioned iterative linear solver, see section 3.4.1 of the SLEPc users guide. Jose > El 15 may 2022, a las 14:39, Миша Сальников escribió: > > Hi, I am developing a program for solving generalized

Re: [petsc-users] Mysterious error code 77

2022-05-06 Thread Jose E. Roman
t;> LHS.setSizes([[n_local,n],[n_local,n]]) >>> LHS.setType(pet.Mat.Type.PYTHON) >>> LHS.setPythonContext(LHS_class()) >>> LHS.setUp() >>> >>> x, y = LHS.createVecs() >>> x.set(1) >>> LHS.mult(x,y) >>> print(y.norm()) >>> >

Re: [petsc-users] Mysterious error code 77

2022-05-06 Thread Jose E. Roman
al transform > ST = EPS.getST(); ST.setType('sinvert') > # Krylov subspace > KSP = ST.getKSP(); KSP.setType('preonly') > # Preconditioner > PC = KSP.getPC(); PC.setType('lu') > PC.setFactorSolverType('mumps') > EPS.setDimensions(1,5) > EPS.setFromOptions() > EPS.solve() > print(EPS.g

Re: [petsc-users] Mysterious error code 77

2022-05-06 Thread Jose E. Roman
Type.GHEP) # Specify that A is hermitian > (by construction), but M is semi-positive > EPS.setWhichEigenpairs(EPS.Which.LARGEST_MAGNITUDE) # Find largest eigenvalues > EPS.setFromOptions() > EPS.solve() > > > Quentin CHEVALIER – IA parcours recherche > LadHyX - Ecole polytechnique > __

Re: [petsc-users] Mysterious error code 77

2022-05-05 Thread Jose E. Roman
Your operator is not well formed. If you do this: x, y = LHS.createVecs() x.set(1) LHS.mult(x,y) y.view() you will see that the output is all zeros. That is why SLEPc complains that "Initial vector is zero or belongs to the deflation space". Jose > El 5 may 2022, a las 10:46, Quentin

Re: [petsc-users] SLEPc solve: progress info and abort option

2022-03-07 Thread Jose E. Roman
ably slow down convergence. Jose > > Many thanks for your help. > > Thanks, > Varun > > On Fri, Mar 4, 2022 at 11:36 AM Jose E. Roman <mailto:jro...@dsic.upv.es>> wrote: > Yes, assuming that the eigensolver is calling KSPSolve(), you can set a

Re: [petsc-users] SLEPc solve: progress info and abort option

2022-03-04 Thread Jose E. Roman
Yes, assuming that the eigensolver is calling KSPSolve(), you can set a monitor with KSPMonitorSet(). This will be called more often than the callback for EPSSetStoppingTestFunction(). Jose > El 4 mar 2022, a las 20:16, Matthew Knepley escribió: > > > On Fri, Mar 4, 2022 at 2:07 PM Varun

Re: [petsc-users] Preconditioner for LSQR

2022-03-01 Thread Jose E. Roman
s more convenient. Jose > > Pierre, > I can reuse A for many iterations, but I cannot do a matmatsolve as I need > the resulting solution to produce the next right hand side vector. > > Thanks again, > Lucas > From: Jose E. Roman > Sent: Tuesday, March 1, 2022 4:49 AM >

Re: [petsc-users] Preconditioner for LSQR

2022-03-01 Thread Jose E. Roman
To use SLEPc's TSQR one would do something like this: ierr = BVCreateFromMat(A,);CHKERRQ(ierr); ierr = BVSetFromOptions(X);CHKERRQ(ierr); ierr = BVSetOrthogonalization(X,BV_ORTHOG_CGS,BV_ORTHOG_REFINE_IFNEEDED,PETSC_DEFAULT,BV_ORTHOG_BLOCK_TSQR);CHKERRQ(ierr); ierr =

Re: [petsc-users] Solving a Singular System with PETSc

2022-02-27 Thread Jose E. Roman
A correction: it is B=A+sigma*I when you *add* 1e-6 to the diagonal entries. but if you "multiply each diagonal of the system matrix with (1.0 + 1.0e-6)" you are doing a different thing. > El 27 feb 2022, a las 9:21, Jose E. Roman escribió: > > In both cases, it is l

Re: [petsc-users] Solving a Singular System with PETSc

2022-02-27 Thread Jose E. Roman
In both cases, it is like you are solving a nonsingular system with a matrix B. With MatNullSpace, B=A-e*e' where e=ones(n,1) normalized, and with your approach it is B=A+sigma*I with sigma=1e-6. The first approach shifts the zero eigenvalue, while in the second approach all eigenvalues are

Re: [petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread Jose E. Roman
PCSetType(pc, PCLU); > PCFactorSetMatSolverType(pc, MATSOLVERMUMPS); > PCFactorSetUpMatSolverType(pc); > PCFactorGetMatrix(pc, ); > MatMumpsSetIcntl(F, 7, 5); // configure mumps. > --- > Does this introduce unnecessary big computation overhead? > Can the code further

Re: [petsc-users] Reuse symbolic factorization with petsc - mumps

2022-02-17 Thread Jose E. Roman
Since version 3.5, KSPSetOperators() will check if the passed matrix has the same sparse pattern as the previously set one, so you don't have to do anything. The list of changes in version 3.5 has this note: "KSPSetOperators() no longer has the MatStructure argument. The Mat objects now track

Re: [petsc-users] Multiple phi-function evaluations (SLEPc)

2022-01-27 Thread Jose E. Roman
In a basic Arnoldi implementation, it would be possible to do what you suggest: run Arnoldi once and compute the three approximations from it. But SLEPc's implementation is a restarted method, where the computed Krylov basis is discarded when the maximum dimension is reached. Not sure how this

Re: [petsc-users] Inconsistent PETSc MUMPS statistics

2022-01-16 Thread Jose E. Roman
Probably someone else can give a better answer, but if I remember correctly ParMetis relies on certain random number generator that makes it produce different partitions for different runs. I think this was fixed in the ParMetis that --download-parmetis installs, but if I am not wrong you are

Re: [petsc-users] PETSc MUMPS interface

2022-01-16 Thread Jose E. Roman
Hong may give a better answer, but if you look at PCSetUp_LU() https://petsc.org/main/src/ksp/pc/impls/factor/lu/lu.c.html#PCSetUp_LU you will see that MatLUFactorSymbolic() is called unconditionally during the first PCSetUp(). Currently there is no way to check if the user has already called

Re: [petsc-users] Orthogonality of eigenvectors in SLEPC

2021-12-10 Thread Jose E. Roman
case a ? > > Best, > Kuang > > > From: Zhang, Hong > Sent: Thursday, December 2, 2021 2:18 PM > To: Wang, Kuang-chung ; Jose E. Roman > > Cc: petsc-users@mcs.anl.gov; Obradovic, Borna ; > Cea, Stephen M > Subject: Re: [petsc-users] Orthogonality o

Re: [petsc-users] Orthogonality of eigenvectors in SLEPC

2021-11-24 Thread Jose E. Roman
In Hermitian eigenproblems orthogonality of eigenvectors is guaranteed/enforced. But you are solving the problem as non-Hermitian. If your matrix is Hermitian, make sure you solve it as a HEP, and make sure that your matrix is numerically Hermitian. If your matrix is non-Hermitian, then you

Re: [petsc-users] PCSHELL does not support getting factor matrix

2021-11-19 Thread Jose E. Roman
t;> matching restore, and the new object created will be leaked. >> What do you think? >> >> >>> On Nov 19, 2021, at 12:41 PM, Jose E. Roman wrote: >>> >>> It is trying to call PCFactorGetMatrix() on your PC, but this operation is >>

Re: [petsc-users] PCSHELL does not support getting factor matrix

2021-11-19 Thread Jose E. Roman
It is trying to call PCFactorGetMatrix() on your PC, but this operation is not supported by PCSHELL and it is not possible to set it via PetscObjectComposeFunction(). PCSHELL uses the PCShellSet* interface, that is restricted to a limited number of operations. Jose > El 19 nov 2021, a las

Re: [petsc-users] Debugger won't start

2021-11-15 Thread Jose E. Roman
> > mpirun -np 2 ./ex45 -start_in_debugger -debug_terminal "screen -X -S debug > screen" > > but the problem still persists. Now, I get a different message > > No screen session found. > > > On 15/11/2021, 09:04, "Jose E. Roman" wrote: &

  1   2   3   4   5   6   7   >