Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Junchao Zhang
On Tue, Dec 7, 2021 at 10:04 PM Faraz Hussain wrote: > The matrix in memory is in IJV (Spooles ) or CSR3 ( Pardiso ). The > application was written to use a variety of different direct solvers but > Spooles and Pardiso are what I am most familiar with. > I assume the CSR3 has the a, i, j arrays

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Faraz Hussain via petsc-users
The matrix in memory is in IJV (Spooles ) or CSR3 ( Pardiso ). The application was written to use a variety of different direct solvers but Spooles and Pardiso are what I am most familiar with. On Tuesday, December 7, 2021, 10:33:24 PM EST, Junchao Zhang wrote: On Tue, Dec 7,

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 10:25 PM Faraz Hussain wrote: > Thanks, that makes sense. I guess I was hoping petsc ksp is like intel's > cluster sparse solver where it handles distributing the matrix to the other > ranks for you. > > It sounds like that is not the case and I need to manually distribute

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Junchao Zhang
On Tue, Dec 7, 2021 at 9:06 PM Faraz Hussain via petsc-users < petsc-users@mcs.anl.gov> wrote: > Thanks, I took a look at ex10.c in ksp/tutorials . It seems to do as you > wrote, "it efficiently gets the matrix from the file spread out over all > the ranks.". > > However, in my application I only

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Faraz Hussain via petsc-users
Thanks, that makes sense. I guess I was hoping petsc ksp is like intel's cluster sparse solver where it handles distributing the matrix to the other ranks for you. It sounds like that is not the case and I need to manually distribute the matrix to the ranks? On Tuesday, December 7,

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 10:06 PM Faraz Hussain via petsc-users < petsc-users@mcs.anl.gov> wrote: > Thanks, I took a look at ex10.c in ksp/tutorials . It seems to do as you > wrote, "it efficiently gets the matrix from the file spread out over all > the ranks.". > > However, in my application I

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Faraz Hussain via petsc-users
Thanks, I took a look at ex10.c in ksp/tutorials . It seems to do as you wrote, "it efficiently gets the matrix from the file spread out over all the ranks.". However, in my application I only want rank 0 to read and assemble the matrix. I do not want other ranks trying to get the matrix data.

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-07 Thread Barry Smith
So left preconditioning converges fine, the true residual gets as small as one could expect. Right preconditioning fails completely; I have no explanation for this, could be a bug in the PETSc implementation for right preconditioning with this method. What do you get with -ksp_type bcgs

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-07 Thread Jed Brown
"Fischer, Greg A. via petsc-users" writes: > I've attached typical examples of "A" and "b". Do these qualify as large > values? Yeah, the matrix values are of order 1e12. Usually modelers choose units so that these are closer to order 1. (One can do this by formal non-dimensionalization, but

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-07 Thread Barry Smith
When the preconditioned and non-preconditioner residual norms as so hugely different this usually indicates something is badly scaled or something "bad" is happening within the preconditioner. 0 KSP preconditioned resid norm 2.434689662304e-01 true resid norm 1.413757649058e+09

Re: [petsc-users] PETSc object creation/destruction with adaptive grid

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 12:54 PM Samuel Estes wrote: > Hi, > > I have a code implementing a finite element method with an adaptive grid. > Rather than destroying the PETSc objects (the Jacobian matrix and RHS > residual vector) every time the code refines the grid, we want to > (over-)allocate

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
I will, as soon as possible... Scarica Outlook per Android From: Matthew Knepley Sent: Tuesday, December 7, 2021 7:25:43 PM To: Marco Cisternino Cc: petsc-users Subject: Re: [petsc-users] Nullspaces On Tue, Dec 7, 2021 at 11:19 AM Marco

Re: [petsc-users] Nullspaces

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 11:19 AM Marco Cisternino < marco.cistern...@optimad.it> wrote: > Good morning, > > I’m still struggling with the Poisson equation with Neumann BCs. > > I discretize the equation by finite volume method and I divide every line > of the linear system by the volume of the

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 9:43 AM Quentin Chevalier < quentin.cheval...@polytechnique.edu> wrote: > @Matthew, as stated before, error output is unchanged, i.e.the python > command below produces the same traceback : > > # python3 -c "from petsc4py import PETSc; > PETSc.Viewer().createHDF5('d.h5')" >

