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

Transfer correct settings and variable precisions from Win32 to Linux

backsoon
Beginner
496 Views
I'm currently trying to compile a Fortran program - I've been using up to now on Windows (XP)/DOS command-line - under Linux (Kubuntu 8.10 on an Intel P8400). I cant manage to get the same results for some calculations, though. Would anybody know a way to do this? As quite a beginner, I would guess, that my floating point settings or the sizes of certain variable types are different on Ifort (11.0) than they were on Windows. Currently my comand line is

ifort -O0 -pc80 -mieee-fp Epic0509D.for

whereas I can set -pc either 80 (=default) or 64, without any difference in results. "-O0" was necessary for correct rounding in the first calculation steps already. Also trying several options like fp-speculation off, -fp-model strict,changeing -r{X} up and down and most other floating point and size options, I couldn't get any improvement. Some sample results are:

Linux: 78.51 17.41 12.42 8.40
Win32 78.51 17.40 12.41 8.40

Linux: 126.67 100.06 55.04 0.00
Win32:126.67 100.07 55.06 0.00

This might look like a minor differences, but these are only intermediate results from some initial calculation steps, whereas my final results differ by up to 100%, which makes it essential to get the same results already in the initial calculations. I furthermore can't change/adapt the compilation parameters on Windows to Linux, because the program has been in use for a long time and the results have to be comparable...
I found, though, a file with some compilation parameters in the Windows directory, which is pasted below. So in case somebody knows how to translate these options and also knows the default variable/calculation precision options of Fortran in Microsoft Developer Studio, this would be really helpful for me. I don't have this software suit neither the documentation, so I'm not able to look up the correct parameters myself. In case these parameters are stored in the PDB-File or in some other files that are included below, please tell me also. I will then try to get access to a MDS distribution somewhere.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--------------------Configuration: Epic0509 - Win32 Debug--------------------
Begining build with project "D:\MyProject\EPIC0509\Epic0509.dsp", at root.
Active configuration is Win32 (x86) Console Application (based on Win32 (x86) Console Application)

Project's tools are:
"Fortran 90 Compiler for 80x86" with flags "/include:"Debug/" /compile_only /nologo /debug:full /optimize:0 /module:"Debug/" /object:"Debug/" /pdbfile:"Debug/DF50.PDB" "
"Win32 Resource Compiler" with flags "/l 0x804 /d "_DEBUG" "
"Browser Database Maker" with flags "/nologo /o"Debug/Epic0509.bsc" "
"COFF Linker for 80x86" with flags "kernel32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/Epic0509.pdb" /debug /machine:I386 /out:"Debug/Epic0509.exe" /pdbtype:sept "
"Custom Build" with flags ""
"" with flags ""

Creating command line "link.exe kernel32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/Epic0509.pdb" /debug /machine:I386 /out:"Debug/Epic0509.exe" /pdbtype:sept .\Debug\Epic0509.obj"
Linking...

Epic0509.exe - 0 error(s), 0 warning(s)

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

In another file, it says "Microsoft Developer Studio Workspace File, Format Version 5.00". So that might be the version of MDS, it has been developed with.
Thank you in advance (and I hope, I didn't oversee any solutions or tutorials), backsoon
0 Kudos
1 Reply
Steven_L_Intel1
Employee
496 Views
On Windows you're using Digital Visual Fortran 5.0, a 12-year-old product with different optimizations and math libraries. Some differences should be expected. Assuming you're using the Intel version 11 compiler on Linux, you'd be using SSE2 instructions for floating point instead of the x87 instructions DVF would use. Different orders of operations could cause other differences. Variable sizes, however, will be the same.

You may want to try:

ifort -mia32 -fp-model strict -Od

and see if that gets you a bit closer. The options being used on Windows are pretty generic - just -Od (-O0) and debug.
0 Kudos
Reply