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

intel version 10 windows visual fortran

William_G_
Beginner
383 Views

Question 1.

In the version  10 windows fortran compiler, can the cpu be specifically set to

use which of these floating point calculation modes 

single mode (32 bit floating) 

or

double mode(64 bit mode)

or

double extgended mode(80-bit)

WHich of the above 3 modes (32,64,80 bit) is the default??

 

Question 2

In a more up to date version of the fortran compiler

is there more control to instruct the cpu to specifically use for example 64 bit mode floating point calculations

 

WHat we are seeing is ONLY when the fortran dlls are being run through an EXCEL spreadsheet interface,

sometimes the first time the excel is run values are returned ; but then the second and subsequent runs of the excel

interface produce a consistent set of values that are slightly different from the first set of values (usually differences start

after about 5 significant digits).

 

the hypothesis is that

1. excel opens and sets the floating point mode

2 the first time the fortran dll loads there is some static initialization that changes the floating point mode.

3 the first run completes

4 control returns to excel which sets the floating point mode back to "normal"

5 the second time the fortran dll is called from excel, there is no further static initialization, so all

floating point numbers are now being calculated in excels mode.......

 

SO, in version 10 fortran can the floating point mode be set, or what is the default

 

In more recent fortran releases are there likely to be compiler options that could

clear the problem that run 1 is different from runs 2 and subsequent.

 

ANy comment is very appreciated.

 

Thanks

Bill  (billg5@yahoo.com) 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
383 Views

Intel Fortran no longer uses the old x87 floating point instructions, so the concept of floating point mode no longer applies. That change happened in version 11.0. I'm not aware that we ever set the FP mode, but it's possible, but if it happened it would not be for a DLL but a Fortran main program only. We did not provide control over the FP precision mode.

In modern versions (version 15.0 is current), we use the SSE instructions that always use "declared precision" for operations. The older x87 instructions could sometimes, unpredictably to the user, keep some results in a higher precision before rounding, causing unpredictable differences.

The symptoms you're describing suggest to me that the problem has nothing to do with FP mode and is due to references to uninitialized values. Have you made sure that your DLL routines called from Excel are declared with !DIR$ ATTRIBUTES STDCALL?

0 Kudos
TimP
Honored Contributor III
383 Views

X87 precision mode could affect your Fortran dll only if it is built by the ia32 version of Ifort with the ia32 instructions.  I think Steve refers to the change after which sse2 became the default for Ifort ia32 as well as intel64.

Windows x64 sets 53 bit (normal double precision) mode before starting any .exe.  I don't know if excel would ever change the setting but leaving it at 24 bits (single precision) seems unlikely.  

Ifort wouldn't change precision mode during execution.  If your dll requires a specific setting, you could call a c function to set it.  Cvf had a library call for this purpose but Ifort couldn't be expected to support it as it doesn't apply to sse.

If your Fortran source code depends on implicit double precision evaluation of single precision expressions, it would be good to make it explicit so as to work with sse2 and later arch options.

it's difficult to foresee all problems which might arise with such an old compiler used with current excel and Windows.

 

 

 

 

0 Kudos
Reply