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.

1
  • 1
    The software you're using might not be able to utilize multiple cores in parallel. As for MATLAB, maybe there are some aspects that cannot be parallelized?
    – Daniel Beck
    Mar 19, 2011 at 7:50

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .