<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 9, 2015 at 8:47 AM, Serge Van Criekingen <span dir="ltr"><<a href="mailto:serge.van.criekingen@u-picardie.fr" target="_blank">serge.van.criekingen@u-picardie.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Using petsc4py, I wish to control the distribution of matrix rows/columns among the processors.<br>
I found out how to do this for vectors in the archives:<br>
<a href="https://lists.mcs.anl.gov/mailman/htdig/petsc-users/2013-February/016358.html" target="_blank">https://lists.mcs.anl.gov/<u></u>mailman/htdig/petsc-users/<u></u>2013-February/016358.html</a><br>
But how can I do this with matrices? In other words, how is the "MatSetSizes" PETSc routine interfaced in petsc4py?<br>
<br>
To take an example, how can I specify the local number of rows/columns when running this minimal code in parallel:<br>
<br>
mpi_rank = PETSc.COMM_WORLD.getRank()<br>
M = PETSc.Mat().create(comm=PETSc.<u></u>COMM_WORLD)<br>
M.setType('aij')<br>
M.setSizes((8,8),bsize=1)<br></blockquote><div><br></div><div>For example</div><div><br></div><div> M.setSizes(((locSize, PETSC_DETERMINE), (locSize, PETSC_DETERMINE)), bsize=1)</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
M.setUp()<br>
PETSc.Sys.syncPrint("rank: ",mpi_rank," M.sizes: ",M.sizes)<br>
PETSc.Sys.syncFlush()<br>
<br>
Thanks a lot,<br>
Serge<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>