On 2005-05-23 09:20:07 +0200, Marco Calviani
<[EMAIL PROTECTED]> said:
Hi,
i have one general question regarding the use of a dual Opteron CPU
using a smp kernel. I'm currently running a cpu intensive program that
use for some hours 100% of the cpu time. But having a look with top at
the processes it seems that only one CPU is doing the work at 100%: the
other one seems idle for most of the time.
Here i'm posting the normal behaviour:
CPU states: cpu user nice system irq softirq iowait idle
total 99,0% 0,0% 1,4% 0,0% 0,0% 0,0% 99,4%
cpu00 0,0% 0,0% 0,4% 0,0% 0,0% 0,0% 99,5%
cpu01 99,0% 0,0% 0,9% 0,0% 0,0% 0,0% 0,0%
Is this behaviour right for a dual cpu machine, or there is something
not going right?
Thanks in advance,
MC
the problem (probably) is, that your application isn't smp enabled,
like others said.
this means, that your application is designed to do one task at a time,
like for example, if you'd like to add 7 to 3 and put in in A, and
afterwards like to add 9 to 7 and put it in B. If your application is
designed like this, dual processor wont do you any good.
You can design your application to use threads. In this case, one
thread will add 7 to 3 and put it in A, the other will add 9 to 7 and
put it in B. One thread will run on one CPU, the other thread on the
other. You application will be (in theory) twice as fast.
Multi threaded programming isn't possible in every situation. Let's say
you want add 7 to 3 and put it in A, and then add 7 to A and put it in
B. The first task has to be finished before the second can start. I
think you can imagine, that the more complex your applications get, the
harder it is for some compiler to decide what can and cannot be done
using threads and what cannot. Therefore, smp applications are always
of that nature by software design, and not by compiler settings.
So, short version, if your application isn't multithreaded, this is
because the task at hand can't be put into multiple threads, or the
software developper just didn't care about it. In either case, you're
pretty much out of luck, unless you care to redesign the application
yourself. Recompiling it, won't really do you any good I'm afraid.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]