Blitz logo

Blitz Support :

From: psong_at_[hidden]
Date: 2004-04-27 16:33:54


Hi,
  I am always curious about whether blitz-0.7 can run faster when compiled
with icc instead of g++. So I did a little experiment. I compiled Blitz++-0.7
with both icc8.0 (./configure --with-cxx=icc) and g++3.2 (./configure
--with-cxx=g++). Then I tested the cfd example in Blitz++-0.7/examples
directory. The machine I used is a redhat9 linux box with dual AMD
Athlon MP 1800+ 1.53GHz CPUs and 512MB memory. I got some really surprising
results.
   (1) The icc version is almost nine times faster than the g++3.2.2 version.
It took 3min20sec for the icc version to run but 28min50sec for the
g++ version. I did not expect such a big difference.
   (2) The results from the two versions seems to be different. Here I only
include the final part of the output of the program.
*********************** icc version: ***********************
Slice through rhs:
50
 [ 0 0 -4.14348e-23 4.54798e-22 -7.86881e-22 4.08506e-22
1.57643e-22
  -9.68548e-22 2.32089e-21 -4.50962e-21 2.99997e-21 2.99224e-21 -4.35966e-21
1.64765e-21
  -2.96198e-22 1.52857e-23 -1.90872e-24 1.10982e-22 -1.29003e-21 5.07216e-21
1.29254e-21
  -1.0366e-20 1.29254e-21 5.07216e-21 -1.29003e-21 1.11006e-22 -2.86873e-24
-5.05882e-24
  2.29449e-22 -3.33622e-21 1.56546e-20 3.34109e-21 -3.17673e-20 3.34109e-21
1.56549e-20
  -3.33117e-21 1.73702e-23 7.43428e-22 6.45756e-21 -2.32643e-20 1.67113e-20
-7.85529e-20
  1.654e-19 -1.29266e-19 4.14796e-20 6.03677e-20 -1.45305e-19 1.6155e-19

  0
          0 ]
Average magnitude of r is 1.13775e-09
CG: Iter 0 rho = 4.44871e-13
Velocity field: norm = [0 0 1.09261e-26 ]
Maximum velocity is 3.00893e-13 m/s
Set time step to 0.01 s
*********************** end of icc version ***************************

######################## g++ version ##################################
Slice through rhs:
50
 [ 0 0 -0 4.38791e-23 -3.94912e-22 3.51033e-22
3.51033e-22
  -3.94912e-22 4.38791e-22 -3.5542e-21 3.15929e-21 3.15929e-21 -3.5542e-21
3.94912e-22
         -0 -0 -0 -0 -6.28765e-22 5.03012e-21
6.28765e-22
  -1.00602e-20 6.28765e-22 5.03012e-21 -6.28765e-22 -0 -0

-0
         -0 -1.89145e-21 1.51316e-20 1.89145e-21 -3.02632e-20 1.89145e-21
1.51316e-20
  -1.89145e-21 -0 -6.13934e-22 6.7011e-21 -1.4317e-20 3.92053e-21
-7.43826e-20
  1.70933e-19 -1.40588e-19 4.82186e-20 5.34368e-20 -1.37968e-19 1.67234e-19

     0
          0 ]
Average magnitude of r is 4.74854e-09
CG: Iter 0 rho = 6.80132e-12
Velocity field: norm = [0 0 1.08118e-26 ]
Maximum velocity is 3.00783e-13 m/s
Set time step to 0.01 s
################## end of g++ version ###############################

I have two questions:
  Q1: why the icc version is so much faster? Is it real? I actually compiled
one of my own programs (too long to include here) with both icc and g++. The
difference in speed is very small (5%).
  Q2: Which version actually give the correct result for the cfd program? Or
the result difference is expected?

Thank you for your attention!

Simon