<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Matt, I take it then that I should ignore the indicies that are
printed and just chase<br>
the values I found up the stack to see why my preallocation missed
them.<br>
<br>
James, thanks for the comment on MatSetOptions -- that option does
remove the malloc-error-warning.<br>
I guess I now need to determine the why.<br>
<br>
-sanjay<br>
<br>
<blockquote type="cite">On Tue, Mar 12, 2013 at 1:14 AM, Sanjay
Govindjee <span dir="ltr"><<a href="mailto:s_g@berkeley.edu"
target="_blank">s_g@berkeley.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I am having a
problem with MatSetValues. I have a two processor run that
spits the following error:<br>
<br>
[0]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
/Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New
nonzero at (1,1) caused a malloc<br>
[1]PETSC ERROR: MatSetValues_MPIAIJ() line 564 in
/Users/sg/petsc-3.3-p5/src/mat/impls/aij/mpi/mpiaij.c New
nonzero at (18,-1) caused a malloc<br>
</blockquote>
<div><br>
</div>
<div style="">It is giving you local indices. This error occurs
down inside the macro in aij.h for setting a value</div>
<div style="">in a serial AIJ matrix. We have not found an easy
way to do index translation on the way up.</div>
<div style=""><br>
</div>
<div style=""> Thanks,</div>
<div style=""><br>
</div>
<div style=""> Matt</div>
</blockquote>
<br>
<br>
<div class="moz-cite-prefix">On 3/12/13 5:38 AM, Ramsey, James J CIV
(US) wrote:<br>
</div>
<blockquote
cite="mid:B5E7491E7F72164997C336AA7C85A5FC14DA31E1@ucolhp9g.easf.csd.disa.mil"
type="cite">
<pre wrap="">________________________________________
The "New nonzero at <fill in the blank> caused a malloc" error looks like what happens if the preallocation is not exact. What happens if you add
call MatSetOption(Kglobal, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE, ierr)
after your call to your preallocation subroutine?
________________________________________
Oh, of course Kglobal should be replaced by whatever matrix you are trying to set the values of.
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
-----------------------------------------------
Sanjay Govindjee, PhD, PE
Professor of Civil Engineering
Vice Chair for Academic Affairs
779 Davis Hall
Structural Engineering, Mechanics and Materials
Department of Civil Engineering
University of California
Berkeley, CA 94720-1710
Voice: +1 510 642 6060
FAX: +1 510 643 5264
<a class="moz-txt-link-abbreviated" href="mailto:s_g@berkeley.edu">s_g@berkeley.edu</a>
<a class="moz-txt-link-freetext" href="http://www.ce.berkeley.edu/~sanjay">http://www.ce.berkeley.edu/~sanjay</a>
-----------------------------------------------
New Books:
Engineering Mechanics of Deformable
Solids: A Presentation with Exercises
<a class="moz-txt-link-freetext" href="http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641">http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641</a>
<a class="moz-txt-link-freetext" href="http://ukcatalogue.oup.com/product/9780199651641.do">http://ukcatalogue.oup.com/product/9780199651641.do</a>
<a class="moz-txt-link-freetext" href="http://amzn.com/0199651647">http://amzn.com/0199651647</a>
Engineering Mechanics 3 (Dynamics)
<a class="moz-txt-link-freetext" href="http://www.springer.com/materials/mechanics/book/978-3-642-14018-1">http://www.springer.com/materials/mechanics/book/978-3-642-14018-1</a>
<a class="moz-txt-link-freetext" href="http://amzn.com/3642140181">http://amzn.com/3642140181</a>
-----------------------------------------------
</pre>
</body>
</html>