<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> 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. <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 23, 2021, at 9:29 PM, 王 杰 <<a href="mailto:wangjieneu@hotmail.com" class="">wangjieneu@hotmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">hello,</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">I use petsc 3.14.5 with OpenMPI 3.1.6 in Ubuntu 18.04.5.</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">I don't well understand the routine <span class="Apple-converted-space"> </span><u style="text-decoration-line: underline; background-color: rgb(255, 255, 255);" class="">MatCreateAIJ</u><span style="text-decoration-line: underline; background-color: rgb(255, 255, 255); display: inline !important;" class="">(</span><span style="background-color: rgb(255, 255, 255); display: inline !important;" class="">MPI_Comm comm,</span><span style="background-color: rgb(255, 255, 255); font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(200, 38, 19); display: inline !important;" class=""><b class="">PetscInt</b></span><span style="background-color: rgb(255, 255, 255); color: rgb(200, 38, 19); display: inline !important;" class=""><b class=""><span class="Apple-converted-space"> </span>m</b></span><span style="background-color: rgb(255, 255, 255); display: inline !important;" class="">, </span><span style="background-color: rgb(255, 255, 255); font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(200, 38, 19); display: inline !important;" class=""><b class="">PetscInt<span class="Apple-converted-space"> </span></b></span><span style="background-color: rgb(255, 255, 255); font-family: calibri, helvetica, sans-serif; font-size: 12pt; color: rgb(200, 38, 19); display: inline !important;" class=""><b class="">n,</b></span><span style="background-color: rgb(255, 255, 255); display: inline !important;" class="">PetscInt M,PetscInt N,PetscInt d_nz,PetscInt *d_nnz, PetscInt o_nz,PetscInt *o_nnz,Mat *A</span><span style="text-decoration-line: underline; background-color: rgb(255, 255, 255); display: inline !important;" class="">)</span>. </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><br class=""></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">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.</div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""> </div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class="">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 <u style="background-color: rgb(255, 255, 255);" class="">MatCreateAIJ</u><span style="background-color: rgb(255, 255, 255);" class="">in different process?</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="background-color: rgb(255, 255, 255);" class="">Thanks.</span></div><div style="font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;" class=""><span style="background-color: rgb(255, 255, 255);" class=""> Wang Jie</span></div></div></blockquote></div><br class=""></body></html>