Bug 236076

Summary: Please consider including the AMD's x86-64 math library
Product: [Fedora] Fedora Reporter: Deji Akingunola <dakingun>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-16 14:02:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
benchmark program from polyhedron testsuite none

Description Deji Akingunola 2007-04-11 20:22:23 UTC
Description of problem:
Running the 'ac' program from the polyhedron fortran benchmark on x86_64 rawhide
installation, take longer time (about 3X) when compiled natively (i.e. using
-m64) than when compiled with -m32 option.
I've noticed the same scenario in my own programs before, and when I asked on
the gfortran list it was said that stock glibc lacked optimized math libraries
for x86_64. Some other distributions are said to be carrying the patch already;
in fact gfortran daily polyhedron test on such distro shows compiling with -m64
can be faster than -m32 on x86_64 systems with the patch
(http://www.physik.fu-berlin.de/~tburnus/gcc-trunk/benchmark/).

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Runtime info on the ac program from polyhedron fortran benchmark are given below
(I'm also attaching the source code);
With -32 option
[deji@agape source]$ gfortran -m32 -march=athlon64 -ffast-math -funroll-loops
-ftree-vectorize -msse3 -O3 -w ac.f90 -o ac
[deji@agape source]$ time ./ac Opening files
 Initializing variables
 Creating random initial configuration
 Equilibrating
 Taking samples
 Setting initial state
  Parameters in the autocorrelation test: 
       Initial seed:                         14159.0000000000     
       Lattice size (L):                            16
       Number of samples (ISCANS):             1000000
       Coupling constant (DK):              0.440686793509770     
       Number of omitted confs. (MCBEG):         10000

  Average energy of the system:              1.45270668750000     
  and its squared (error estimate / tau):   6.052927893555487E-008

  Average susceptibility of the system:     0.545241659667969     
  and its squared (error estimate / tau):   2.525045507563519E-005

  Average flipped cluster size:              139.590589000000     
  and its squared (error estimate / tau):   1.515278492326616E-002
  ------------------------------------------------------------------
  The notation <squared (error estimate / tau)> means the following:
  to get the correct error estimate, multiply the given value by
  the integrated autocorrelation time tau (see comments in the code 
  for details), and then take a square root.
  ==================================================================

real    0m13.143s
user    0m13.024s
sys     0m0.008s

Natively:
[deji@agape source]$ gfortran -march=athlon64 -ffast-math -funroll-loops
-ftree-vectorize -msse3 -O3 -w ac.f90 -o ac
[deji@agape source]$ time ./ac Opening files
 Initializing variables
 Creating random initial configuration
 Equilibrating
 Taking samples
 Setting initial state
  Parameters in the autocorrelation test: 
       Initial seed:                         14159.0000000000     
       Lattice size (L):                            16
       Number of samples (ISCANS):             1000000
       Coupling constant (DK):              0.440686793509770     
       Number of omitted confs. (MCBEG):         10000

  Average energy of the system:              1.45302590625000     
  and its squared (error estimate / tau):   6.031260731398280E-008

  Average susceptibility of the system:     0.545497000793457     
  and its squared (error estimate / tau):   2.520904515483778E-005

  Average flipped cluster size:              139.688266000000     
  and its squared (error estimate / tau):   1.513849592782648E-002
  ------------------------------------------------------------------
  The notation <squared (error estimate / tau)> means the following:
  to get the correct error estimate, multiply the given value by
  the integrated autocorrelation time tau (see comments in the code 
  for details), and then take a square root.
  ==================================================================

real    0m36.653s
user    0m36.562s
sys     0m0.076s

Comment 1 Deji Akingunola 2007-04-11 20:22:23 UTC
Created attachment 152321 [details]
benchmark program from polyhedron testsuite

Comment 2 Deji Akingunola 2007-11-16 14:02:52 UTC
Now on F-8 and using gfortran from gcc trunk, the 64bit compilation run slightly
faster (~1s) than the 32bit compilation.