[petsc-users] PETSc object creation/destruction with adaptive grid

2021-12-07 Thread Samuel Estes
Hi, I have a code implementing a finite element method with an adaptive grid. Rather than destroying the PETSc objects (the Jacobian matrix and RHS residual vector) every time the code refines the grid, we want to (over-)allocate some "padding" for these objects so that we only destroy/create new

Re: [petsc-users] KSPBuildResidual and KSPType compatibility

2021-12-07 Thread Fischer, Greg A. via petsc-users
Attached are outputs with these options. What should I make of these? From: Barry Smith Sent: Monday, December 6, 2021 2:16 PM To: Fischer, Greg A. via petsc-users Cc: Fischer, Greg A. Subject: Re: [petsc-users] KSPBuildResidual and KSPType compatibility [External Email] What do you get for

Re: [petsc-users] Nullspaces

2021-12-07 Thread Mark Adams
> for (PetscInt i = 0; i < nConstants; ++i) { > > VecRestoreArray(constants[i], [i]); > > VecAssemblyBegin(constants[i]); > > VecAssemblyEnd(constants[i]); > > VecNormalize(constants[i], nullptr); > This does not look correct. > }

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
Thanks Barry. I already did it, I mean a constant vec per domain with 1 on rows of that domain and zero on rows of the other one, and exactly I did this: Vec *constants = nullptr; PetscInt nConstants = nActiveDomains; VecDuplicateVecs(m_solution, nConstants, ); for

Re: [petsc-users] Nullspaces

2021-12-07 Thread Barry Smith
A side note: The MatNullSpaceTest tells you that the null space you provided is in the null space of the operator, it does not say if you have found the entire null space. In your case with two subdomains the null space is actually two dimensional; all constant on one domain (0 on the other)

