Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28989 Discussions

Disturbing Result -- double precision

lklawrie
Beginner
1,070 Views

I have a somewhat large source code (Steve is a bit familiar with this one!). We usually compile it with "double precision" from the compiler. But before release, I also check out Single precision.

I had a double precision parameter that was causing some problems in the single precision compile as an argument. So, I made it a "Real" and then ran my usual double precision compile and run.

Finally -- to the disturbing part. It appears that this change to a "real" parameter but compiled "double precision" causes a change in results.

Is this a compiler problem? Is it a known compiler problem?

Linda

0 Kudos
8 Replies
grg99
Beginner
1,070 Views
There could be a problem if the compiler doesnt have access to the called function header, or the header it does get has the "old" or a different type.

For instance if the visible interface declares that parameter as type A but the actual function header says Type B, there will be problems!


0 Kudos
Steven_L_Intel1
Employee
1,070 Views
Linda,

I agree with grg99 that mismatched types are likely the problem. Try building with the /gen-interfaces and /warn:interfaces options (in VS these are on the External Procedures and Diagnostics pages) and see if the compiler finds anything to complain about.
0 Kudos
lklawrie
Beginner
1,070 Views

Nope, no joy there (that is, no warnings, errors, strikes, etc).

Very hard to nail down. What is happening is that some errors/warnings are being detected in the code.... (comparisons) but I think the results are the same in both instances.

I also had another developer report to me he had found differences in using LOG (intrinsic) vs DLOG with our double precision compile (so the arguments to both functions would have been double precision).

Linda

0 Kudos
dbruceg
Beginner
1,070 Views

Is it possible that a few of the calculations require double precision? I.e., might you be looking for a small number calculated as the difference between two large ones somewhere? Do you have any natural ill-conditioners like large-scale equation solution or eigensolution?

Bruce

0 Kudos
lklawrie
Beginner
1,070 Views

But I'm using all double precision in both compiles.

Am I not making clear the problem?

Linda

0 Kudos
dbruceg
Beginner
1,070 Views

Sorry - I didn't get it. I guess the bit about single-precision compilation was irrelevant. You compile withdouble precision default reals and you get a difference if you change a REAL(8) declaration to a REAL declaration. Right?

Bruce

0 Kudos
lklawrie
Beginner
1,070 Views

Yep, that's it.

The junk about single precision compiling was irrelevant.

Linda

0 Kudos
dbruceg
Beginner
1,070 Views

Linda, your problem interests me because I, too, have to maintain single- and double-precision versions of my software, due to the existence of a couple of dusty old Crays in Houston. Consequntly, I have to do the same type of thing that you're doing, and if there's a problem somewhere, I want to know where to look.

Apparently, you modified a single variable. Is there no way to work your way in to find the exact point at which the results changed?

Bruce

0 Kudos
Reply