<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi Developers,<o:p></o:p></p><p class=MsoNormal>Here’s one more email about memory settings, but this time I have an idea for how to avoid some of the confusion that has produced to many emails in the past.<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal>In the file /src/nh99/xmodelm3.cpp, the following code deals with the command line inputs for gbs:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'> nopt=get_option_number("-gbs",<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> "-gbs option needs positive integer -- ignored",lssz);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> if (nopt>-1 && lssz>0) {
<o:p></o
oNormal><span style='font-family:"Courier New"'> gradient_structure::set_GRADSTACK_BUFFER_SIZE<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> (lssz/sizeof(grad_stack_entry));<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'> }<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This appears to take the user’s input, “lssz”, and enter it into the function “set_GRADSTACK_BUFFER_SIZE” after first dividing by the “sizeof(grad_stack_entry)”.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>However, in the TPL file, if we use the command<o:p></o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'> gradient_structure::set_GRADSTACK_BUFFER_SIZE(nnn); <o:p></o:p></span></p><p class=MsoNormal>this division by the grad stac
k size d
e same numerical value produces a different result.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Would it be possible to change the set_GRADSTACK_BUFFER_SIZE (in /src/linad99/gs_set.cpp) so that the division by sizeof(grad_stack_entry) occurs inside that function and thus applies equally to inputs on the command line and in the TPL file?<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><o:p> </o:p></p><p class=MsoNormal style='text-autospace:none'>The AUTODIF manual (page 9-1) says “For historical reasons, the actual amount of memory (in bytes) reserved for the buffer is equal to the value of GRADSTACK_BUFFER_SIZE multiplied by the size (in bytes) of an autodif structure, grad_-stack_entry.” However, perhaps those historical reasons wouldn’t keep us from making things more consistent in the future.<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><o:p> </o:p></p><p class=MsoNormal>-Ian<o:p></o:p><
/p></div