Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 2:21 AM, Danyang Su wrote: > Dear All, > > I use PCFactorSetLevels for ILU and PCFactorSetFill for other > preconditioning in my code to help solve the problems that the default > option is hard to solve. However, I found the latter one,

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 4:45 AM, Franck Houssen wrote: > Coming from FEM, I believe the very confusing thing is that the local size > of the user problem (math, physics point of view - DDM domain size) is not > (can not be ?) the local size expected in MatCreateIS. > >

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-24 Thread Stefano Zampini
On May 24, 2017, at 11:46 AM, Franck Houssen wrote:The code I sent compile and run at my side with petsc-3.7.6 (on debian/testing with gcc-6.3). The code you sent does not compile at my side. Anyway, no big deal.MatGetSubMatrix/MatGetSubMatrices have been renamed  to

Re: [petsc-users] Installation Error

2017-05-24 Thread Satish Balay
What do you have for: which python echo $PYTHONPATH The following might work.. PYTHONPATH='' /usr/bin/python ./configure --with-cc=gcc --with-cxx=0 --with-fc=0 --download-f2cblaslapack --download-mpich Satish On Wed, 24 May 2017, 李瑞 wrote: > > Dear professor or engineer: >I meet a

[petsc-users] PETSC OO C guide/standard?

2017-05-24 Thread John Chludzinski
Is there a guide for how to write/develop PETSC OO C code? How a "class" is defined/implemented? How you implement inheritance? Memory management? Etc? ---John

