- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1.) If I have the flag -c, will there be any interprocedural optimizations (IPO)?
2.) How do I activate full interprocedural data flow, alias analysis, and call-site tailoring?
3.) Can I replace intrinsic routines with ESSL (engineering and science subroutine library) routines?
4.) What flag will make ifort round doubles when they are stored in REAL(4) memory locations?
5.) What flag will turn off recognizing conditional compilation lines and what are conditional compilation lines?
6.) What flag will turn off induction (loop counter) variable optimizations?
7.) What flag will turn off dynamic dimensioning of arrays?
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
10.) What's a Q edit descriptor and how do I make ifort interpret them as extended precision?
2.) How do I activate full interprocedural data flow, alias analysis, and call-site tailoring?
3.) Can I replace intrinsic routines with ESSL (engineering and science subroutine library) routines?
4.) What flag will make ifort round doubles when they are stored in REAL(4) memory locations?
5.) What flag will turn off recognizing conditional compilation lines and what are conditional compilation lines?
6.) What flag will turn off induction (loop counter) variable optimizations?
7.) What flag will turn off dynamic dimensioning of arrays?
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
10.) What's a Q edit descriptor and how do I make ifort interpret them as extended precision?
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1.) If I have the flag -c, will there be any interprocedural optimizations (IPO)?
There will be interprocedural optimizations within the single source file with -O3 or -ip, some with default -O2. IPO requires that you compile and link with -ipo. You can do the compiles individually with -c and with -ipo specified, and then the IPO optimizations occur when you use ifort -ipo to do the link.
2.) How do I activate full interprocedural data flow, alias analysis, and call-site tailoring?
-ipo as described in 1 above.
3.) Can I replace intrinsic routines with ESSL (engineering and science subroutine library) routines?
Yes, if you have explicit interfaces for the routines or use EXTERNAL to name them. This is standard Fortran practice. Are there actual replacements for Fortran intrinsics in ESSL? (I don't know.)
4.) What flag will make ifort round doubles when they are stored in REAL(4) memory locations?
That's standard behavior on assignment. If you're concerned about double-precision intermediate values in expressions involving single-precision values, either enable SSE processor extensions (-xW, -xN, etc.) or use -fp-model precise (slower).
5.) What flag will turn off recognizing conditional compilation lines and what are conditional compilation lines?
This is off by default, unless the source file type is capital F or F90. You can turn this on with -fpp. Conditional compilation lines start with # and are mostly similar to what you would use in C.
6.) What flag will turn off induction (loop counter) variable optimizations?
I'm not sure if there's a specific switch for that. (Tim Prince might know.)
7.) What flag will turn off dynamic dimensioning of arrays?
Please explain what you want in more detail. Typically you don't get "dynamic dimensoning" unless you explicitly ask for it in the source (with ALLOCATE).
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
I have not heard this term before. Please explain further.
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
A null character has the binary value zero. A correct Fortran program would not notice what character follows the last character of the constant. If you want a null, you should add it yourself with //CHAR(0).
10.) What's a Q edit descriptor and how do I make ifort interpret them as extended precision?
The Q edit descriptor is an extension used on a formatted READ. It assigns to the corresponding variable in the I/O list the number of characters remaining in the record. There is no way to interpret this as "extended precision". ifort will accept Q as an exponent letter in formatted input but there is no support for writing a Q. On input, Q, E and D all have the same meaning. The E format is preferred for writing real values as formatted output. The D format is also available but lacks some features such as specifying the number of exponent digits.
There will be interprocedural optimizations within the single source file with -O3 or -ip, some with default -O2. IPO requires that you compile and link with -ipo. You can do the compiles individually with -c and with -ipo specified, and then the IPO optimizations occur when you use ifort -ipo to do the link.
2.) How do I activate full interprocedural data flow, alias analysis, and call-site tailoring?
-ipo as described in 1 above.
3.) Can I replace intrinsic routines with ESSL (engineering and science subroutine library) routines?
Yes, if you have explicit interfaces for the routines or use EXTERNAL to name them. This is standard Fortran practice. Are there actual replacements for Fortran intrinsics in ESSL? (I don't know.)
4.) What flag will make ifort round doubles when they are stored in REAL(4) memory locations?
That's standard behavior on assignment. If you're concerned about double-precision intermediate values in expressions involving single-precision values, either enable SSE processor extensions (-xW, -xN, etc.) or use -fp-model precise (slower).
5.) What flag will turn off recognizing conditional compilation lines and what are conditional compilation lines?
This is off by default, unless the source file type is capital F or F90. You can turn this on with -fpp. Conditional compilation lines start with # and are mostly similar to what you would use in C.
6.) What flag will turn off induction (loop counter) variable optimizations?
I'm not sure if there's a specific switch for that. (Tim Prince might know.)
7.) What flag will turn off dynamic dimensioning of arrays?
Please explain what you want in more detail. Typically you don't get "dynamic dimensoning" unless you explicitly ask for it in the source (with ALLOCATE).
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
I have not heard this term before. Please explain further.
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
A null character has the binary value zero. A correct Fortran program would not notice what character follows the last character of the constant. If you want a null, you should add it yourself with //CHAR(0).
10.) What's a Q edit descriptor and how do I make ifort interpret them as extended precision?
The Q edit descriptor is an extension used on a formatted READ. It assigns to the corresponding variable in the I/O list the number of characters remaining in the record. There is no way to interpret this as "extended precision". ifort will accept Q as an exponent letter in formatted input but there is no support for writing a Q. On input, Q, E and D all have the same meaning. The E format is preferred for writing real values as formatted output. The D format is also available but lacks some features such as specifying the number of exponent digits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6.) What flag will turn off induction (loop counter) variable optimizations?
I'm not sure if there's a specific switch for that.
You'd have to be more specific. Several flags and directives affect vectorization, unrolling, and loop interchanges, in case you mean those.
7.) What flag will turn off dynamic dimensioning of arrays?
Please explain what you want in more detail. Typically you don't get "dynamic dimensoning" unless you explicitly ask for it in the source (with ALLOCATE).
Several flags affect the choice of stack or heap for dynamic arrays. Besides ALLOCATABLE arrays, there are automatic arrays. There also, you have to change the source code if you don't want dynamic.
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
Current Fortran standard (2003) defines a VOLATILE attribute. It doesn't refer specifically to registers, although it certainly would affect register optimizations. I don't know about plans to implement this in ifort. The Fortran standard specifically forbids assuming that it specifies anything related to behavior of threaded programs. If you are using OpenMP, for example, you should be using OpenMP facilities for this.
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
A null character has the binary value zero. A correct Fortran program would not notice what character follows the last character of the constant. If you want a null, you should add it yourself with //CHAR(0)
ACHAR(0) might be what you want, although there is a good chance they will do the same thing.
I'm not sure if there's a specific switch for that.
You'd have to be more specific. Several flags and directives affect vectorization, unrolling, and loop interchanges, in case you mean those.
7.) What flag will turn off dynamic dimensioning of arrays?
Please explain what you want in more detail. Typically you don't get "dynamic dimensoning" unless you explicitly ask for it in the source (with ALLOCATE).
Several flags affect the choice of stack or heap for dynamic arrays. Besides ALLOCATABLE arrays, there are automatic arrays. There also, you have to change the source code if you don't want dynamic.
8.) What's a volatile register, and how do prevent ifort from minimizing saves and restores to the volatile register?
Current Fortran standard (2003) defines a VOLATILE attribute. It doesn't refer specifically to registers, although it certainly would affect register optimizations. I don't know about plans to implement this in ifort. The Fortran standard specifically forbids assuming that it specifies anything related to behavior of threaded programs. If you are using OpenMP, for example, you should be using OpenMP facilities for this.
9.) What's a null character, and what flag prevents appending a null character to a character constant expression?
A null character has the binary value zero. A correct Fortran program would not notice what character follows the last character of the constant. If you want a null, you should add it yourself with //CHAR(0)
ACHAR(0) might be what you want, although there is a good chance they will do the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
all of these questions have to do with the defaults of a recommended xlf compilation. My code compiled with ifort and with xlf give significantly different results. Most of the terminology like "volatile register" come from the xlf help file.
Thank you for your help though
Thank you for your help though
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try adding -xW (or the code for the processor type you are using) so that x87 arithmetic is not used. This will probably more closely approximate the xlf results. You can also add -fp-model precise (though this may slow down the code, -xW will speed it up.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, I thought xW doesn't work for a mac? Second, I sort of found something close enough.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, you're on a Mac. There, xN (I think) is the default, so the advice about using xW does not apply.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page