<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 14, 2014 at 1:31 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Xiangdong <<a href="mailto:epscodes@gmail.com">epscodes@gmail.com</a>> writes:<br>
<br>
> I tired that, however it does not work either.<br>
<br>
</div>"does not work" is not specific.<br>
<div class=""><br>
> I call the function like this:<br>
> double myarray[10];<br>
> int nmax=10;<br>
> PetscOptionsGetRealArray(PETSC_NULL,'-myarray', myarray, &nmax,&flg);<br>
<br>
</div>printf("nmax = %d\n",nmax);<br>
for (i=0; i<nmax; i++) {<br>
printf(" %g\n",myarray[i]);<br>
}<br>
<br>
<br>
Also, please just use NULL.<br></blockquote><div><br></div><div><br></div><div>Now I see some random behavior. After compiling the code, for the same command line input, the output sometimes are correct (print values 1,2,3,4,5 with nmax=5), but sometime output all zeros (nmax is zero). I did not change anything, but just running same input many times.</div>
<div><br></div><div>Any hints for this random behavior? Thank you.</div><div><br></div><div>Xiangdong<br></div><div><br></div><div> </div></div><br></div></div>