Re: Fwd: AMD x86_64 dMassCheck() and bNormalizationResult errors

"Bram Stolk" <[email protected]> Mon, 19 Nov 2007 07:22:34 -0800
Newsgroups gmane.comp.lib.ode
Message-ID <[email protected]>
--===============2086906666==
Content-Type: multipart/alternative; 
	boundary="----=_Part_19305_32285513.1195485754328"

------=_Part_19305_32285513.1195485754328
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Nov 19, 2007 12:18 AM, Funky Fred <[email protected]> wrote:

>
> Ok, narrowed it down a bit more. Looks like the body->avel value in
> dxStepBody is NaN.
> I stepped through things a little bit more and narrowed it down to the
> dxQuickStepper call @868 in quickstep.cpp
> If I'm reading the gdb output right (it's getting late). It looks like the
> dMULTIPLYADD0_331 macro/function is doing it.


Looking at the code, a logical cause for this would be a zero mass, causing
a NaN body_invMass;

I expect that if you do an...
ASSERT(!dIsNan(body[i]->invMass));
...in that code, it will be triggered.

  Bram


        // compute the velocity update:
        // add stepsize * invM * fe to the body velocity

        IFTIMING (dTimerNow ("compute velocity update");)
        for (i=0; i<nb; i++) {
                dReal body_invMass = body[i]->invMass;
                for (j=0; j<3; j++) body[i]->lvel[j] += stepsize *
body_invMass * body[i]->facc[j];
                for (j=0; j<3; j++) body[i]->tacc[j] *= stepsize;
                dMULTIPLYADD0_331 (body[i]->avel,invI + i*12,body[i]->tacc);
        }


-- 
Zapp: Captain's log, stardate...er..
Kif: Ohhh. April 13th.
Zapp: April 13th. Point 2.

------=_Part_19305_32285513.1195485754328
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Nov 19, 2007 12:18 AM, Funky Fred &lt;<a href="mailto:[email protected]">[email protected]</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Ok, narrowed it down a bit more. Looks like the body-&gt;avel value in dxStepBody is NaN.<br>I stepped through things a little bit more and narrowed it down to the dxQuickStepper call @868 in quickstep.cpp<br>If I&#39;m reading the gdb output right (it&#39;s getting late). It looks like the dMULTIPLYADD0_331 macro/function is doing it.
</blockquote><div><br>Looking at the code, a logical cause for this would be a zero mass, causing a NaN body_invMass;<br><br>I expect that if you do an...<br>ASSERT(!dIsNan(body[i]-&gt;invMass));<br>...in that code, it will be triggered.
<br><br>&nbsp; Bram<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // compute the velocity update:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // add stepsize * invM * fe to the body velocity<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IFTIMING (dTimerNow (&quot;compute velocity update&quot;);)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (i=0; i&lt;nb; i++) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dReal body_invMass = body[i]-&gt;invMass;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (j=0; j&lt;3; j++) body[i]-&gt;lvel[j] += stepsize * body_invMass * body[i]-&gt;facc[j];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (j=0; j&lt;3; j++) body[i]-&gt;tacc[j] *= stepsize;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dMULTIPLYADD0_331 (body[i]-&gt;avel,invI + i*12,body[i]-&gt;tacc);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br></div></div><br>-- <br>Zapp: Captain&#39;s log, stardate...er..<br>Kif: Ohhh. April 13th.<br>Zapp: April 13th. Point 2.

------=_Part_19305_32285513.1195485754328--

--===============2086906666==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ODE mailing list
[email protected]
http://ode.org/mailman/listinfo/ode
--===============2086906666==--