- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Briefly, in a previous post I explained that I tried to run my code written in F77 with Ifort under Suse 10.0 and that I faced some problems. In particular the compilation went ok but the code was not running at all, not even killed.
Today I was playing with the optimization options of the g77...and I remembered that when I create the library with the optimization option -O2, my code does not run at all although it compiles without any error...I thought...hmmm hmmm...looks like what I have with Ifort...
I decided then to check all the default options in Ifort...and I found out that -O2 is by default. Then I created my library with the option -O0 instead of the default one...and now the code runs !! And substantially faster than with g77 !
Ok, now could someone explain me why a code does not run when a library is created with -O2 ? Is it something general ?
Xtof
Briefly, in a previous post I explained that I tried to run my code written in F77 with Ifort under Suse 10.0 and that I faced some problems. In particular the compilation went ok but the code was not running at all, not even killed.
Today I was playing with the optimization options of the g77...and I remembered that when I create the library with the optimization option -O2, my code does not run at all although it compiles without any error...I thought...hmmm hmmm...looks like what I have with Ifort...
I decided then to check all the default options in Ifort...and I found out that -O2 is by default. Then I created my library with the option -O0 instead of the default one...and now the code runs !! And substantially faster than with g77 !
Ok, now could someone explain me why a code does not run when a library is created with -O2 ? Is it something general ?
Xtof
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have no idea. I think Steve L. suggested opening an issue on Premier Support (premier.intel.com) where you attach your code.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The point is that this code is doing that even with g77. If I create
the librarie .a with -O2, the code does not run. The same occured with
ifort which has -O2 by default. When I switched off this option when
compiling the library, the code could run. The important thing would be
to understand why it is so, with g77 and with ifort. But I leave that
to specialists ! I am physicist !!
Xtof
Xtof
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing the code, my guess would be that there is a coding error that is aggravated by optimization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a physicist, too. That is no excuse for not posting the code. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will comment that one compiler's -O2 is different from another compiler's -O2. The set of optimizations done and not done vary by compiler. You can't compare optimization levels across different compilers.
If your code does not run with optimization, especially with two different compilers, that strongly suggests you have a bug in your code. You should avail yourself of the diagnostic capabilities of the compilers. I'll also comment that there's no reason to still be using g77 nowadays - use gfortran or g95 instead.
If your code does not run with optimization, especially with two different compilers, that strongly suggests you have a bug in your code. You should avail yourself of the diagnostic capabilities of the compilers. I'll also comment that there's no reason to still be using g77 nowadays - use gfortran or g95 instead.
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