<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 19, 2016 at 4:34 AM, John Albequerque <span dir="ltr"><<a href="mailto:johncfdcfd@gmail.com" target="_blank">johncfdcfd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Currently I have used single processor. And without the Preallocation it works fine. And gives me the correct output as well. I have posted the full code for reference. <br></div><b>Here:</b> <a href="http://pastebin.com/kWUGHqSM" target="_blank">http://pastebin.com/kWUGHqSM</a></div></blockquote><div><br></div><div>Look at the last row. Your condition 'j >= i' will produce no off-diagonal rows here, but</div><div>clearly you have them, and this is the error you are getting.</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 class="gmail_extra"><div class="gmail_quote">On Fri, Feb 19, 2016 at 3:01 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Feb 19, 2016 at 3:27 AM, John Albequerque <span dir="ltr"><<a href="mailto:johncfdcfd@gmail.com" target="_blank">johncfdcfd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>I came up with this could you please have a look at it as I am not getting it. I am getting an error<br><br><b>New nonzero at (0,4) caused a malloc<br><br></b><a href="http://pastebin.com/ZxT7SWtc" target="_blank">http://pastebin.com/ZxT7SWtc</a><br><br></div>Could you please have a look at it.<br></div></div></div></blockquote><div><br></div></span><div>It looks like you are only allocating the upper triangle:</div><div><br></div><div><div><span style="white-space:pre-wrap"> </span>if((j-i<=3) && (j>=i))</div><div> <span style="white-space:pre-wrap"> </span>values[(i-low)*nc+j]=1;</div><div><span style="white-space:pre-wrap"> </span>else</div><div><span style="white-space:pre-wrap"> </span>values[(i-low)*nc+j]=0;</div></div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>---------------<br></div>Thanks,<br></div>John Albequerque<div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 19, 2016 at 1:25 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Feb 19, 2016 at 1:50 AM, John Albequerque <span dir="ltr"><<a href="mailto:johncfdcfd@gmail.com" target="_blank">johncfdcfd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Could someone help me setting up this matrix i.e from preallocation to Set Values for an MPIAIJ matrix which has its entries.<br><b><br>1 1 1 1 0 0 0 0<br>0 1 1 1 1 0 0 0<br>0 0 1 1 1 1 0 0<br>0 0 0 1 1 1 1 0<br>0 0 0 0 1 1 1 1</b><br><br>I am trying to do it from 3 days now but not able to figure it out. Could someone please help me do this.</div></div></div></div></blockquote><div><br></div></span><div>It will be enough to say that each row has 3 off-diagonal values, so you can use the simplified preallocation rather</div><div>than giving a value for each row individually.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Thanks.<br><br>----<br></div>John Albequerque.<br><div><br><br></div></div><span><font color="#888888">
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><span><font color="#888888"><div><br></div>-- <br><div>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</div>
</font></span></font></span></font></span></div></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></span></div><span class="HOEnZb"><font color="#888888"><span><br><br clear="all"><div><br></div>-- <br><div>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</div>
</span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>