Software Archive
Read-only legacy content
17061 Discussions

Recursive subroutine informational message bug?

Intel_C_Intel
Employee
281 Views
I have just checked my program's results setting all REALs to double precision using the !DEC$REAL:8 compiler directive. I receive the following informational message during compile:

Info: Directive must be at the top of a program unit

The code it is complaining about is the following:

RECURSIVE SUBROUTINE SCREEN
!DEC$REAL:8
USE ..................

Is this a bug? It only happens for subroutines declared as RECURSIVE. Also, I have checked everywhere for a compiler option to set all REALs to double precision, but have not been able to locate this option if it exists. If it does, it would beat having to put the directive in the main program and every module, function, and subprogram. Thanks for any help.

Tom
0 Kudos
4 Replies
Steven_L_Intel1
Employee
281 Views
The option is /real_size:64 - Project..Settings..Fortran..Fortran Data..Default Real Kind..8

The error message you get when you add RECURSIVE is a bug - we'll fix it.

Steve
0 Kudos
Intel_C_Intel
Employee
281 Views
Steve,

Thanks - I just found the option in the help system. A followup question - In CVF help, the statement is made in the Programmer's Guide...Performance: Making Programs Run Faster...Additional Source Code Guidelines for Run-Time Efficiency...Use Efficient Data Types that "In cases where more than one data type can be used for a variable, consider selecting the data types based on the following hierarchy, listed from most to least efficient:

on x86 systems:
Integer
Double-precision real.....
Single-precision real.....

Is this correct - 64 bit computations are faster than 32 bit computations on a 32 bit PC? If so, it goes counter to everything I have ever known about FORTRAN compilers. Have the manual got these statements switched with the Alpha system statements about efficiency as there it is stated that 4 byte computations are more efficient than 8 byte computations? Thanks,

Tom

Tom
0 Kudos
Steven_L_Intel1
Employee
281 Views
The wording is not switched. X86 doesn't have the concept of different "operate" instructions for single and double precision - rather, you set a mode in a control register (which is slow). What we do (as do other compilers) is set the mode to double-precision, so that arithmetic operations are done in double. Then, if the result has to be stored to single-precision, it is rounded. Alpha has both single and double operate instructions, and single is faster.

I can't get too excited about picking double over single on X86, especially if you have big arrays, as that doubles your memory traffic. If absolute performance matters to you, try it both ways and time it for yourself!

Steve
0 Kudos
Intel_C_Intel
Employee
281 Views
Steve,

Thanks - I just found the option in the help system. A followup question - In CVF help, the statement is made in the Programmer's Guide...Performance: Making Programs Run Faster...Additional Source Code Guidelines for Run-Time Efficiency...Use Efficient Data Types that "In cases where more than one data type can be used for a variable, consider selecting the data types based on the following hierarchy, listed from most to least efficient:

on x86 systems:
Integer
Double-precision real.....
Single-precision real.....

Is this correct - 64 bit computations are faster than 32 bit computations on a 32 bit PC? If so, it goes counter to everything I have ever known about FORTRAN compilers. Have the manual got these statements switched with the Alpha system statements about efficiency as there it is stated that 4 byte computations are more efficient than 8 byte computations? Thanks,

Tom

Tom
0 Kudos
Reply