Re: Compiling in 32 vs 64 platform problem
- From: Patrick Begou <Patrick.Begou@xxxxxxxxxxx>
- Date: Wed, 26 Apr 2006 08:07:20 +0200
I've recently get the same problem with Intel fortran compiler while I was runing some comparisons between ifort (ia32 and ia64) and XLF (IBM RS6000). I think the problem is related to :
> Most variables in the program are declared as real <name of variable>
> with a few declared as real*8. There are dozens of different common
> blocks through the program.
I've discovered that floating point constants in ifort seems to be REAL and lead to a loss of precision when initializing a DOUBLE PRECISION variable.
DOUBLE PRECISION t=2.33D0
is not the same than
DOUBLE PRECISION t=2.33
Same problems seems to occur with intinsic functions (I saw it with sin())
Try to compile with -r8 flag to set all your floating point variables _and_ constants to DOUBLE PRECISION (except if some are REAL*4 in the code...) et test again. Your data will be more homogeneous in precision.
But this as nothing to do with 32/64 bits programs. The differences may be related to cpu architecture and troncature of the stored values of your variables.
Patrick
Peter wrote:
Hello,.
I have a several thousand-lines code in f77 that I want to port to 64
bit architecture machines. I use Intel Fortran compiler version 8.1.
with the following command line:
ifort -c -O2
followed by linking of the different object files.
The program is self-contained in the sense that it does not require
any external libraries (except the portability library specified by
the -Vaxlib switch at linking time). Compilation and linking seem to
go smoothly but the results obtained from the program differ from
those that I get on 32 bit architecture machines. Comparing the result
files on both systems one can see difference in values that start on
the second decimal place between the 32 bit results and the 64 bit
results. For example:
64 bit results:
7.5 1 0.664139E-01 1
0.238612E+00
0.531925E-02
0.154969E-01
0.382009E-01
32 bit results:
7.5 1 0.581779E-01 1
0.239058E+00
0.543676E-02
0.155693E-01
0.383326E-01
I have compiled the same code on many different 32 bit machines (also
with the same compiler) and the results usually do not differ by that
much. Thus, I am concerned that something else is happening here but I
am not sure what.
Most variables in the program are declared as real <name of variable>
with a few declared as real*8. There are dozens of different common
blocks through the program.
So far I have thought that the problem may be related to:
a) the size of a real in a 32 bit machine is perhaps different than in
the 64 bit machine and what I am looking at is some sort of rounding
off problem.
b) Common blocks. I have heard that sometimes there may be alignment
problems.
In either case I am not sure how to solve the problem. I was wondering
if anyone could offer some insights into the problem and how to solve
it. Thanks in advance.
Peter
- Follow-Ups:
- Re: Compiling in 32 vs 64 platform problem
- From: Klaus Wacker
- Re: Compiling in 32 vs 64 platform problem
- Prev by Date: Re: New style DO syntax?
- Next by Date: Re: Function argument
- Previous by thread: Re: Compiling in 32 vs 64 platform problem
- Next by thread: Re: Compiling in 32 vs 64 platform problem
- Index(es):
Relevant Pages
|
|