<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px">You are correct, and that is why I'm using the peak RSS. The total memory should be lower to reflect the sparse versus dense structure.<br> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: 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 Monday, April 24, 2017 11:28 AM, "Zhang, Hong" <hongzhang@anl.gov> wrote:<br></font></div> <br><br> <div class="y_msg_container"><div id="yiv5090859177"><div>
The peak RSS does not tell you how much memory the matrix takes. It may include many things such as the binary, the libraries linked to it, and stack and heap memory.
<div class="yiv5090859177"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177">Hong (Mr.)<br class="yiv5090859177" clear="none">
<div class="yiv5090859177yqt8050180386" id="yiv5090859177yqt78088"><div class="yiv5090859177">
<div class="yiv5090859177"><br class="yiv5090859177" clear="none">
<div>
<blockquote class="yiv5090859177" type="cite">
<div class="yiv5090859177">On Apr 24, 2017, at 9:46 AM, D D <<a rel="nofollow" shape="rect" class="yiv5090859177" ymailto="mailto:driver.dan12@yahoo.com" target="_blank" href="mailto:driver.dan12@yahoo.com">driver.dan12@yahoo.com</a>> wrote:</div>
<br class="yiv5090859177Apple-interchange-newline" clear="none">
<div class="yiv5090859177">
<div class="yiv5090859177">
<div class="yiv5090859177" style="background-color:rgb(255, 255, 255);font-family:'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:13px;">
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14257">Hello,</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_13790"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_13789">I see memory usage that confuses me:</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_13788"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" dir="ltr" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_15260">me@blah:src$ ./example1 -n_row 200 -n_col 2000 -sparsity 0.03 -mat_type mpidenseInitialize<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14304" clear="none">
Got options<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14305" clear="none">
Create and assemble matrix<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14306" clear="none">
Assembled<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14307" clear="none">
Peak RSS 21 Mb<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14308" clear="none">
me@blah:~/src$ ./example1 -n_row 200 -n_col 2000 -sparsity 0.03 -mat_type mpiaij<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14309" clear="none">
Initialize<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14310" clear="none">
Got options<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14311" clear="none">
Create and assemble matrix<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14312" clear="none">
Assembled<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14313" clear="none">
Peak RSS 19 Mb<br class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_14314" clear="none">
<br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" dir="ltr" id="yiv5090859177yui_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 class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" dir="ltr" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_15688"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" dir="ltr" id="yiv5090859177yui_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 class="yiv5090859177" dir="ltr" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_15757"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" dir="ltr" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_15737"><a rel="nofollow" shape="rect" class="yiv5090859177enhancr2_091ed883-8ee2-c9df-4955-6e64f88122d6" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16258" target="_blank" href="https://github.com/dtsmith2001/hpc">dtsmith2001/hpc</a><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16300"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177ymail-preserve-class yiv5090859177ymail-preserve-style yiv5090859177yahoo-link-enhancr-card" dir="ltr" id="yiv5090859177enhancr2_091ed883-8ee2-c9df-4955-6e64f88122d6" 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">
<a rel="nofollow" shape="rect" class="yiv5090859177yahoo-enhancr-cardlink" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16281" target="_blank" href="https://github.com/dtsmith2001/hpc" style="text-decoration:none;">
<table class="yiv5090859177card-wrapper yiv5090859177yahoo-ignore-table" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16280" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16279"><tr class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16278"><td colspan="1" rowspan="1" class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16277" width="400">
<table class="yiv5090859177card yiv5090859177yahoo-ignore-table" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16276" style="max-width:400px;" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16275"><tr class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16274"><td colspan="1" rowspan="1" class="yiv5090859177card-primary-image-cell" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16273" 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;" 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.jp
g">
<table class="yiv5090859177yahoo-ignore-table" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16272" style="width:100%;" cellspacing="0" cellpadding="0" border="0"><tbody class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16271"><tr class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16270"><td colspan="1" rowspan="1" class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16269" style="background:transparent url('https://s.yimg.com/nq/storm/assets/enhancrV2/12/overlay-tile.png') repeat left top;height:200px;" valign="top" bgcolor="transparent" background="https://s.yimg.com/nq/storm/assets/enhancrV2/12/overlay-tile.png">
<table class="yiv5090859177yahoo-ignore-table" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16268" style="width:100%;height:185px;min-height:185px;" height="185"><tbody class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16267"><tr class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16266"><td colspan="1" rowspan="1" class="yiv5090859177card-richInfo2" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16768" style="text-align:left;text-align:left;padding:15px 0 0 15px;vertical-align:top;">
</td><td colspan="1" rowspan="1" class="yiv5090859177card-actions" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16265" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;">
<div class="yiv5090859177card-share-container"></div>
</td></tr></tbody></table>
</td></tr></tbody></table>
</td></tr><tr class="yiv5090859177"><td colspan="1" rowspan="1" class="yiv5090859177">
<table class="yiv5090859177card-info yiv5090859177yahoo-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 class="yiv5090859177"><tr class="yiv5090859177"><td colspan="1" rowspan="1" class="yiv5090859177" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;">
<img class="yiv5090859177card-object-1 yiv5090859177yahoo-ignore-inline-image yiv5090859177ymail-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;" height="32">
</td><td colspan="1" rowspan="1" class="yiv5090859177" style="vertical-align:middle;padding:16px 12px;width:99%;">
<h2 class="yiv5090859177card-title" style="font-size:16px;line-height:19px;margin:0 0 4px 0;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;">
dtsmith2001/hpc</h2>
<div class="yiv5090859177card-description" style="font-size:11px;line-height:15px;color:#999;">
hpc - High Performance Computing Explorations using PETSc and SLEPc</div>
</td><td colspan="1" rowspan="1" class="yiv5090859177" style="text-align:right;padding:16px 12px 16px 0;"></td></tr></tbody></table>
</td></tr></tbody></table>
</td></tr></tbody></table>
</a></div>
<div class="yiv5090859177"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_13785"><br class="yiv5090859177" clear="none">
</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_16243">Dale</div>
<div class="yiv5090859177" id="yiv5090859177yui_3_16_0_ym19_1_1493033032302_15791"><br class="yiv5090859177" clear="none">
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="yiv5090859177" clear="none">
</div>
</div></div>
</div>
</div></div><br><br></div> </div> </div> </div></div></body></html>