<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DA link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> int rank;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> MPI_Comm_rank(PETSC_COMM_WORLD,&rank);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> MatView((*FD).ddx,PETSC_VIEWER_STDOUT_WORLD);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> int fr,lr;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> MatGetOwnershipRange((*FD).ddx,&fr,&lr);<o:p></o:p></span></p><p class=MsoNormal style='text-indent:4.5pt'><span lang=EN-US>printf("process %d has rows %d to %d\n",rank,fr,lr);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Produce the following output:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>>mpirun -np 4 ./petsclapl <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Matrix Object: 1 MPI processes<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> type: mpiaij<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> row 0: (0, 5) (1, 5) (12, 0) (13, 0) (108, 0) (109, 0) <o:p></o:p></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)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>[snip]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> process 0 has rows 0 to 30<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> process 1 has rows 30 to 60<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> process 2 has rows 60 to 90<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> process 3 has rows 90 to 120<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></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?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>---<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>yours sincerily<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Frederik Treue<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>