|
|
Up |
|
|
  |
Author: Arjen MarkusArjen Markus Date: Oct 4, 2007 06:35
Hello,
we are experiencing a rather nasty problem with the Intel Fortran
compiler under Linux
(version 9.0). The program is big and so far we have not been able to
trim the code
so that a moderately sized program displays the problem too.
The point is this:
The first application of the log function on double precision reals
causes
an NaN (while the argument is a perfectly acceptable value of about
0.6).
If we add a dummy statement like:
aa =log(r)
as one of the first statements, the value of aa becomes NaN and some
later computations
succeed. (NaNs occur at a different positions).
Here is some more information:
Intel Fortran: 9.0
Linux: Red Hat Enterprise Linux, ES release 4.
|
| Show full article (0.81Kb) |
|
| | 53 Comments |
|
  |
Author: Dr Ivan D. ReidDr Ivan D. Reid Date: Oct 4, 2007 08:17
> The first application of the log function on double precision reals
> causes
> an NaN (while the argument is a perfectly acceptable value of about
> 0.6).
> If we add a dummy statement like:
> aa =log(r)
> as one of the first statements, the value of aa becomes NaN and some
> later computations
> succeed. (NaNs occur at a different positions).
I've been doing a lot of DP logs lately (roughly 8.5E11 in 800
minutes CPU time.. :-) and haven't seen any problem.
> Here is some more information:
> Intel Fortran: 9.0
> Linux: Red Hat Enterprise Linux, ES release 4.
> Has anyone encounter similar problems? Does anyone know how to solve
> this problem?
|
| Show full article (1.43Kb) |
|
| | no comments |
|
  |
Date: Oct 4, 2007 09:58
Arjen:
The LOG function is used so much that I am skeptical that this is the
source of this problem. If the code is complicated it is possible that
the compiler is having other problems that manifest themselves in the
LOG call, but first I suggest you
1. Insert IMPLICIT NONEs in all codes/modules to activate type
checking
2. Turn on array bounds checking
3. Wrap codes with modules to make all interfaces explicit
4. Ensure that the code does not have its own LOG that is being used
instead of the standard LOG. (INTRINSIC LOG would help here).
|
| |
| no comments |
|
  |
Author: Arjen MarkusArjen Markus Date: Oct 4, 2007 23:37
On 4 okt, 18:58, wclod...@ lanl.gov wrote:
> Arjen:
>
> The LOG function is used so much that I am skeptical that this is the
> source of this problem. If the code is complicated it is possible that
> the compiler is having other problems that manifest themselves in the
> LOG call, but first I suggest you
>
> 1. Insert IMPLICIT NONEs in all codes/modules to activate type
> checking
> 2. Turn on array bounds checking
> 3. Wrap codes with modules to make all interfaces explicit
> 4. Ensure that the code does not have its own LOG that is being used
> instead of the standard LOG. (INTRINSIC LOG would help here).
I was afraid it would not be that easy ;).
The code is voluminous and uses a complicated memory management scheme
(most of it dates from the FORTRAN 77 era). That pretty much prohibits
array bounds checking.
|
| Show full article (1.29Kb) |
| no comments |
|
  |
Author: Craig DedoCraig Dedo Date: Oct 5, 2007 05:44
> On 4 okt, 18:58, wclod...@ lanl.gov wrote:
>> Arjen:
>>
>> The LOG function is used so much that I am skeptical that this is the
>> source of this problem. If the code is complicated it is possible that
>> the compiler is having other problems that manifest themselves in the
>> LOG call, but first I suggest you
>>
>> 1. Insert IMPLICIT NONEs in all codes/modules to activate type
>> checking
>> 2. Turn on array bounds checking
>> 3. Wrap codes with modules to make all interfaces explicit
>> 4. Ensure that the code does not have its own LOG that is being used
>> instead of the standard LOG. (INTRINSIC LOG would help here).
>
> I was afraid it would not be that easy ;).
>
> The code is voluminous and uses a complicated memory management scheme ...
|
| Show full article (3.44Kb) |
| no comments |
|
  |
Author: Dan NagleDan Nagle Date: Oct 5, 2007 06:02
Hello,
Arjen Markus wrote:
> The code is voluminous and uses a complicated memory management scheme
> (most of it dates from the FORTRAN 77 era). That pretty much prohibits
> array bounds checking.
>
> It does seem that the problem is connected to that, but then again,
> the addition of a simple statement with no other effects also causes
> a change in the result.
This point, to me, indicates that one should verify whether the problem
appears in the optimized code only, or in optimized code and debug code.
(That is, code compiled with -O, n>0 only, or compiled with -O and
compiled with -g.)
If the problem appears in the optimized code only, a binary search
of object modules for the offending procedure is one possibly useful
course of action. This will at least point to the offending procedure.
The point is that modifying every file is an O( n) operation (where n
is the number of files) while a binary search
for the offending procedure is O( log( n)).
|
| Show full article (1.03Kb) |
| no comments |
|
  |
Author: David FlowerDavid Flower Date: Oct 5, 2007 06:21
On Oct 4, 2:35?pm, Arjen Markus wrote:
> Hello,
>
> we are experiencing a rather nasty problem with the Intel Fortran
> compiler under Linux
> (version 9.0). The program is big and so far we have not been able to
> trim the code
> so that a moderately sized program displays the problem too.
>
> The point is this:
>
> The first application of the log function on double precision reals
> causes
> an NaN (while the argument is a perfectly acceptable value of about
> 0.6).
>
> If we add a dummy statement like:
>
> aa =log(r)
> ...
|
| Show full article (1.14Kb) |
| no comments |
|
  |
Author: John SmithJohn Smith Date: Oct 6, 2007 10:40
David Flower wrote:
[snip]
> It might be worth inserting your own LOG function, just to see if
> anything interesting happens. If my algebra is correct:
> log(x) = exp(-1.0) * log10(x)
> might be a good place to start.
>
log(x)= 2.302585 * log10(x) = log10(x) / log10(exp(1.0))
I doubt it would matter, especially if the log10 intrinsic is based on
the log intrinsic
|
| |
| no comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Oct 6, 2007 13:40
John Smith wrote:
(snip)
> log(x)= 2.302585 * log10(x) = log10(x) / log10(exp(1.0))
> I doubt it would matter, especially if the log10 intrinsic
> is based on the log intrinsic
For x87 both are based on log2(x).
-- glen
|
| |
| no comments |
|
  |
|
|
  |
Author: robinrobin Date: Oct 7, 2007 16:04
> On 4 okt, 18:58, wclod...@ lanl.gov wrote:
>> Arjen:
>>
>> The LOG function is used so much that I am skeptical that this is the
>> source of this problem. If the code is complicated it is possible that
>> the compiler is having other problems that manifest themselves in the
>> LOG call, but first I suggest you
>>
>> 1. Insert IMPLICIT NONEs in all codes/modules to activate type
>> checking
>> 2. Turn on array bounds checking
>> 3. Wrap codes with modules to make all interfaces explicit
>> 4. Ensure that the code does not have its own LOG that is being used
>> instead of the standard LOG. (INTRINSIC LOG would help here).
|
| Show full article (1.27Kb) |
| no comments |
|
|
|
|