Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

multi-core optimization on linux

ferreus
Beginner
388 Views
Hi, i'm trying the Intel Linux C++ Compiler Evaluation version.
I'm testing some simple serial application on Intel Xeon processor.
And i noticed something strange, sometimes the application which does some heavy processing,
is using 2 cores, i can see that the process takes equal load on 2 cores.
And on another run, with same input, it uses only one core.

I'd like to understand how does it work, and if i can fine tune the application and specify the number of cores for the application.
0 Kudos
2 Replies
TimP
Honored Contributor III
388 Views
If you're using icpc -parallel, check the par-report options for more information on what is not parallelized and why. The par-threshold may be set lower than the default 100, to cause parallelization when the compiler heuristics show lower probability of gain.
Remember the usual advice to study and implement other optimizations, including vectorization, before working on parallelism, unless your only goal is to load up more cores without gaining performance.
0 Kudos
ferreus
Beginner
388 Views
In this case, i didn't specify any specific compiler flags, i just replaced gcc with icc,
and added -fast to CFLAGS.
What i don't understand is why the cpu core loads are different.
I ran the program several times, with same input data, and sometimes the process uses 2 cores, and sometimes 1.
I'm looking for some explanation of this. And if there's a way to fine tune the core's load.

Thanks.
0 Kudos
Reply