Thanks, Matt. On Wed, Apr 14, 2021 at 5:55 PM Matthew Knepley <[email protected]> wrote:
> On Wed, Apr 14, 2021 at 5:56 PM Sam Guo <[email protected]> wrote: > >> Dear PETSc dev team, >> If I want PETSc to use my own parallel partition(instead of PETSc >> "evenly" partition rows), I assume I can provide local rows/columns as >> follows. >> >> MatCreateShell >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateShell.html#MatCreateShell>(MPI_Comm >> >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/MPI_Comm.html#MPI_Comm> >> comm,PetscInt >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt> >> m,PetscInt >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt> >> n,PetscInt >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt> >> M,PetscInt >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscInt.html#PetscInt> >> N,void *ctx,Mat >> <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/Mat.html#Mat> >> *A) >> >> If that's the case, what role does local columns play? Memory >> allocation? Should I use n (the global rows) or local rows or PETSC_DECIDE >> in this case? >> > > The only role played by n is to match this matrix with parallel vectors > that you want it to act on. The local sizes should match. For square > matrices, this usually > means you match the local row size. > > Thanks, > > Matt > > >> Thanks, >> Sam >> > > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > > https://www.cse.buffalo.edu/~knepley/ > <http://www.cse.buffalo.edu/~knepley/> >
