Yes; but note that for square matrices using n == m almost always makes sense, otherwise the input vector to the matrix-vector product will have a different layout than the output vector. Code code is difficult to manage.
> On Apr 23, 2021, at 9:29 PM, 王 杰 <[email protected]> wrote: > > hello, > > I use petsc 3.14.5 with OpenMPI 3.1.6 in Ubuntu 18.04.5. > > I don't well understand the routine MatCreateAIJ(MPI_Comm comm,PetscInt m, > PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,PetscInt *d_nnz, PetscInt > o_nz,PetscInt *o_nnz,Mat *A). > > I have tow process. The total number of global index is 2188. The first one > deal with the global index 0~1400 with ghost node 1401~1500 and 2001~2188. > The second process deal with globla index 1400~2100 with ghost node 601~700 > and 701~800. This is dynamiclly assigned by load balancer. > > I want to assign the first 1400 rows to the first process and the remained > 788 rows in the second process. Can I give different values to m and n in the > routine MatCreateAIJin different process? > > Thanks. > Wang Jie
