Re: [petsc-users] Understanding preallocation for MPI

2017-07-16 Thread Barry Smith
> On Jul 16, 2017, at 9:53 PM, Florian Lindner wrote: > > Hi Barry, > > Am 17.07.2017 um 10:42 schrieb Barry Smith: >>The intention with the AO is you map everything to the PETSc ordering and >> then you just work in the PETSc ordering completely, this way there is no

Re: [petsc-users] Understanding preallocation for MPI

2017-07-16 Thread Florian Lindner
Hi Barry, Am 17.07.2017 um 10:42 schrieb Barry Smith: > The intention with the AO is you map everything to the PETSc ordering and > then you just work in the PETSc ordering completely, this way there is no > "sending around with MPI preallocation information". That is your matrix >

Re: [petsc-users] Understanding preallocation for MPI

2017-07-16 Thread Barry Smith
Florian, The intention with the AO is you map everything to the PETSc ordering and then you just work in the PETSc ordering completely, this way there is no "sending around with MPI preallocation information". That is your matrix assembly and preallocation (as well as vectors) always

Re: [petsc-users] Understanding preallocation for MPI

2017-07-16 Thread Florian Lindner
Hello, Am 11.07.2017 um 02:45 schrieb Barry Smith: > > You might consider using > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPreallocateInitialize.html > and >

Re: [petsc-users] Understanding preallocation for MPI

2017-07-10 Thread Barry Smith
You might consider using http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPreallocateInitialize.html and http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPreallocateSetLocal.html#MatPreallocateSetLocal and friends These take out some of the busywork

Re: [petsc-users] Understanding preallocation for MPI

2017-07-10 Thread Stefano Zampini
Look at the function that begins at line 1050 as the link should redirect to Il 10 Lug 2017 11:18 AM, "Florian Lindner" ha scritto: Hey Stefano, Am 10.07.2017 um 16:36 schrieb Stefano Zampini: > Florian, > > Perhaps you might want to take a look at how this is done for

Re: [petsc-users] Understanding preallocation for MPI

2017-07-10 Thread Florian Lindner
Hey Stefano, Am 10.07.2017 um 16:36 schrieb Stefano Zampini: > Florian, > > Perhaps you might want to take a look at how this is done for MatIS > > https://bitbucket.org/petsc/petsc/src/f9d5775f43f69cbce5a7014a6ce3b24cc0e1214a/src/mat/impls/is/matis.c?at=master=file-view-default#matis.c-1050

Re: [petsc-users] Understanding preallocation for MPI

2017-07-10 Thread Stefano Zampini
Florian, Perhaps you might want to take a look at how this is done for MatIS https://bitbucket.org/petsc/petsc/src/f9d5775f43f69cbce5a7014a6ce3b24cc0e1214a/src/mat/impls/is/matis.c?at=master=file-view-default#matis.c-1050 Stefano Il 10 Lug 2017 10:23 AM, "Florian Lindner"

Re: [petsc-users] Understanding preallocation for MPI

2017-07-10 Thread Florian Lindner
Hey, one more question about preallocation: I can determine if a column index is diagonal or off-diagonal using that code if (col >= col_range_start and col < col_range_end) d_nnz[relative_row]++; else o_nnz[relative_row]++; My code, however uses index sets from which a

Re: [petsc-users] Understanding preallocation for MPI

2017-07-07 Thread Matthew Knepley
On Fri, Jul 7, 2017 at 2:49 AM, Dave May wrote: > On Fri, 7 Jul 2017 at 11:31, Florian Lindner wrote: > >> Hello, >> >> I'm having some struggle understanding the preallocation for MPIAIJ >> matrices, especially when a value is in off-diagonal >>

Re: [petsc-users] Understanding preallocation for MPI

2017-07-07 Thread Dave May
On Fri, 7 Jul 2017 at 11:31, Florian Lindner wrote: > Hello, > > I'm having some struggle understanding the preallocation for MPIAIJ > matrices, especially when a value is in off-diagonal > vs. diagonal block. > > The small example program is at https://pastebin.com/67dXnGm3

[petsc-users] Understanding preallocation for MPI

2017-07-07 Thread Florian Lindner
Hello, I'm having some struggle understanding the preallocation for MPIAIJ matrices, especially when a value is in off-diagonal vs. diagonal block. The small example program is at https://pastebin.com/67dXnGm3 In general it should be parallel, but right now I just run it in serial. According