Re: [petsc-users] performance regression with GAMG

2023-08-10 Thread Pierre Jolivet
> On 11 Aug 2023, at 1:14 AM, Mark Adams wrote: > > BTW, nice bug report ... >> >> So in the first step it coarsens from 150e6 to 5.4e6 DOFs instead of to >> 2.6e6 DOFs. > > Yes, this is the critical place to see what is different and going wrong. > > My 3D tests were not that different

Re: [petsc-users] performance regression with GAMG

2023-08-10 Thread Mark Adams
BTW, nice bug report ... > > So in the first step it coarsens from 150e6 to 5.4e6 DOFs instead of to > 2.6e6 DOFs. Yes, this is the critical place to see what is different and going wrong. My 3D tests were not that different and I see you lowered the threshold. Note, you can set the threshold

[petsc-users] CUDA error trying to run a job with two mpi processes and 1 GPU

2023-08-10 Thread Vanella, Marcos (Fed) via petsc-users
Hi, I'm trying to run a parallel matrix vector build and linear solution with PETSc on 2 MPI processes + one V100 GPU. I tested that the matrix build and solution is successful in CPUs only. I'm using cuda 11.5 and cuda enabled openmpi and gcc 9.3. When I run the job with GPU enabled I get the

Re: [petsc-users] performance regression with GAMG

2023-08-10 Thread Mark Adams
Hi Stephan, Yes, MIS(A^T A) -> MIS(MIS(A)) change? Yep, that is it. This change was required because A^T A is super expensive. This change did not do much to my tests but this is complex. I am on travel now, but I can get to this in a few days. You provided me with a lot of data and I can take

Re: [petsc-users] error related to 'valgrind' when using MatView

2023-08-10 Thread Matthew Knepley
On Thu, Aug 10, 2023 at 2:30 AM maitri ksh wrote: > I am unable to understand what possibly went wrong with my code, I could > load a matrix (large sparse matrix) into petsc, write it out and read it > back into Matlab but when I tried to use MatView to see the matrix-info, it > produces error

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Niclas Götting
Alright. Again, thank you very much for taking the time to answer my beginner questions! Still a lot to learn.. Have a good day! On 10.08.23 12:27, Stefano Zampini wrote: Then just do the multiplications you need. My proposal was for the example function you were showing. On Thu, Aug 10,

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Stefano Zampini
Then just do the multiplications you need. My proposal was for the example function you were showing. On Thu, Aug 10, 2023, 12:25 Niclas Götting wrote: > You are absolutely right for this specific case (I get about 2400it/s > instead of 2100it/s). However, the single square function will be

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Niclas Götting
You are absolutely right for this specific case (I get about 2400it/s instead of 2100it/s). However, the single square function will be replaced by a series of gaussian pulses in the future, which will never be zero. Maybe one could do an approximation and skip the second mult, if the

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Stefano Zampini
If you do the mult of "pump" inside an if it should be faster On Thu, Aug 10, 2023, 12:12 Niclas Götting wrote: > If I understood you right, this should be the resulting RHS: > > def rhsfunc5(ts, t, u, F): > l.mult(u, F) > pump.mult(u, tmp_vec) > scale = 0.5 * (5 < t < 10) >

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Niclas Götting
If I understood you right, this should be the resulting RHS: def rhsfunc5(ts, t, u, F):     l.mult(u, F)     pump.mult(u, tmp_vec)     scale = 0.5 * (5 < t < 10)     F.axpy(scale, tmp_vec) It is a little bit slower than option 3, but with about 2100it/s consistently ~10% faster than option 4.

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Stefano Zampini
I would use option 3. Keep a work vector and do a vector summation instead of the multiple multiplication by scale and 1/scale. I agree with you the docs are a little misleading here. On Thu, Aug 10, 2023, 11:40 Niclas Götting wrote: > Thank you both for the very quick answer! > > So far, I

Re: [petsc-users] Python PETSc performance vs scipy ZVODE

2023-08-10 Thread Niclas Götting
Thank you both for the very quick answer! So far, I compiled PETSc with debugging turned on, but I think it should still be faster than standard scipy in both cases. Actually, Stefano's answer has got me very far already; now I only define the RHS of the ODE and no Jacobian (I wonder, why the

[petsc-users] error related to 'valgrind' when using MatView

2023-08-10 Thread maitri ksh
I am unable to understand what possibly went wrong with my code, I could load a matrix (large sparse matrix) into petsc, write it out and read it back into Matlab but when I tried to use MatView to see the matrix-info, it produces error of some 'corrupt argument, #valgrind'. Can anyone please