Re: [petsc-users] Installation Error

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 12:14 AM, 李瑞 wrote: > > Dear professor or engineer: >I meet a problem about installation to petsc. >When I type the code "./configure --with-cc=gcc --with-cxx=0 > --with-fc=0 --download-f2cblaslapack --download-mpich" on my terminal,the >

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 1:09 AM, Michal Derezinski wrote: > Hi, > > I want to be able to perform matrix operations on several contiguous > submatrices of a full matrix, without allocating the memory redundantly for > the submatrices (in addition to the memory that is already

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-24 Thread Franck Houssen
The code I sent compile and run at my side with petsc-3.7.6 (on debian/testing with gcc-6.3). The code you sent does not compile at my side. Anyway, no big deal. The modification you propose as far as I understand is to replace "ISCreateGeneral(PETSC_COMM_WORLD" with

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-24 Thread Franck Houssen
Coming from FEM, I believe the very confusing thing is that the local size of the user problem (math, physics point of view - DDM domain size) is not (can not be ?) the local size expected in MatCreateIS. My understanding is that the local size in MatIS is "just" related to backend

Re: [petsc-users] PETSC OO C guide/standard?

2017-05-24 Thread John Chludzinski
Considering that the current C++ standard is >1600 pages and counting (still glomming on new "features"), I'm planning to try an OO style of C coding style. The standard's size (number of pages) being the best (and only *practical*) means to measure language complexity. On Wed, May 24, 2017 at

Re: [petsc-users] PETSC OO C guide/standard?

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 8:03 AM, John Chludzinski wrote: > Is there a guide for how to write/develop PETSC OO C code? How a "class" > is defined/implemented? How you implement inheritance? Memory management? > Etc? > We have a guide:

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to get local matrix (= one domain) before and after assembly ?

2017-05-24 Thread Franck Houssen
OK, this is working now ! As the API changed between the latest stable and the master branch, I was actually not using the correct method. Thanks Stefano, Franck - Mail original - > De: "Stefano Zampini" > À: "Franck Houssen" >

Re: [petsc-users] PETSC OO C guide/standard?

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 8:50 AM, John Chludzinski wrote: > Considering that the current C++ standard is >1600 pages and counting > (still glomming on new "features"), I'm planning to try an OO style of C > coding style. > > The standard's size (number of pages) being the

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Hi Matthew and Barry, Thanks for the quick response. I also tried superlu and mumps, both work but it is about four times slower than ILU(dt) prec through hypre, with 24 processors I have tested. When I look into the convergence information, the method using ILU(dt) still takes 200 to 3000

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Barry Smith
> On May 24, 2017, at 2:21 AM, Danyang Su wrote: > > Dear All, > > I use PCFactorSetLevels for ILU and PCFactorSetFill for other preconditioning > in my code to help solve the problems that the default option is hard to > solve. However, I found the latter one,

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michał Dereziński
Great! Then I have a follow-up question: My goal is to be able to load the full matrix X from disk, while at the same time in parallel, performing computations on the submatrices that have already been loaded. Essentially, I want to think of X as a block matrix (where the blocks are

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Barry Smith
How big are the sub matrices, how many MPI processes are you hoping to use, how fast/sophisticated is your file system? All of these things and others will determine whether this approach will buy you anything or not. I recommend NOT doing this first, instead just sequentially

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 12:37 PM, Michał Dereziński < michal.derezin...@gmail.com> wrote: > Great! Then I have a follow-up question: > > My goal is to be able to load the full matrix X from disk, while at the > same time in parallel, performing computations on the submatrices that have > already

Re: [petsc-users] [petsc-dev] Using PETSc MatIS, how to matmult a global IS matrix and a global vector ?

2017-05-24 Thread Barry Smith
> On May 24, 2017, at 4:45 AM, Franck Houssen wrote: > > Coming from FEM, I believe the very confusing thing is that the local size of > the user problem (math, physics point of view - DDM domain size) is not (can > not be ?) the local size expected in MatCreateIS. >

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 12:50 PM, Danyang Su wrote: > Hi Matthew and Barry, > > Thanks for the quick response. > > I also tried superlu and mumps, both work but it is about four times > slower than ILU(dt) prec through hypre, with 24 processors I have tested. > You mean the

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michał Dereziński
> Wiadomość napisana przez Matthew Knepley w dniu > 24.05.2017, o godz. 10:44: > > On Wed, May 24, 2017 at 12:37 PM, Michał Dereziński > > wrote: > Great! Then I have a follow-up question: > > My goal is to

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Jed Brown
Michał Dereziński writes: > Great! Then I have a follow-up question: > > My goal is to be able to load the full matrix X from disk, while at > the same time in parallel, performing computations on the submatrices > that have already been loaded. Essentially, I want

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Hi Matt, Yes. The matrix is 45x45 sparse. The hypre takes hundreds of iterates, not for all but in most of the timesteps. The matrix is not well conditioned, with nonzero entries range from 1.0e-29 to 1.0e2. I also made double check if there is anything wrong in the parallel version,

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Jed Brown
Okay, do you have more parameters than observations? And each segment of the matrix will be fully distributed? Do you have a parallel file system? Is your matrix sparse or dense? Michał Dereziński writes: > It is an optimization problem minimizing a convex

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michał Dereziński
> Wiadomość napisana przez Jed Brown w dniu 24.05.2017, o > godz. 12:06: > > Okay, do you have more parameters than observations? No (not necessarily). The biggest matrix is 50M observations and 12M parameters. > And each segment > of the matrix will be fully

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Hi Hong, Awesome. Thanks for testing the case. I will try your options for the code and get back to you later. Regards, Danyang On 17-05-24 12:21 PM, Hong wrote: Danyang : I tested your data. Your matrices encountered zero pivots, e.g. petsc/src/ksp/ksp/examples/tutorials (master) $

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Jed Brown
Michał Dereziński writes: >> Wiadomość napisana przez Jed Brown w dniu 24.05.2017, o >> godz. 12:06: >> >> Okay, do you have more parameters than observations? > > No (not necessarily). The biggest matrix is 50M observations and 12M >

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Matthew Knepley
On Wed, May 24, 2017 at 1:13 PM, Michał Dereziński < michal.derezin...@gmail.com> wrote: > > Wiadomość napisana przez Matthew Knepley w dniu > 24.05.2017, o godz. 10:44: > > On Wed, May 24, 2017 at 12:37 PM, Michał Dereziński gmail.com> wrote: > >> Great!

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michał Dereziński
It is an optimization problem minimizing a convex objective for a binary classification task, which I’m solving using a Tao solver. The multiplication operations are performing gradient computation for each step of the optimization. So I’m performing both a MatMult and a MatMultTranspose, in

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Hong
Danyang : I tested your data. Your matrices encountered zero pivots, e.g. petsc/src/ksp/ksp/examples/tutorials (master) $ mpiexec -n 24 ./ex10 -f0 a_react_in_2.bin -rhs b_react_in_2.bin -ksp_monitor -ksp_error_if_not_converged [15]PETSC ERROR: Zero pivot in LU factorization:

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Hong
Remove your option '-vecload_block_size 10'. Hong On Wed, May 24, 2017 at 3:06 PM, Danyang Su wrote: > Dear Hong, > > I just tested with different number of processors for the same matrix. It > sometimes got "ERROR: Arguments are incompatible" for different number of >

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Hi All, I just delete the .info file and it works without problem now. Thanks, Danyang On 17-05-24 06:32 PM, Hong wrote: Remove your option '-vecload_block_size 10'. Hong On Wed, May 24, 2017 at 3:06 PM, Danyang Su > wrote: Dear

[petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michal Derezinski
Hi, I want to be able to perform matrix operations on several contiguous submatrices of a full matrix, without allocating the memory redundantly for the submatrices (in addition to the memory that is already allocated for the full matrix). I tried using MatGetSubMatrix, but this function appears

[petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Dear All, I use PCFactorSetLevels for ILU and PCFactorSetFill for other preconditioning in my code to help solve the problems that the default option is hard to solve. However, I found the latter one, PCFactorSetFill does not take effect for my problem. The matrices and rhs as well as the

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Danyang Su
Dear Hong, I just tested with different number of processors for the same matrix. It sometimes got "ERROR: Arguments are incompatible" for different number of processors. It works fine using 4, 8, or 24 processors, but failed with "ERROR: Arguments are incompatible" using 16 or 48

Re: [petsc-users] Question on incomplete factorization level and fill

2017-05-24 Thread Barry Smith
I don't think this has anything to do with the specific solver but is because you are loading both a vector and matrix from a file and when it uses the default parallel layout for each, because you have -matload_block_size 1 and -vecload_block_size 10 they do not get the same layout.

Re: [petsc-users] Accessing submatrices without additional memory usage

2017-05-24 Thread Michał Dereziński
> Wiadomość napisana przez Jed Brown w dniu 24.05.2017, o > godz. 12:28: > > Michał Dereziński > writes: > >>> Wiadomość napisana przez Jed Brown w dniu 24.05.2017, o >>> godz. 12:06: