Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
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 '11 at 7:50

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.