Intel Fortran Compiler

Skip to end of metadata
Go to start of metadata

We have installed the Intel compiler suite on the DSCR, including C, C++, Fortran 77, and Fortran 90. These compilers may provide a significant performance boost to almost any program, simply by recompiling your source code. Since it has deep knowledge of the CPU microarchitecture, it is able to better schedule instructions, make better use of cache, and potentially incorporate SSE (SIMD) acceleration.  See also Using the Intel Compiler.

Compiler Location

The Intel compilers are located in the /opt/apps/intel directory. To easily access the compilers, simply add the folowing to .cshrc or .bashrc file:

source /opt/apps/intel/intelvars.csh

That will alter your path so you can locate the executables and also set some environment variables so that the Intel tools can locate related files – once you include that file you should be ready to run any of the tools!   As a quick test, try the following at a command prompt:

Note that 'ifort' provides both Fortran 77 and 90 (and 95), it will use the filename extent (.f, .f77, .f90, etc.) to determine the standard to compile against. 

Basic Compilation

You can invoke the compiler just by replacing 'g77' with 'ifort' in your normal build process:

If your program builds through a standard 'makefile', you may try:

In many cases, this will swap the standard (g77) compiler with the Intel compiler for all portions of the build process. If that doesn't work for your application, you may need to modify the makefile or make other adjustments.

The main issues you're likely to have are if you've used any command-line arguments to 'gcc', e.g. for optimization.

See also Intel Compiler Optimizations

A good starting point is generally:

This will product a highly optimized (-fast) "base" code, and then include alternate code-paths for AVX and SSE (if the run-time CPU supports them).  If you leave out the -axAVX, your code will be optimized ONLY for the CPU you compiled on (in the DSCR, the login machines are often a year or two behind the current "best" CPU).

NOTE: when using the '-ipo' option, be sure to recompile all of your code with '-ipo' for maximum effect. Since this specifically kicks-in optimizations that can happen ACROSS procedures or functions, it makes sense to enable that for as many functions as possible.

Profile-Guided Optimization

Since a compiler could encounter any kind of code, it must make certain assumptions or guesses when it decides to optimize or not optimize a section of code. The Intel compilers allow you to compile a test-program and then run it, capturing an information trace as it runs. A second invocation of the compiler can then read in that trace file and make better assumptions, potentially giving you better performance.

First, do a basic compilation:

Next, run the program on a sample dataset:

Finally, recompile the code:

Note that if you are building the program with a 'makefile', you may need to remove all object files (.o files) before re-building to ensure that you actually recompile everything – if 'make' sees prog.o, it may not invoke the compiler the second time.

Optimized Intel Libraries

We also have several of the Intel libraries installed. These provide highly optimized routines for a wide range of functions – linear algebra, signal/image/video processing, statistics, etc.

See the Intel Tools page for more info.

https://wiki.duke.edu/display/SCSC/Intel+Fortran+Compiler

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值