On Mon, Dec 5, 2011 at 6:48 AM, Treue, Frederik <span dir="ltr">&lt;<a href="mailto:frtr@risoe.dtu.dk">frtr@risoe.dtu.dk</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="DA" link="blue" vlink="purple"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US">I’m confused about the matview command, or rather, it’s output. The following lines of code:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">  int rank;<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">  MPI_Comm_rank(PETSC_COMM_WORLD,&amp;rank);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">  MatView((*FD).ddx,PETSC_VIEWER_STDOUT_WORLD);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">  int fr,lr;<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">  MatGetOwnershipRange((*FD).ddx,&amp;fr,&amp;lr);<u></u><u></u></span></p><p class="MsoNormal" style="text-indent:4.5pt">
<span lang="EN-US">printf(&quot;process %d has rows %d to %d\n&quot;,rank,fr,lr);<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Produce the following output:<u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US">&gt;mpirun -np 4 ./petsclapl <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> Matrix Object: 1 MPI processes<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">   type: mpiaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> row 0: (0, 5)  (1, 5)  (12, 0)  (13, 0)  (108, 0)  (109, 0) <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> row 1: (0, -5)  (1, 0)  (2, 5)  (12, 0)  (13, 0)  (14, 0)  (108, 0)  (109, 0)  (110, 0)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">[snip]<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> process 0 has rows 0 to 30<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> process 1 has rows 30 to 60<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> process 2 has rows 60 to 90<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"> process 3 has rows 90 to 120<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">My question is this: How come the MatView command states 1 MPI processes, while, when I use GetOwnershipRange, the (expected) division into ¼ of the rows at each process is reported? Is the MatView “processes” the process of the viewer? And more importantly, what is the actual position of my matrix – is it on 1 or on 4 processes?</span></p>
</div></div></blockquote><div><br></div><div>This is a little confusing. We gather the matrix onto process 0 so we can print it, so it shows</div><div>1 process.</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;">
<div lang="DA" link="blue" vlink="purple"><div><p class="MsoNormal"> </p><p class="MsoNormal"><span lang="EN-US">---<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">yours sincerily<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Frederik Treue<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>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<br>