[petsc-users] MG on GPU: Benchmarking and avoiding vector host->device copy

2023-02-06 Thread Paul Grosse-Bley
Hi, I want to compare different implementations of multigrid solvers for Nvidia GPUs using the poisson problem (starting from ksp tutorial example ex45.c). Therefore I am trying to get runtime results comparable to hpgmg-cuda (finite-volume), i.e. using multiple warmup and measurement solves an

Re: [petsc-users] MG on GPU: Benchmarking and avoiding vector host->device copy

2023-02-06 Thread Barry Smith
Paul, I think src/ksp/ksp/tutorials/benchmark_ksp.c is the code intended to be used for simple benchmarking. You can use VecCudaGetArray() to access the GPU memory of the vector and then call a CUDA kernel to compute the right hand side vector directly on the GPU. Barry > On Feb

Re: [petsc-users] Problem setting Fieldsplit fields

2023-02-06 Thread Nicolas Barnafi via petsc-users
Thank you Matt, Again, at the bottom of this message you will find the -info output. I don't see any output related to the fields, Best -- -info [0] PetscDetermineInitialFPTrap(): Floating point trapping is on by default 13 [0] PetscDeviceInitializeTypeFromOptions_Private(): PetscDe

Re: [petsc-users] Problem setting Fieldsplit fields

2023-02-06 Thread Matthew Knepley
On Mon, Feb 6, 2023 at 11:45 AM Nicolas Barnafi wrote: > Thank you Matt, > > Again, at the bottom of this message you will find the -info output. I > don't see any output related to the fields, > If the splits were done automatically, you would see an info message from here: https://gitlab.com

Re: [petsc-users] MG on GPU: Benchmarking and avoiding vector host->device copy

2023-02-06 Thread Paul Grosse-Bley
Hi Barry, src/ksp/ksp/tutorials/bench_kspsolve.c is certainly the better starting point, thank you! Sadly I get a segfault when executing that example with PCMG and more than one level, i.e. with the minimal args: $ mpiexec -c 1 ./bench_kspsolve -split_ksp -pc_type mg -pc_mg_levels 2 =

Re: [petsc-users] MG on GPU: Benchmarking and avoiding vector host->device copy

2023-02-06 Thread Barry Smith
It should not crash, take a look at the test cases at the bottom of the file. You are likely correct if the code, unfortunately, does use DMCreateMatrix() it will not work out of the box for geometric multigrid. So it might be the wrong example for you. I don't know what you mean about clev

Re: [petsc-users] Eliminating rows and columns which are zeros

2023-02-06 Thread Barry Smith
Sorry, I had a mistake in my thinking, PCREDISTRIBUTE supports completely empty rows but MatZero* does not. When you put values into the matrix you will need to insert a 0.0 on the diagonal of each "inactive" row; all of this will be eliminated during the linear solve process. It would be

Re: [petsc-users] Eliminating rows and columns which are zeros

2023-02-06 Thread Karthikeyan Chockalingam - STFC UKRI via petsc-users
No problem. I don’t completely follow. (Q1) I have used MATMPIAJI but not sure what is MatZero* (star) and what it does? And its relevance to my problem. (Q2) Since I am creating a MATMPIAJI system– what would be the best way to insert 0.0 in to ALL diagonals (both active and inactive rows) to

Re: [petsc-users] Eliminating rows and columns which are zeros

2023-02-06 Thread Matthew Knepley
On Mon, Feb 6, 2023 at 4:45 PM Karthikeyan Chockalingam - STFC UKRI via petsc-users wrote: > No problem. I don’t completely follow. > > > > (Q1) I have used MATMPIAJI but not sure what is MatZero* (star) and what > it does? And its relevance to my problem. > Barry means MatZeroRows(), MatZeroRow

Re: [petsc-users] Eliminating rows and columns which are zeros

2023-02-06 Thread Karthikeyan Chockalingam - STFC UKRI via petsc-users
Thank you Matt. (Q1) I believe, I will look for a range of row indexes local to my process, instead of having all my processes setting diagonals to zero using a loop. (Q2) You are referring to -pc_type redistribute correct – if something please send me the documentation page? Many thanks! Kart

Re: [petsc-users] Eliminating rows and columns which are zeros

2023-02-06 Thread Barry Smith
Sorry was not clear MatZero*. I just meant MatZeroRows() or MatZeroRowsColumns() > On Feb 6, 2023, at 4:45 PM, Karthikeyan Chockalingam - STFC UKRI > wrote: > > No problem. I don’t completely follow. > > (Q1) I have used MATMPIAJI but not sure what is MatZero* (star) and what it > does?