<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span id="yui_3_16_0_ym19_1_1487214835214_31178">super fast response, really appreciate Barry !</span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span id="yui_3_16_0_ym19_1_1487214835214_31313">- MAT_STRUCTURALLY_SYMMETRIC</span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span id="yui_3_16_0_ym19_1_1487214835214_31311">I quoted the wrong option - I think it is MAT_SYMMETRIC - so for this, it should ok if I input lower triangle or upper triangle data right ?</span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span><br></span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><span id="yui_3_16_0_ym19_1_1487214835214_31547">Back to the matrix and RHS distribution question :</span></div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr">- will the result X also follow the same row distribution as A and b ?</div><div id="yui_3_16_0_ym19_1_1487214835214_31091" dir="ltr"><br></div><div></div><div id="yui_3_16_0_ym19_1_1487214835214_31092"> </div><div class="signature" id="yui_3_16_0_ym19_1_1487214835214_31093">rgds<br>lixin</div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Thursday, 16 February 2017, 12:13, Barry Smith <bsmith@mcs.anl.gov> wrote:<br></font></div> <br><br> <div class="y_msg_container"><br clear="none">> On Feb 15, 2017, at 9:57 PM, lixin chu <<a shape="rect" ymailto="mailto:lixin_chu@yahoo.com" href="mailto:lixin_chu@yahoo.com">lixin_chu@yahoo.com</a>> wrote:<br clear="none">> <br clear="none">> Hello,<br clear="none">> Newbie question again - data storage and distribution related this time <br clear="none">> <br clear="none">> I have briefly looked at the user manual, and searched forum, trying to get some basic understanding of the data storage and distribution. Some questions I have:<br clear="none">> <br clear="none">> 1. Sequential vs. Parallel<br clear="none">> I assume that by 'sequential', we mean the matrix/vector is created in one process only ?<br clear="none"><br clear="none">> Then if this correct, I can assume that 'parallel' means each process will create a sub-matrix/vector for itself ?<br clear="none"><br clear="none"> In PETSc language parallel means that parts of the matrix/vector are stored on each process. <br clear="none">> <br clear="none">> Will each process eventually have the complete matrix and the RHS vector after MatAssemblyBegin() and MatAssemblyEnd(), before solve starts ?<br clear="none"><br clear="none"> No, each process contains part of the matrix and part of the vector. If you stored the entire matrix on each process this would limit how large a problem you could run based on the memory had on one process.<br clear="none"><br clear="none">> <br clear="none">> 2. How the matrix/vector is split among the processes ?<br clear="none">> I think matrix will be split by blocks of rows ?<br clear="none"><br clear="none"> Yes<br clear="none"><br clear="none">> Does PETSc equally divide the matrix rows (with the last taking the remainder ) ?<br clear="none"><br clear="none"> More or less. You can set how the rows are divided by using MatSetSizes() and you can use MatGetOwnershipRange() to determine how it decided to split the rows.<br clear="none"><br clear="none">> <br clear="none">> If I want to create the matrix in a parallel way, do I have to divide the rows equally, or different process can have different number of rows, and some may not have any rows ?<br clear="none"><br clear="none"> You can using MatSetSizes() do it anyway you want. BUT if you give some processes many rows and others zero rows you will not be using the parallel machine efficiently since some processes will have lots of work (and memory demands) and others will have no work. <br clear="none">> <br clear="none">> Does RHS vector also need to be split in the exactly same blocks of rows as the matrix A (same start and end row number for the same process) ?<br clear="none"><br clear="none"> Yes<br clear="none"><br clear="none">> <br clear="none">> <br clear="none">> 3. MAT_STRUCTURALLY_SYMMETRIC<br clear="none">> Do I have to input the upper triangle portion of non zero values, or lower triangle is also fine ?<br clear="none"><br clear="none"> Structurally symmetric only means the nonzero pattern below the diagonal is the same as above, the numerical values below the diagonal may be different than above so you always need to provide all the values.<br clear="none"><br clear="none">> <br clear="none">> <br clear="none">> 4. Given the matrix A and RHS b, data type and sparsity, is there a way to estimate the total RAM needed for the solve phase, let's say for GMRES algorithm ?<br clear="none"><br clear="none"> Not really. It is very complicated based on the preconditioned used. Just for the GMRES solver, not counting memory for the preconditioner it is roughly restart + seven vectors worth of memory.<br clear="none"><br clear="none"> Barry<div class="yqt6740343438" id="yqtfd51622"><br clear="none"><br clear="none">> <br clear="none">> many thanks !<br clear="none">> <br clear="none">> rgds<br clear="none">> LX<br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>