Looks like ex55 is the one to use - that links in with ex55k
But it needs a fix for a build from 'make'
>>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ git diff
diff --git a/src/snes/tutorials/makefile b/src/snes/tutorials/makefile
index 672a62aa5a0..eed127f7eae 100644
---
> The new code is in https://gitlab.com/petsc/petsc/-/merge_requests/7293 and
> retains the null space on the submatrices for both MatZeroRows() and
> MatZeroRowsAndColumns() regardless of changes to the nonzero structure of the
> matrix.
Thank you very much Barry.
It works as expected.
--
Hello!
I want to start porting part of our PETSc-based code to GPU through kokkos and
I want to start with excercises given in tutorials folder.
For that I found two examples of using PETSC with kokkos in folder
petsc/src/snes/tutorials
I managed to succesfully compile and run
Satish is right. ex55k is not standalone.
There are many examples in petsc tests that can run with kokkos. Just
search "requires: kokkos_kernels" and you will find them.
ex55k.kokkos.cxx is an example showing how to use petsc/kokkos functions
like DMDAVecRestoreKokkosOffsetView,
Dear PETSc team,
I am using a newtonls snes solver. I know that form residual is invoked
at several locations of the algorithm, first evaluated for the rhs of
ksp solver, then several times for obtaining the optimal step of line
search.
In my problem I have a global variable that is updated
Use SNESSetUpdate() to provide a callback function that gets called by SNES
automatically immediately before each linear solve. Inside your callback use
SNESGetFunction(snes,f,NULL,NULL); to access the last computed value of your
function, from this you can update your global variable.