- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "conventional wisdom" was that icc was best by large margin (both as code size and speed), gcc most widespread and multiplatform, and Clang immature, but promising. Something along those lines:
http://www.hortont.com/blog/icc-and-mandelbrot/
But I have recently tested those compilers on my project (about 120k lines of C) on OpenSUSE 12.2, and things have changed radically. GCC 4.7.1 is on pair with icc 12.1.5, while Clang is approximately 25% slower. But Clang has excellent compile errors and warnings, and its static analysis is just superb. So some projects are switching from gcc to clang as default compiler.
Has anyone recently (in 2012) done any serious benchmarking of these compilers? Or can you share the benchmark tests of your production code? Which compile options give you best results? What is your justification for using icc, now that free compilers have improved so much?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dpeterc wrote:Hi, I'll do it as soon as I receive a new system with a 64-bit Windows...Hi Sergey,
Thank you for your comments. Please post your benchmarks, once you find times to make them, or links to relevant sites which contain solid benchmarks, in your opinion.Best regards,
Dušan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using GCC 4.8.1 compiler and Intel ICC 13 compiler. I'm using Ubuntu Server 12.04 64 bit on Intel Sandy Bridge core i7-3930K. I found that with these command line g++ -O3 -march=core-i7 -mtune=core-i7 -mavx and icpc -O3 -xAVX, GCC produces superior performance w.r.t. to ICC about 15%.
I'm amazing about the results, probably I'm forgetting something optimization flag for Intel compiler. Otherwise it's great advance of GCC.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
icpc 14.0 (recently completed beta, release expected in a few weeks) gains optimizations for * __restrict (no longer depending on #pragma ivdep) so as to match performance of g++.
You do need -ansi-alias option (equivalent to g++ default -fstrict-aliasing) for icpc to be competitive. That would not become a default for linux within the next year (and is not under consideration for Windows default). Except for that, the more aggressive default optimizations of icpc are considered a sales point. By using the (somewhat complicated) options for unrolling in g++ you could gain advantages over icpc for additional cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey, your option set is more complicated than g++ !
gcc/g++/gfortran equivalent of /fp:fast=2 is -ffast-math. These options imply /complex-limited-range (-fcx-limited-range) and have some limitations on handling of division/sqrt. They can break many applications.
gfortran equivalent of /Qopt-matmul is -fexternal-blas (can use MKL, ACML, libblas et al.)
gcc/g++/gfortran equivalent of /Qunroll:4 is -funroll-loops --param max-unroll-times=4
As pointed out earlier, Intel compilers under VS GUI default to /Qipo, which is equivalent to gnu -flto. This could invalidate benchmarks such as the one I quote below.
I mention these as it's entirely possible to use consistent options to compare the compilers. You appear to agree with me on the fallacy of comparing with the simplest possible (inconsistent) option settings.
I extended the benchmarks at https://sites.google.com/site/tprincesite/levine-callahan-dongarra-vectors to include Intel(r) Cilk(tm) Plus (not that I expect anyone to be much impressed).
Most cases perform essentially the same with most of the compilers tested. Claiming some score such as some compiler is 10% better on geometric mean basis isn't very meaningful. Excluding non-vectorizable cases boosts the relative score of Intel compilers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I provided a minimal options for both compiler g++ -O3 -march=core-i7 -mtune=core-i7 -mavx and icpc -O3 -xAVX. I wonder to know if Intel compiler is less performing with these minimal options.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nedo n. wrote:
I provided a minimal options for both compiler g++ -O3 -march=core-i7 -mtune=core-i7 -mavx and icpc -O3 -xAVX. I wonder to know if Intel compiler is less performing with these minimal options.
The absence of unrolling options or one which permits vectorized sum reduction will frequently pose a significant handicap for g++, as will the absence of -ansi-alias for icpc. These evidently would affect different cases.
For g++, the option -march=native could be used to replace all the core-i7 and avx options. There's probably no need to duplicate options under -mtune which are given already in -march.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sergey,
please can you provide a set of best options for both compiler so I can do a fair comparison?
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You do need -ansi-alias option (equivalent to g++ default -fstrict-aliasing) for icpc to be competitive. That would not become a default for linux within the next year (and is not under consideration for Windows default). Except for that, the more aggressive default optimizations of icpc are considered a sales point. By using the (somewhat complicated) options for unrolling in g++ you could gain advantages over icpc for additional cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My ICC version on Linux is 12.1.5, and -W5 does not work, documentation only mentions -Wremarks, but it does nothing on my code.
I also have ICC on OSX, version 11.1, and same compile options as on Linux produce a lot of useful remarks, just like you mention for -W5. I have spent a week cleaning my code ;-(
It is strange that slightly different version of same compiler produces very different level of warnings and remarks.
Anyway I must say that icc, while being powerful, also requires a lot of "babysitting", with each new release, you must study the options, default options for O1, O2, O3 change. I could run gcc, upgrading Linux with new versions, for years without knowing that much about compiler options. On icc, if you want good results, you need to study and try the options. It is especially difficult since the number of options is very high, some cause compiler to fail or take a very long time to compile, and make very big executable. And doing run time tests is difficult, since the particular set of compile optimizations may benetif your version of CPU, but not the one your customer is using.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're looking for inconsistencies among version of gcc, they're not difficult to find. People still use versions where defaults differ from current gcc.
-fprotect-parens was a default for one major gcc version, regardless of whether -ffast-math was set, but afterwards only gfortran stayed that way.
-finline-functions used to be in effect by default only for -O3, and it used to inline only functions which appeared earlier in the file.
-ftree-vectorize was not always implied by -O3.
-fstrict-aliasing used not to be a default, but has been one for years now. icc will not make such a change for another year at the earliest, and then it would differ between linux and Windows.
People still get hung up over gcc -m32 defaulting to i486, so the change to icc defaulting to -msse2 some time ago made sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page