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

about the speed

horst_haas_a_itp_fzk
1,106 Views
I got a question about the speed.
Recently, I compared the speed of the Intel Visual Fortran (IVF) with the speed of the Compaq Visual Fortran (CVF). It is surprised to me that CVF is quicker than IVF? What is the reason? In other words, if it is the case, what is the advantage of IVF?
0 Kudos
10 Replies
horst_haas_a_itp_fzk
1,106 Views
Quoting - peterklaver

It might also be useful to know something about your computing platform as well.


my system info: intel core 2 quad Q9400 @ 2.66GHz, 2.67GHz, 3.24 GB RAM, Windows XP
two compilers: CVF professional 6.6a; ifort 11.1 for Windows with IMSL

the run time for the executable compiled by CVF is about 27s, but 31s for the one compiled by ifort

the test code is attached.
0 Kudos
Les_Neilson
Valued Contributor II
1,106 Views


my system info: intel core 2 quad Q9400 @ 2.66GHz, 2.67GHz, 3.24 GB RAM, Windows XP
two compilers: CVF professional 6.6a; ifort 11.1 for Windows with IMSL

the run time for the executable compiled by CVF is about 27s, but 31s for the one compiled by ifort

the test code is attached.

I loaded your code into asample IVF project (v10.1, 32 bit) I use for testing and I got the following :

debug : calculation time(s)= 22.838546399999998
release : calculation time(s)= 18.6577196

Debug project settings are : optimization none; Debug information full
Release settings are : optimization Maximum speed; Debug information none
(Intel Core 2 Quad Q9650; 3.00Ghz; 8Gb RAM; Windows Vista64)

Les
0 Kudos
horst_haas_a_itp_fzk
1,106 Views
Quoting - Les Neilson

I loaded your code into asample IVF project (v10.1, 32 bit) I use for testing and I got the following :

debug : calculation time(s)= 22.838546399999998
release : calculation time(s)= 18.6577196

Debug project settings are : optimization none; Debug information full
Release settings are : optimization Maximum speed; Debug information none
(Intel Core 2 Quad Q9650; 3.00Ghz; 8Gb RAM; Windows Vista64)

Les

Thanks a lot. But how to set these settings? I have tried but could not find out. By the way, what is the difference between debug and release? I mean how to run indifferent waysin debug and in release.
0 Kudos
TimP
Honored Contributor III
1,106 Views
As the test is organized so as to prevent optimization, and spends a plurality of the time in random_number, you might expect a modern library to spend at least as much time so as to assure random number quality.

0 Kudos
horst_haas_a_itp_fzk
1,106 Views
Quoting - tim18
As the test is organized so as to prevent optimization, and spends a plurality of the time in random_number, you might expect a modern library to spend at least as much time so as to assure random number quality.


sorry to say that i do not know the modern library you mentioned. please give me more information. thanks
0 Kudos
Les_Neilson
Valued Contributor II
1,106 Views

Thanks a lot. But how to set these settings? I have tried but could not find out. By the way, what is the difference between debug and release? I mean how to run indifferent waysin debug and in release.

From your response I suspect you are building your exefrom the command line and not using Visual Studio?

From the command line ifort /debug:full ...
will add extra debug info to your exe which can be used by external dubugging program (IDB, WinDbg, Visual Studio etc)

For release build, optimisation (and faster exe speed)
ifort /debug:none /O2 ... is the equivalent setting I had
(from the help /O3 maximises speed _and_ gives a greater level of code optimisation)


Although as Tim pointed out, the optimisation that can be performed on the code givenis minimal and the program spends most of its time in random_number. Therefor your speed test will depend on how good the library is that contains random_number.
A good RNG spends a bit more time making sure the distribution of numbers is good.


Les

0 Kudos
TimP
Honored Contributor III
1,106 Views

sorry to say that i do not know the modern library you mentioned. please give me more information. thanks
I'm simply pointing out that random_number supplied with current ifort isn't likely to be identical to the one supplied with CVF. Given the additional decade of development and changes in machine performance, one would expect improved quality to take precedence over increased speed.
I ran your test with gfortran; it took several times as long, on account of the different implementation of random_number. Also tried to run that under VTune (Windows), which died.
0 Kudos
horst_haas_a_itp_fzk
1,106 Views
Quoting - Les Neilson

From your response I suspect you are building your exefrom the command line and not using Visual Studio?

From the command line ifort /debug:full ...
will add extra debug info to your exe which can be used by external dubugging program (IDB, WinDbg, Visual Studio etc)

For release build, optimisation (and faster exe speed)
ifort /debug:none /O2 ... is the equivalent setting I had
(from the help /O3 maximises speed _and_ gives a greater level of code optimisation)


Although as Tim pointed out, the optimisation that can be performed on the code givenis minimal and the program spends most of its time in random_number. Therefor your speed test will depend on how good the library is that contains random_number.
A good RNG spends a bit more time making sure the distribution of numbers is good.


Les


I used Microsoft Visual Studio 2008. How to set/change these setings? Thanks.
0 Kudos
TimP
Honored Contributor III
1,106 Views

I used Microsoft Visual Studio 2008. How to set/change these setings? Thanks.
The ifort options are set in the project properties>fortran. In your example, the default release settings will be as good as any.
0 Kudos
Les_Neilson
Valued Contributor II
1,106 Views
In Visual Studio from the menu Project-> Properties

The dialog shows Configuration, Platform and Configuration Manager
The manager allows you to create additional configurations which may make use of different setings

e.g. we have a LOG_DEBUG config which has a preprocessor definition of "LOG_DEBUG" so that in the code we can wrap code with
!DEC$ IF DEFINED (LOG_DEBUG)
code to execute to print values of variables
!DEC$ ENDIF


Configuration allows you to choose which on Debug, Release, (or Log_Debug etc)
Platform you can shoose Win32 or X64 if you have the 64 bit compiler installed

In the panel below you have the properties for the selected config
If you select the Debug config then click on the propertyFortran-> General then in the right hand panel you will see "Debug Information Format" There is a drop down list of choices but for Debug normally one would choose "Full"
Similarly for "Optimizatio" for Debug this would be set to "Disable"

For Release configs these two would be set to "None" and "Maximise Speed" for example.

There are many other options e.g. for help indebugging then the Diagnostics property allows you to select "Warn for unused variables" and the "Run-time" property allows runtime error checking such as "array and string bounds"
and "check uninitialised variables".

etc.

Les
0 Kudos
Reply