Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29298 Discussions

problems optimizing EM64T using ifc 9.1

jjkay
Beginner
548 Views
Hello,

I have recently moved a whole bunch of code from an IA-32 system to a new Intel EM64T system, and I need to recompile and optimize.

I've got everything working properly, up to the point of the first optimization. That is, with "-O0" everything compiles and executes just fine. Now, when I invoke the "-O1" flag, I get a big old segmentation fault. I used to be able to optimize this code up to "-O2" on the IA-32 system.

It seems to me that the problem can't be with the code itself; it works perfectly unoptimized. So, I am wondering if someone can point me to a list of exactly what goes into the first level of optimization, and what I might turn on/off to try to alleviate this problem. What is handled differently between the 64 optimization and the 32?

Any help would be appreciated! It seems like a lot of people have had similar difficulties, but I haven't been able to track down the problem. I suspect lots more people will have this problem, so it might be nice to have a place where this is all laid out clearly.

Thanks! This software network has been really useful for me!

Jeff
0 Kudos
2 Replies
Steven_L_Intel1
Employee
548 Views

That the code works without optimization does not mean that the code is correct. There are many coding errors that will reveal themselves only when optimization is enabled so that the compiler makes additional assumptions about the legality of the code.

Your best bet is to use a debugger to identify the code that is getting the segfault and then to determine why. A list of optimizations isn't going to be helpful. You might try turning on some of the compiler diagnostics such as:

-CB -gen-interface -warn interface

0 Kudos
jjkay
Beginner
548 Views
Hello Steve,

Thanks for your advice. The problem, I believe, has to do with the compatibility of the newer versions of fortran with the older ones. The programs I am trying to compile were written over the last 30 years (some translated from punch-cards) by a collaborator of mine. There are of course some conventions which have fallen out of favor, and apparently this creates a little bit of trouble in the optimization.

In any case, I wanted to post a reply so that others in a similar situation may be able to benefit...

1) I was able to trace the problem, using the -traceback compiler option, all the way to the particular subroutine that was having issues.
2) Once I was able to trace the problem back to a particular subroutine, I isolated it in the compile step. So, I would compile everything except that routine using -O1 or -O2, and compile the problem routine with -O0.
3) After linking, the code executed properly and I have not encountered any problems yet.

This probably isn't the most elegant way to do things, but trying to dig through megabytes of text to root out subtle compatibility problems would simply take too much time.

Thanks for your help! It's a great bulletin board you have here.


0 Kudos
Reply