LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2009, 12:52 PM   #1
VelocideX
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Rep: Reputation: 15
g77 3x faster than gfortran - why? What can I do?


Hi all,

I have some quite old fortran 77 code which is compatible with gfortran. The code is tens of thousands of lines, and is used for scientific purposes.

I would love to move to gfortran, but it seems exceptionally slow. Why does the code execute 3x faster with g77 than gfortran?!

Any help would be much appreciated

I am using the same compiler flags for both (-O2). Using -O3 makes no difference. I should mention I'm running OpenSuSE 11.1 64 bit (i.e. the x86-64 architecture).

Last edited by VelocideX; 05-13-2009 at 02:08 PM.
 
Old 05-13-2009, 01:34 PM   #2
VelocideX
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Original Poster
Rep: Reputation: 15
OK I have gprof-ed the code, to see where the difference are. One routine grows massively in time expenditure, although I can't understand why as it's a simple convolution routine.

Faster version(g77):
Code:
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name

 64.12      2.52     2.52    23679     0.00     0.00  vp_spvoigte__
 19.34      3.28     0.76 28574044     0.00     0.00  voigt_
  6.36      3.53     0.25       12     0.02     0.28  deriv_
  4.33      3.70     0.17 32747695     0.00     0.00  dexpf_
  3.05      3.82     0.12      877     0.00     0.00  vp_chspread__
  1.27      3.87     0.05        1     0.05     0.05  pr_sort__
  0.51      3.89     0.02        1     0.02     0.02  probks_
  0.25      3.90     0.01    23679     0.00     0.00  calcn_
  0.25      3.91     0.01      877     0.00     0.00  vp_chipconv__
  0.25      3.92     0.01       11     0.00     0.00  udchole_
  0.25      3.93     0.01        1     0.01     0.01  pldef_
  0.00      3.93     0.00   550174     0.00     0.00  ucase_
Slower version (gfortran):
Code:
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name

 43.27      3.28     3.28    33885     0.00     0.00  vp_spvoigte_
 27.04      5.33     2.05     1255     0.00     0.00  vp_subchspread_
 16.36      6.57     1.24 41100608     0.00     0.00  voigt_
  6.99      7.10     0.53 528972139     0.00     0.00  dexpf_
  3.56      7.37     0.27       17     0.02     0.38  deriv_
  0.66      7.42     0.05        1     0.05     0.05  pr_sort_
  0.66      7.47     0.05        1     0.05     0.05  probks_
  0.40      7.50     0.03   478767     0.00     0.00  varythis_
  0.40      7.53     0.03        1     0.03     7.52  vp_ucoptv_
  0.26      7.55     0.02    33878     0.00     0.00  vp_archwav_
  0.13      7.56     0.01    33885     0.00     0.00  calcn_
  0.13      7.57     0.01     1255     0.00     0.00  vp_chipconv_
  0.13      7.58     0.01        1     0.01     0.01  vp_gwclinfits_
  0.00      7.58     0.00   793778     0.00     0.00  ucase_
Even dexpf, which is part of glibc, is massively slower with gfortran... =\

Last edited by VelocideX; 05-13-2009 at 02:08 PM.
 
Old 05-15-2009, 03:12 PM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Knoppix
Posts: 1,823
Blog Entries: 14

Rep: Reputation: 282Reputation: 282Reputation: 282
I don't have an answer for you, but I do have an observation.

My experience has been that difffernt compilers work well, or less well than others for specific pieces of code. Even a seemingly trivial change in the way the code is written can sometimes trigger less than ideal behaviour on the part of the compiler. It can be the most annoying kind of bug to track down.

Perhaps you can isolate the problem and bring it to the attention of the gfortran developers so that they can track down the problem. Since you know it is one routine, I'd try to make a shorter version that will run independently of the rest of the code to see whether you still see a big time lag. If it's a smaller piece of code you might get someone to look at it or run it on a differerent compiler to see what kind of problems they get or don't get.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
g77 compiles fortran 77 code; gfortran gives weird errors. Why? VelocideX Programming 5 04-22-2009 02:03 AM
g77 in gcc 4.1.0 not found only gfortran fortran 95 compiler! I need fortran 77. TheBrick Linux - Software 3 07-04-2007 06:39 AM
undefined gfortran references when compiling with g77 StudMuffin Linux - Software 4 02-17-2007 06:06 AM
install of g77 or g77 rpm munichtexan Linux - Newbie 1 11-18-2005 02:56 PM
Compiling with g77 thank you very much...but I solved compile with g77 gambato79 Fedora 9 07-19-2005 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration