Re: [petsc-users] getinfo for Mat of type nest

2024-10-03 Thread Edoardo alinovi
Jed, Junchao, Thanks for getting me back! Junchao, I cannot provide you with an input file as I am plugging just part of that code into mine. I am building blocks of the full matrix on my own, not reading from the file unfortunately. I can share a branch of my code with a 3x3 cavity toy case, but

Re: [petsc-users] getinfo for Mat of type nest

2024-10-03 Thread Jed Brown
Could you please show the rest of the stack trace? The code you cited there isn't checking return values (using PetscCall or otherwise) so it might be truncated. You can run in a debugger to see a full stack trace without modifying the code (though we recommend checking return values). MatGetIn

Re: [petsc-users] getinfo for Mat of type nest

2024-10-03 Thread Junchao Zhang
Could you also provide input files to run your code? --Junchao Zhang On Thu, Oct 3, 2024 at 5:14 AM Edoardo alinovi wrote: > Hi Barry, > > I am trying to port this preconditioner I found presented at the last > PETSc conference into may code: > > https://urldefense.us/v3/__https://github.com/n

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread 刘浪天 via petsc-users
"How did you compile your code, using nvcc, mpicc or mpicxx? I expect PetscScalar to be std::complex with C++  or _Complex with C.  So I don't understand why "PetscScalar still refers to thrust::complex"."I use mpicxx and nvcc.I also attached my cmakelists.txtBest, Langtian L

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread 刘浪天 via petsc-users
Hi Junchao, I pulled and reinstalled. Although the PetscScalar still refers to thrust::complex, based on your suggestion, cast the pointer to PetscScalar * can work. It has the same storage order as std::complex. Mat kernel ; auto * h_kernel = reinterpret_cast < PetscScalar *>( h_kernel_temp ) ; P

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread Junchao Zhang
The MR is merged to petsc/release. BTW, in MatCreateDense, the data pointer has to be a host pointer. It is better to always use PetscScalar* (instead of std::complex*) to do the cast. --Junchao Zhang On Thu, Oct 3, 2024 at 3:03 AM 刘浪天 wrote: > Okay. I see :D > Langtian

[petsc-users] getinfo for Mat of type nest

2024-10-03 Thread Edoardo alinovi
Hi Barry, I am trying to port this preconditioner I found presented at the last PETSc conference into may code: https://urldefense.us/v3/__https://github.com/ndjinga/SOLVERLAB/blob/master/CoreFlows/examples/C/SaddlePointPreconditioner/SaddlePointLinearSolver.c__;!!G_uCfscf7eWS!a-JnrBsta75n_WDtxUNd

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread 刘浪天 via petsc-users
Okay. I see :D Langtian Liu Institute for Theorectical Physics, Justus-Liebig-University Giessen Heinrich-Buff-Ring 16, 35392 Giessen Germany email: langtian@icloud.com Tel: (+49)641 99 33342 On Oct 3, 2024, at 9:58 AM, Jose E. Roman wrote: You have to wait until the merg

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread Jose E. Roman via petsc-users
You have to wait until the merge request has the label "Merged" instead of "Open". > El 3 oct 2024, a las 9:55, 刘浪天 via petsc-users > escribió: > > Hello Junchao, > > Okay. Thank you for helping find this bug. I pull the newest version of petsc > today. It seems this error has not been fixe

Re: [petsc-users] issue of MatCreateDense in the CUDA codes

2024-10-03 Thread 刘浪天 via petsc-users
Hello Junchao, Okay. Thank you for helping find this bug. I pull the newest version of petsc today. It seems this error has not been fixed in the present release version. Maybe I should wait for some days. Best wishes, Langtian On Oct 3, 2024, at 12:12 AM, Junchao Zhang wrote: Hi, Langtian, Than