<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1493033032302_14257">Hello,</div><div id="yui_3_16_0_ym19_1_1493033032302_13790"><br></div><div id="yui_3_16_0_ym19_1_1493033032302_13789">I see memory usage that confuses me:</div><div id="yui_3_16_0_ym19_1_1493033032302_13788"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_15260">me@blah:src$ ./example1 -n_row 200 -n_col 2000 -sparsity 0.03 -mat_type mpidenseInitialize<br id="yui_3_16_0_ym19_1_1493033032302_14304">Got options<br id="yui_3_16_0_ym19_1_1493033032302_14305">Create and assemble matrix<br id="yui_3_16_0_ym19_1_1493033032302_14306">Assembled<br id="yui_3_16_0_ym19_1_1493033032302_14307">Peak RSS 21 Mb<br id="yui_3_16_0_ym19_1_1493033032302_14308">me@blah:~/src$ ./example1 -n_row 200 -n_col 2000 -sparsity 0.03 -mat_type mpiaij<br id="yui_3_16_0_ym19_1_1493033032302_14309">Initialize<br id="yui_3_16_0_ym19_1_1493033032302_14310">Got options<br id="yui_3_16_0_ym19_1_1493033032302_14311">Create and assemble matrix<br id="yui_3_16_0_ym19_1_1493033032302_14312">Assembled<br id="yui_3_16_0_ym19_1_1493033032302_14313">Peak RSS 19 Mb<br id="yui_3_16_0_ym19_1_1493033032302_14314"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_13786">I put my example code on Github so I can more effectively communicate my question. And here is my question: why does the program as written use so much memory for the sparse case - matrix type mpiaij? Note that I'm creating a random dense matrix with at most 3% non-zero entries since this is my use case.<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_15688"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_15697">I have read the relevant portions of the user's manual and searched for answers. Have I missed a resource that can answer my question?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_15757"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1493033032302_15737"><a href="https://github.com/dtsmith2001/hpc" class="enhancr2_091ed883-8ee2-c9df-4955-6e64f88122d6" id="yui_3_16_0_ym19_1_1493033032302_16258">dtsmith2001/hpc</a><br></div><div id="yui_3_16_0_ym19_1_1493033032302_16300"><br></div><div id="enhancr2_091ed883-8ee2-c9df-4955-6e64f88122d6" class="yahoo-link-enhancr-card  ymail-preserve-class ymail-preserve-style" style="max-width:400px;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;" data-url="https://github.com/dtsmith2001/hpc" data-type="yenhancr" data-category="object" data-embed-url="" data-size="medium" dir="ltr" contenteditable="false"> <a href="https://github.com/dtsmith2001/hpc" style="text-decoration:none !important; color: #000 !important;" class="yahoo-enhancr-cardlink" target="_blank" rel="noreferrer" id="yui_3_16_0_ym19_1_1493033032302_16281"> <table class="card-wrapper yahoo-ignore-table" style="max-width:400px;" id="yui_3_16_0_ym19_1_1493033032302_16280" cellspacing="0" cellpadding="0" border="0"> <tbody id="yui_3_16_0_ym19_1_1493033032302_16279"><tr id="yui_3_16_0_ym19_1_1493033032302_16278"> <td id="yui_3_16_0_ym19_1_1493033032302_16277" width="400"> <table class="card yahoo-ignore-table" style="max-width:400px;" id="yui_3_16_0_ym19_1_1493033032302_16276" width="100%" cellspacing="0" cellpadding="0" border="0"> <tbody id="yui_3_16_0_ym19_1_1493033032302_16275"><tr id="yui_3_16_0_ym19_1_1493033032302_16274"> <td class="card-primary-image-cell" style="background:#000 url('https://s.yimg.com/vv//api/res/1.2/qtxXcDily.BIfxkxFPDCNg--/YXBwaWQ9bWFpbDtmaT1maWxsO2g9MjAwO3c9NDAw/https://avatars0.githubusercontent.com/u/3189861?v=3&s=400.cf.jpg') no-repeat center center;background-size:cover;height:200px;position:relative;" id="yui_3_16_0_ym19_1_1493033032302_16273" valign="top" bgcolor="#000000" background="https://s.yimg.com/vv//api/res/1.2/qtxXcDily.BIfxkxFPDCNg--/YXBwaWQ9bWFpbDtmaT1maWxsO2g9MjAwO3c9NDAw/https://avatars0.githubusercontent.com/u/3189861?v=3&s=400.cf.jpg"> <!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:400px;height:218px;position:absolute;top:0;left:0;"><v:fill type="frame" color="#000000" src="https://s.yimg.com/vv//api/res/1.2/qtxXcDily.BIfxkxFPDCNg--/YXBwaWQ9bWFpbDtmaT1maWxsO2g9MjAwO3c9NDAw/https://avatars0.githubusercontent.com/u/3189861?v=3&s=400.cf.jpg"/></v:rect><![endif]--> <table class="yahoo-ignore-table" valign="top" style="width:100%;" id="yui_3_16_0_ym19_1_1493033032302_16272" cellspacing="0" cellpadding="0" border="0"> <tbody id="yui_3_16_0_ym19_1_1493033032302_16271"><tr id="yui_3_16_0_ym19_1_1493033032302_16270"> <td style="background:transparent url('https://s.yimg.com/nq/storm/assets/enhancrV2/12/overlay-tile.png') repeat left top;height:200px;" id="yui_3_16_0_ym19_1_1493033032302_16269" valign="top" bgcolor="transparent" background="https://s.yimg.com/nq/storm/assets/enhancrV2/12/overlay-tile.png"> <!--[if gte mso 9]><v:rect fill="true" stroke="false" style="width:400px;height:218px;position:absolute;top:-18px;left:0;"><v:fill type="pattern" color="#000000" src="https://s.yimg.com/nq/storm/assets/enhancrV2/12/overlay-tile.png"/><v:textbox inset="0,0,20px,0"><![endif]--> <table class="yahoo-ignore-table" style="width:100%;height:185px;min-height:185px;" id="yui_3_16_0_ym19_1_1493033032302_16268" height="185"> <tbody id="yui_3_16_0_ym19_1_1493033032302_16267"><tr id="yui_3_16_0_ym19_1_1493033032302_16266"> <td class="card-richInfo2" style="text-align:left;text-align:left;padding:15px 0 0 15px;vertical-align:top;" id="yui_3_16_0_ym19_1_1493033032302_16768">  </td> <td class="card-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;" id="yui_3_16_0_ym19_1_1493033032302_16265"> <div class="card-share-container"></div> </td> </tr> </tbody></table> <!--[if gte mso 9]></v:textbox></v:rect><![endif]--> </td> </tr> </tbody></table> </td> </tr> <tr> <td> <table class="card-info yahoo-ignore-table" style="background:#fff;position:relative;z-index:2;width:95%;max-width:380px;border:1px solid #e0e4e9;border-bottom:3px solid #010101;margin-top:-40px;margin-left:auto;margin-right:auto;" cellspacing="0" cellpadding="0" align="center" border="0"> <tbody><tr> <td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;"> <img class="card-object-1 yahoo-ignore-inline-image ymail-preserve-class" src="https://s.yimg.com/nq/storm/assets/enhancrV2/23/logos/github.png" style="min-width:32px;border:1px solid #e0e4e9;margin-top:3px;" data-id="c3247034-c350-156f-9223-e5de78e7171d" height="32">  </td> <td style="vertical-align:middle;padding:16px 12px;width:99%;"> <h2 class="card-title" style="font-size: 16px; line-height:19px; margin:0 0 4px 0;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;word-break:break-word;">dtsmith2001/hpc</h2>  <div class="card-description" style="font-size:11px;line-height:15px;color:#999;word-break:break-word;">hpc - High Performance Computing Explorations using PETSc and SLEPc</div> </td> <td style="text-align:right;padding:16px 12px 16px 0;">  </td> </tr> </tbody></table> </td> </tr> </tbody></table> </td> </tr> </tbody></table> </a></div><div><br></div><div id="yui_3_16_0_ym19_1_1493033032302_13785"><br></div><div id="yui_3_16_0_ym19_1_1493033032302_16243">Dale</div><div id="yui_3_16_0_ym19_1_1493033032302_15791"><br></div></div></body></html>