Re: [petsc-users] PC shell destroy

2021-11-19 Thread Alfredo J Duarte Gomez
Good morning, Sorry for picking this back up such a long time after the initial response, but I am now in a good place to implement this change after thoroughly testing the preconditioner shell alone. I have been looking for resources but it is still not clear to me how to use the MATSHELL for

Re: [petsc-users] hypre on gpus

2021-11-19 Thread Mark Adams
You should run with -options_left to check that your options are being used. It may be -mat_type hypre. I have tested this: petsc/src/ksp/ksp/tutorials$ *srun -n2 ./ex4 -ksp_type cg -mat_type hypre -ksp_view -pc_type hypre* You can add -log_view and that will print performance data for each

Re: [petsc-users] How to check NULL pointer in Fortran

2021-11-19 Thread Barry Smith
it is very possible there is a bug in the Fortran interface for this function. It looks like whoever wrote the Fortran interface did not think through the special case of contiguous entries. PETSC_EXTERN void petscsfgetgraph_(PetscSF *sf,PetscInt *nroots,PetscInt *nleaves, F90Array1d

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

2021-11-19 Thread Jose E. Roman
Yes, spectrum slicing needs computing the inertia, and also it uses the KSPSolve interface. Furthermore, the current implementation is single vector only, no blocks. The only part of SLEPc that uses PCApply directly are Davidson solvers. I could try to adapt them to use PCMatApply(). Thanks for

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

2021-11-19 Thread Stefano Zampini
Oh, I see the stack trace now. This requires to compute the inertia? > On Nov 19, 2021, at 3:45 PM, Stefano Zampini > wrote: > > Jose > > Now that we have the PCMatApply interface, you could switch to use that > inside SLEPc. I guess you are using MatSolve, right? > If not, the alternative

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

2021-11-19 Thread Stefano Zampini
Jose Now that we have the PCMatApply interface, you could switch to use that inside SLEPc. I guess you are using MatSolve, right? If not, the alternative is to have a PCFactorGetMatrix with creates on the fly an object that behaves like it. The problem is that we do not have a matching

Re: [petsc-users] How to check NULL pointer in Fortran

2021-11-19 Thread Mark Adams
You could try this: integer :: i real :: r i = loc(r) print *, i On Fri, Nov 19, 2021 at 12:34 AM 袁煕 wrote: > Dear PETSc-team, > > I am using function PetscSFGetGraph in my program like > --- > call PetscSFGetGraph(sf,gnroots,gnleaves,gmine,gremote,ierr) >

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