0

While VTune Analyzer was running on a blade server with 8 cores, I observed the cpu useage percentage using mpstat -P ALL 1.

mpstat showed me that VTune was taking up 100% of a single core, while all other cores were idle.

Why does that happen? Shouldn't the OS (RHEL Server 5.2) automatically distribute load across cores? The same happened when I tried running MATLAB (even after enabling multithreading support in the MATLAB settings).

p.s: I'm a developer. Not a sys admin. So felt it better to ask here rather than at serverfault.

Nav
  • 1,089

1 Answers1

3

The operating system distributes threads across cores.

A process consists of one or more threads.

A process that only has one thread can only run on one core. A process with 2 threads can run on 1 core or 2 cores. A process with 500 threads can run on as many cores as you have (say 125 threads per core for a quad core).

So it's all down to the process.

This will only ever run on one core:

for(i=0; i<1000; i++)
{
    do_something_intensive();
}

Whereas this is more core friendly:

pthread_create(pth1,&do_something_intensive,attr,&args);
pthread_create(pth1,&do_something_else_intensive,attr,&args);

For example.

Majenko
  • 32,964