<html><body>---------- Původní e-mail ----------<br><aside>
Od: Laurence Marks <L-marks@northwestern.edu><br>
Komu: A Mailing list for WIEN2k users <wien@zeus.theochem.tuwien.ac.at><br>
Datum: 9. 5. 2018 18:18:21<br>
Předmět: Re: [Wien] IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
</aside><br><blockquote data-email="L-marks@northwestern.edu"><div dir="auto">Zamt is set by somm, which is a slightly inaccurate Simpson summation (the accuracy does not matter). Hence it does not need to be set previously.<br></div></blockquote><p><br></p><p>Right, it is indeed set in the somm subroutine. The problem is that the DA variable (the local name for zamt variable in the somm subroutine) is set for the first time on line 11, while it is used (read) for the first time earlier on line 10 (and this is the line when the gcc and valgrind complains)! Hence when the subroutine is called for the first time, the results depends on read from uninitialized memory.</p><p>Best regards</p><p>Pavel<br></p><p> </p><blockquote data-email="L-marks@northwestern.edu"><div dir="auto"><br><div>_____<br>Professor Laurence Marks<br>"Research is to see what everybody else has seen, and to think what nobody else has thought", Albert Szent-Gyorgi<br><a href="http://www.numis.northwestern.edu">www.numis.northwestern.edu</a></div></div><br><div><div dir="ltr">On Wed, May 9, 2018, 10:42 AM Pavel Ondračka <<a href="mailto:pavel.ondracka@email.cz">pavel.ondracka@email.cz</a>> wrote:<br></div><blockquote style="margin:0 0 0 0.8ex;border-left:1px#ccc solid;padding-left:1ex">Laurence Marks píše v St 09. 05. 2018 v 11:51 +0000:<br>
> This appears to be due to a silly approach in gfortran, and almost<br>
> certainly is not an error/problem and can be ignored -- see <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__s&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=KDobN5dacXxTk7OUpO1BdJBY45FBX34Hf6Q9hTempg0&e=" rel="noreferrer noreferrer">https://urldefense.proofpoint.com/v2/url?u=https-3A__s&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=KDobN5dacXxTk7OUpO1BdJBY45FBX34Hf6Q9hTempg0&e=</a><br>
> <a href="http://tackoverflow.com/questions/44308577/ieee-underflow-flag-ieee-" rel="noreferrer noreferrer">tackoverflow.com/questions/44308577/ieee-underflow-flag-ieee-</a><br>
> denormal-in-fortran-77.<br>
> <br>
<br>
While I do agree that in most cases this is harmless, it can also<br>
suggest a bug.<br>
<br>
I only looked at dstart for the TiC and I have this specific example:<br>
<br>
dstart for a TiC case prints a "Note: The following floating-point<br>
exceptions are signalling: IEEE_DENORMAL" line. If you trap this with<br>
-ffpe-trap='denormal' flag, to inspect in gdb, the offending line is<br>
then:<br>
Program received signal SIGFPE, Arithmetic exception.<br>
0x000000000041dc48 in somm (dr=..., dp=..., dpas=0.013585429144994965,<br>
da=1.1588924125005173e-310, m=0, np=935) at somm.f:10<br>
10 D1=DA+MM<br>
<br>
so this line looks completely harmless and some prints show why the<br>
compiler notes about this:<br>
<br>
(gdb) print DA<br>
$1 = 1.1588924125005173e-310<br>
(gdb) print MM<br>
$2 = 1<br>
<br>
i.e. we just add a really small number (denormal, since DOUBLE_MIN is<br>
around 1.8e-308) to 1, which is completely OK. But lets take a look<br>
where this incredibly small value comes from...<br>
<br>
(gdb) up<br>
#1 0x00000000004143c6 in make_spheres (lcore=.FALSE., luse=7) at<br>
make_spheres.F:81<br>
81 call<br>
somm(rat(1,ia),rhoat(1,ia),dx(ia),zamt,0,nptat(ia))<br>
<br>
So this is the zamt variable, surprisingly grepping around for zamt<br>
finds nothing. As far as I can see it is not declared or initialized<br>
anywere in dstart. If I just missed something please correct me! The<br>
same goes for the zamt1 and zamt2.<br>
<br>
Note that in this case we get lucky since the random memory value is<br>
effectively zero, however this might in my opinion lead to problems if<br>
you hit random memory with another value.<br>
In fact running the dstart in vagrind shows this as well and the<br>
terminal is spammed with "Conditional jump or move depends on<br>
uninitialised value(s)" and "Use of uninitialised value of size 8".<br>
<br>
IMO this is a bug, so either the line needs to be changed to <br>
somm(rat(1,ia),rhoat(1,ia),dx(ia),0,0,nptat(ia))<br>
or the zamt variable needs to be declared and initialized somewhere.<br>
But I actually have no idea about the physical meaning of the code so<br>
please correct me if I just missed something.<br>
<br>
Best regards<br>
Pavel<br>
_______________________________________________<br>
Wien mailing list<br>
<a href="mailto:Wien@zeus.theochem.tuwien.ac.at" rel="noreferrer">Wien@zeus.theochem.tuwien.ac.at</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__zeus.theochem.tuwien.ac.at_mailman_listinfo_wien&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=_8Uru9zRH580QrhtgA9HnU1x81x6paXIOqJCFnOzZME&e=" rel="noreferrer noreferrer">https://urldefense.proofpoint.com/v2/url?u=http-3A__zeus.theochem.tuwien.ac.at_mailman_listinfo_wien&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=_8Uru9zRH580QrhtgA9HnU1x81x6paXIOqJCFnOzZME&e=</a><br>
SEARCH the MAILING-LIST at: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mail-2Darchive.com_wien-40zeus.theochem.tuwien.ac.at_index.html&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=SJYF9VBF7xwkjpCyB76TXcIRXzDcFX3xCQlsoQ4RwIw&e=" rel="noreferrer noreferrer">https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mail-2Darchive.com_wien-40zeus.theochem.tuwien.ac.at_index.html&d=DwIGaQ&c=yHlS04HhBraes5BQ9ueu5zKhE7rtNXt_d012z2PA6ws&r=U_T4PL6jwANfAy4rnxTj8IUxm818jnvqKFdqWLwmqg0&m=R1lxmwh4Y3r4yRx1ZyR4NN9mpSe7RuaT974qRm6Uhfw&s=SJYF9VBF7xwkjpCyB76TXcIRXzDcFX3xCQlsoQ4RwIw&e=</a><br>
</blockquote></div>
_______________________________________________
<br>Wien mailing list
<br>Wien@zeus.theochem.tuwien.ac.at
<br>http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
<br>SEARCH the MAILING-LIST at: http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
<br></blockquote></body></html>