Re: two instances of a.exe on dual processor - still only 50% performance
Hi Brian, Many thanks for this tip. I tried it out and indeed there is a Set Affinity option in the Taskmanager. Apparently, this option lets you assign one or more of the 4 virtual processors to a particular task. (W2K seems to have this concept of virtual processors, I am no expert at all here). But it doesn't change a thing. still 50% are spent on Idle mode... :( cheers Mathias Brian Bruns [EMAIL PROTECTED] 06.07.2004 21:03 To: Mathias Wagner/HBG/SC/[EMAIL PROTECTED] [EMAIL PROTECTED] cc: Subject:Re: two instances of a.exe on dual processor - still only 50% performance Classification: On Tuesday, July 06, 2004 2:16 PM [EST], [EMAIL PROTECTED] wrote: Hi guys, I've tried to plough through your archives on dual processors and somebody said that when you've got a dual processor machine, one has to start two instances of one's program to get both processors working - one on each job. Fine, this is what I used to do on a DEC Apha, but on my Windows box this does not seem to be the case. I still get only 50% out of the box when checking with taskmgr... What am I doing wrong? Do I need to write multi-threaded, whatever that is? Doesn't seem to make much sense to me. Two perfectly independent jobs should run just fine along each other, using both CPUs to the maximum... Many thanks for any help! Mathias From my experience, you have to set the process's processor affinity (my spelling sucks). In windows, this can be done IIRC by using the task manager. You tell it which processor you want the process to run on exclusively. Of course, this was many years ago when I last played with dual processors on a Windows machine (why waste such system power with an OS like Windows when Linux can make the most of it?). Ahh the days of dual PPro 200s and Windows 2000 Pro :) -- Brian Bruns The Summit Open Source Development Group Open Solutions For A Closed World / Anti-Spam Resources http://www.sosdg.org The Abusive Hosts Blocking List http://www.ahbl.org -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
[EMAIL PROTECTED] wrote: Many thanks for this tip. I tried it out and indeed there is a Set Affinity option in the Taskmanager. Apparently, this option lets you assign one or more of the 4 virtual processors to a particular task. (W2K seems to have this concept of virtual processors, I am no expert at all here). But it doesn't change a thing. still 50% are spent on Idle mode... You see 4 CPUs because of HyperThreading. A HT CPU registers with the OS as two CPUs, but it's not. Only in certain circumstances can it run two threads concurrently (such as performing an integer and floating operation at the same time.) Thus 50% CPU usage means that your system is fully loaded. On a HT system you've got to double all the CPU usage percentages for it to make sense. Occasionally you might see it surpass 50%, which would mean that the hyperthreading is particularly suited to whatever combination of instructions is being executed and it's using the CPU more efficiently. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
Brian Dessent wrote: [EMAIL PROTECTED] wrote: Many thanks for this tip. I tried it out and indeed there is a Set Affinity option in the Taskmanager. Apparently, this option lets you assign one or more of the 4 virtual processors to a particular task. (W2K seems to have this concept of virtual processors, I am no expert at all here). But it doesn't change a thing. still 50% are spent on Idle mode... You see 4 CPUs because of HyperThreading. A HT CPU registers with the OS as two CPUs, but it's not. Only in certain circumstances can it run two threads concurrently (such as performing an integer and floating operation at the same time.) Thus 50% CPU usage means that your system is fully loaded. On a HT system you've got to double all the CPU usage percentages for it to make sense. Occasionally you might see it surpass 50%, which would mean that the hyperthreading is particularly suited to whatever combination of instructions is being executed and it's using the CPU more efficiently. Brian Sorry Brian, that is bogus. I'm running one HT processor right now. The combined CPU utilization is not an actual display of usage, but theoretical usage, based on scheduling. It's really how much of the CPU was NOT being used by the idle task, and given that there is only one CPU, if some process is taking up 99% of it, and some other process takse up the other 1% on the other 'hyper thread' then the idle task will not be able to run at all on either virtual cpu. Thus Task Manager will (and does) show 100% dual CPU utilization. Now, Mathias's problem: Sounds like your program is bound by something other than CPU. If you have two programs that try to access the hard-disk, they are not going to be twice as fast with 2 CPUs (virtual or not). -Rolf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
At 01:24 PM 7/7/2004, Rolf Campbell wrote: Brian Dessent wrote: mathiasdotwagneratphilipsdotcom wrote: Many thanks for this tip. I tried it out and indeed there is a Set Affinity option in the Taskmanager. Apparently, this option lets you assign one or more of the 4 virtual processors to a particular task. (W2K seems to have this concept of virtual processors, I am no expert at all here). But it doesn't change a thing. still 50% are spent on Idle mode... You see 4 CPUs because of HyperThreading. A HT CPU registers with the OS as two CPUs, but it's not. Only in certain circumstances can it run two threads concurrently (such as performing an integer and floating operation at the same time.) Thus 50% CPU usage means that your system is fully loaded. On a HT system you've got to double all the CPU usage percentages for it to make sense. Occasionally you might see it surpass 50%, which would mean that the hyperthreading is particularly suited to whatever combination of instructions is being executed and it's using the CPU more efficiently. Brian Sorry Brian, that is bogus. I'm running one HT processor right now. The combined CPU utilization is not an actual display of usage, but theoretical usage, based on scheduling. It's really how much of the CPU was NOT being used by the idle task, and given that there is only one CPU, if some process is taking up 99% of it, and some other process takse up the other 1% on the other 'hyper thread' then the idle task will not be able to run at all on either virtual cpu. Thus Task Manager will (and does) show 100% dual CPU utilization. Now, Mathias's problem: Sounds like your program is bound by something other than CPU. If you have two programs that try to access the hard-disk, they are not going to be twice as fast with 2 CPUs (virtual or not). -Rolf Sorry Rolf, but at least on my HT processor running Windows XP pro, the reporting of utilization by task manager is exactly as described by Brian. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
Ken Thompson wrote: At 01:24 PM 7/7/2004, Rolf Campbell wrote: Sorry Brian, that is bogus. I'm running one HT processor right now. The combined CPU utilization is not an actual display of usage, but theoretical usage, based on scheduling. It's really how much of the CPU was NOT being used by the idle task, and given that there is only one CPU, if some process is taking up 99% of it, and some other process takse up the other 1% on the other 'hyper thread' then the idle task will not be able to run at all on either virtual cpu. Thus Task Manager will (and does) show 100% dual CPU utilization. -Rolf Sorry Rolf, but at least on my HT processor running Windows XP pro, the reporting of utilization by task manager is exactly as described by Brian. Strange, I'm running WinXP pro, all patched up. And if I run two CPU bound programs (cygwin or not) my utilization goes to 100% (easily). -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
[EMAIL PROTECTED] wrote: Many thanks for this tip. I tried it out and indeed there is a Set Affinity option in the Taskmanager. Apparently, this option lets you assign one or more of the 4 virtual processors to a particular task. (W2K seems to have this concept of virtual processors, I am no expert at all here). But it doesn't change a thing. still 50% are spent on Idle mode... :( IIUC, I think you've come across how Intel's HyperThreading (HT) presents itself to the OS, and how Windows copes with it. This is not a Cygwin problem. Basically all (?) new P4's come with HT. HT presents each physical CPU to the system as two virtual CPU's. The idea is that two threads can run simultaneously on the same CPU core, as long as they are not using the same parts of that core (e.g. one is on is doing floating point, one is doing integer). Theoretically this should increase CPU throughput as well as providing some of the normal SMP benefits (e.g. system doesn't lock up under heavy load). Uunfortunately, Windows doesn't (yet?) know that virtual CPU's aren't the same as physical CPU's. THis means a system with one HT enabled CPU appears to have two, and one with two physical CPU's (like yours) appears to have four. This means that a workload that would be 100% on a non-HT system is displayed as 50% on an HT system. You only ever get above 50% if HT is actually improving the situation *right now* and you are getting more throughput than you would without HT. In my experience (I've got a single HT P4), the CPU load sometimes goes up to the mid 50's but the only thing I've seen saturate it to 100% is VirtualPC. Must be something about their emulation layer. If your program is doing the same sort of operations throughout (e.g. long running loop of integer math) then I doubt you'll get it above 50%. I would guess writing code to take advantage of HT is quite difficult but if you have integer fp math interspersed, I suppose it might be worth running 4 copies and setting the affinity of each to a different virtual CPU. Hopefully the threads will get out of step and execute concurrently. HTH, James -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: two instances of a.exe on dual processor - still only 50% performance
On Tuesday, July 06, 2004 2:16 PM [EST], [EMAIL PROTECTED] wrote: Hi guys, I've tried to plough through your archives on dual processors and somebody said that when you've got a dual processor machine, one has to start two instances of one's program to get both processors working - one on each job. Fine, this is what I used to do on a DEC Apha, but on my Windows box this does not seem to be the case. I still get only 50% out of the box when checking with taskmgr... What am I doing wrong? Do I need to write multi-threaded, whatever that is? Doesn't seem to make much sense to me. Two perfectly independent jobs should run just fine along each other, using both CPUs to the maximum... Many thanks for any help! Mathias From my experience, you have to set the process's processor affinity (my spelling sucks). In windows, this can be done IIRC by using the task manager. You tell it which processor you want the process to run on exclusively. Of course, this was many years ago when I last played with dual processors on a Windows machine (why waste such system power with an OS like Windows when Linux can make the most of it?). Ahh the days of dual PPro 200s and Windows 2000 Pro :) -- Brian Bruns The Summit Open Source Development Group Open Solutions For A Closed World / Anti-Spam Resources http://www.sosdg.org The Abusive Hosts Blocking List http://www.ahbl.org -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/