Re: [petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
I’m sorry, I believed it was clear: “it works” means MatNullSpaceTest returns true “it does not work” means MatNullSpaceTest returns false Is it enough? Thanks Marco Cisternino, PhD marco.cistern...@optimad.it __ Optimad Engineering Srl Via

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Barry Smith
Something is really wrong with the process, you should not have to waste all this time on a simple build that in theory is super simple given it is using docker. We debug these things by looking at the output files from PETSc: configure.log make.log and the output from make check. Are

Re: [petsc-users] Nullspaces

2021-12-07 Thread Mark Adams
Can you please give more details on what 'does not work' is. More detail on how you judge what works would also be useful. Mark On Tue, Dec 7, 2021 at 11:19 AM Marco Cisternino < marco.cistern...@optimad.it> wrote: > Good morning, > > I’m still struggling with the Poisson equation with Neumann

Re: [petsc-users] install PETSc on windows

2021-12-07 Thread Satish Balay via petsc-users
Yes - you need to build hypre with the same mpi, compilers (compiler options) as petsc. Satish On Tue, 7 Dec 2021, Ning Li wrote: > I tried to use this new PETSc in my application, and got this HYPRE related > error when I built a solution in visual studio. > [image: image.png] > I have

Re: [petsc-users] install PETSc on windows

2021-12-07 Thread Ning Li
I tried to use this new PETSc in my application, and got this HYPRE related error when I built a solution in visual studio. [image: image.png] I have installed the latest HYPRE on my laptop and linked it to my application, but I disabled MPI option when I configured HYPRE . Is this why this error

[petsc-users] Nullspaces

2021-12-07 Thread Marco Cisternino
Good morning, I'm still struggling with the Poisson equation with Neumann BCs. I discretize the equation by finite volume method and I divide every line of the linear system by the volume of the cell. I could avoid this division, but I'm trying to understand. My mesh is not uniform, i.e. cells

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Quentin Chevalier
@Lawrence, thanks for the details, but point 7 fails with : ERROR: Invalid requirement: '/usr/local/petsc/src/binding/petsc4py' Hint: It looks like a path. File '/usr/local/petsc/src/binding/petsc4py' does not exist. Just like @wence's tentative command. I've changed the dockerfile of dolfinx to

Re: [petsc-users] CV_CONV_FAILURE with TSSUNDIALS in PETSc

2021-12-07 Thread Patrick Sanan
Note that if you have a call to TSSetFromOptions() in your code (again, see TS ex19 in src/ts/tutorials/ex19.c) then you can supply command line options and see a lot of information about the timestepper. If you run the example with the -help argument you'll get a big list of options which may

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Barry Smith
You can also just add --with-petsc4py to your PETSc configure command and it will manage automatically the petsc4py install. So ./configure --with-hdf5 --any-other --configure-flags --you-want --with-petsc4py Some people don't like this approach, I don't understand exactly why not; it

Re: [petsc-users] DMView and DMLoad

2021-12-07 Thread Sagiyama, Koki
Hi Berend, I made some small changes to your code to successfully compile it and defined a periodic dm using DMPlexCreateBoxMesh(), but otherwise your code worked fine. I think we would like to see a complete minimal failing example. Can you make the working example that I pasted in earlier

Re: [petsc-users] install PETSc on windows

2021-12-07 Thread Satish Balay via petsc-users
Your build is with msmpi - but mpiexec from openmpi got used. You can try compiling and running examples manually [with the correct mpiexec] Satish On Tue, 7 Dec 2021, liyuanse...@gmail.com wrote: > Hi Satish, > > I have another question. After I run the check command, I got the following >

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Lawrence Mitchell
Comments inline below: > On 7 Dec 2021, at 14:43, Quentin Chevalier > wrote: > > @Matthew, as stated before, error output is unchanged, i.e.the python > command below produces the same traceback : > > # python3 -c "from petsc4py import PETSc; PETSc.Viewer().createHDF5('d.h5')" > Traceback

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Barry Smith
If you use MatLoad() it never has the entire matrix on a single rank at the same time; it efficiently gets the matrix from the file spread out over all the ranks. > On Dec 6, 2021, at 11:04 PM, Faraz Hussain via petsc-users > wrote: > > I am studying the examples but it seems all ranks

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Quentin Chevalier
@Matthew, as stated before, error output is unchanged, i.e.the python command below produces the same traceback : # python3 -c "from petsc4py import PETSc; PETSc.Viewer().createHDF5('d.h5')" Traceback (most recent call last): File "", line 1, in File "PETSc/Viewer.pyx", line 182, in

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Lawrence Mitchell
> On 7 Dec 2021, at 13:26, Quentin Chevalier > wrote: > > Ok my bad, that log corresponded to a tentative --download-hdf5. This > log corresponds to the commands given above and has --with-hdf5 in its > options. OK, so PETSc is configured with HDF5. I assume you have now built it (with make

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 8:26 AM Quentin Chevalier < quentin.cheval...@polytechnique.edu> wrote: > Ok my bad, that log corresponded to a tentative --download-hdf5. This > log corresponds to the commands given above and has --with-hdf5 in its > options. > Okay, this configure was successful and

Re: [petsc-users] How to read/write a HDF5 file using petsc4py ?

2021-12-07 Thread Matthew Knepley
On Tue, Dec 7, 2021 at 3:55 AM Quentin Chevalier < quentin.cheval...@polytechnique.edu> wrote: > Hello Matthew, > > That would indeed make sense. > > Full log is attached, I grepped hdf5 in there and didn't find anything > alarming. > At the top of this log: Configure Options:

Re: [petsc-users] Tips on integrating MPI ksp petsc into my application?

2021-12-07 Thread Mark Adams
I assume you are using PETSc to load matices. What example are you looking at? On Mon, Dec 6, 2021 at 11:04 PM Faraz Hussain via petsc-users < petsc-users@mcs.anl.gov> wrote: > I am studying the examples but it seems all ranks read the full matrix. Is > there an MPI example where only rank 0