Menu

gcc versus icpc

2008-11-05
2012-09-15
  • Antoine PRANG

    Antoine PRANG - 2008-11-05

    Hi everybody,
    I have developped a software with itpp (4.0.5). And it works good, but i would like to have it faster...
    So I decided to use the intel C++ compiler (icpc). Indeed I have a PC with a Q6600 (intel quand core) and the gcc 4.2.3 don't have the CXXFLAGS -march=core2.
    I used gcc (4.2.3) with mkl (10.0.4.023) on ubuntu (8.04), with CXXFLAGS : -DNDEBUG -O3 -pipe
    To install the intel C++ compiler, I must downgrad my ubuntu and I install a 7.04 (to have a older version of libstdc++). I make it, and I install the intel compiler (C++ and fortran) (version :10.1.018)
    First I compile itpp and my program with the CXXFLAGS : -DNDEBUG -O3 -xT (i still use the same version of mkl)
    and so...
    It is 2 times slower than with gcc...
    I don't loose hope and I try many compiler flags : -parallel, -march=core2...
    But it is always about two time slower...
    I didn't expect this result...
    I think it is a bit strange.
    Have someone test the intel compiler and could confirm my result ?
    And have an explication for this result ?
    Thanks.

     
    • Hung Dang

      Hung Dang - 2008-11-16

      Do you set the number of threads to 1 when you running your test program? If you don't set the number of threads your program may run with 4 threads and it may be slower than single thread code.

      Below is my configuration script:

      ./configure --prefix=/home/hungptit/hhsim++/ CC=icc CXX=icc F77=ifort CXXFLAGS="-O2 -parallel" --enable-static --enable-shared LIBS="-lstdc++" --with-blas="-lmkl_intel_thread -lmkl_core -lguide -lpthread -lmkl_intel_lp64" --with-lapack="-lmkl_lapack"

      when I compile my test program I will use the cflags returned from itpp-config script.

      Hung

       
    • Hung Dang

      Hung Dang - 2008-11-10

      I always use CXXFLAGS=-O2 -parallel -ip for ICC on my Q6600, your program may not be faster with -O3 flag. For all of my test programs compiled with ICC are at least 7% faster than that of GCC.

      I use Intel compiler and intel MKL in my Gentoo AMD64 box using Q6600 with latest libraries (gcc 4.3.2) without any problem. You do not need to downgrade your linux system due to libstdc++, check out information about how to install Intel compiler from Intel website. Since you have Intel system your programs even run faster if you use Intel MKL.

      Hung

       
    • Antoine PRANG

      Antoine PRANG - 2008-11-13

      I just retry to compile it++ with the intel compiler...
      I install the new one (v 11) with the new mkl.
      The new version of the intel compiler support ubuntu 8.04.
      For the installation of icpc, I install 2 packets (with the dependances) : g++ (version 4.2.3)
      and libstdc++5 (it's an older version of libstdc++) but it is write on the intel site that the intel compiler need g++ and libstdc++.so.5.
      And I use the flag CXX=icpc and your CXXFLAGS, and the good CPPFLAGS and LPFLAGS.
      But I always have the same results...
      With the intel compiler, my software is 2 times slower...
      I try an other things :
      I have reading the config.log that the ./configure generate and I have seen :
      LD = /usr/bin/ld
      and so I think that it is the reason...
      And I try with the other flag : LD=icpc
      that compile, but it is always slower...
      I use the intel vtune analyser on the 2 softwares.
      And I have see that, the version compiled with icpc spent a lot of time (85%) in the module libguide.so (a librarie provided by intel), whereas the version compiled with gcc spend just 20% in libguide.so.
      Can you describe the procedure to install it++ with the intel compiler ?
      And which flags have you set ?
      Thanks.

        Antoine
      
       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.