7

Can a Multi core CPU server be configured to allow the OS to see all the cores as a single CPU and there by allowing the processor to function as a single CPU?

A lot of modern day servers are multicore CPUs. Are they ways for all the CPU cores to report as 1 CPU to the OS? This would be handy to run applications was designed for a single CPU.

1
  • If we could do that, what would the point of multi-core CPUs be? – David Schwartz Aug 28 '11 at 4:51

12 Answers 12

23

What you're asking is

"Can I run a single threaded application on a multi-core machine and take full advantage of all the cores?"

The answer is : no

A single threaded application can only run on one core and will never be able to use more resources than that single core can provide.

1
  • 5
    If you find a way to do this, then you'll be able to retire and live on a beach somewhere :) – Rory Jan 14 '10 at 15:00
4

Are you saying that with say a 4 core 3Ghz CPU you want the OS to see it as a single core 12Ghz CPU? If that's the case, then no, you can't do that.

Unless the application is specifically written to require access to CPU0 (and I'm not even sure if that's a possibility) it shouldn't matter.

Toms hardware has a utility for having an application have affinity for a specific CPU when launched. I haven't tried it so take it for what you will. It can be found here

3

as i understand you wish to transform dual core cpu to one cpu that would be [ from perspective of single threaded application ] twice as fast as each of cores. unfortunately this cannot be done. closest to it is idea implemented in intel's i7 cpus which can smartly overclock one of cores if they see it's mostly loaded while oder cores are idle.

2

If an app can only use one CPU, it will anyway. It does not matter how many are present.

The OS will see all enabled CPUs but should be able to separate core vs socket for example (eg SQL Server affinity). But no, you can't make a 4 cores appear as one to OS thats I know of.

1

Depending on the BIOS, you might be able to disable all but one of the cores, but you're going to lose a large part of the performance. You can also set programs to run on a single core.

Creating a virtual machine with a single core would also provide a solution.

3
  • If Virtualization is used, can the VM use the physical multicore effectively while offering a single processor to the application? Would the performance be better than the application directly using a single physical core? – L. DPenha Jun 1 '09 at 20:06
  • 1
    No, the fastest single CPU you can add to the guest is the speed of the host CPU, minus a bit for overhead. – Dentrasi Jun 1 '09 at 21:09
  • No. On VMware (for example), a single virtual CPU can use as much CPU in Mhz as a single core. This is, in essence, no different than your original situation because adding a second virtual CPU will not benefit a single threaded application. – Kevin Kuphal Jun 1 '09 at 21:47
1

Regarding using VM's to solve this problem: The point would be to use as many single-core VM's as there are physical cores in the system. Then run a single instance of the app on each VM. This will actually result in each individual instance running slightly slower than if run by itself on the host OS; however, it will allow for much more parallelization of the workload.

This is all assuming that your environment and code will allow multiple instances of this app and that you could break the workload into chunks for the instances.

Granted, the best way of doing this would be to re-write the app to be multithreaded; however, many times that can be impractical in terms of developer man hours.

1

AMD REVERSE HYPER-THREADING!

http://www.theinquirer.net/inquirer/news/1005560/amd-socket-am2-has-a-secret-weapon


(Spoiler: it does not exist.)

1
  • I do wonder about that, a 4 or more HT core, with prioritization so one thread can grab all available resources, and let the other threads take what it leaves, as a way to get better single threaded performance (for the app that can handle running that wide, such as scientific computing, or likely gaming), while still offering good utilization via HT for normal workloads vs 2 cores with two threads each. – Ronald Pottol Sep 13 '09 at 20:43
0

As was asked in a comment by the OP, what about running the OS and application in a VM? Would that essentially be the same as faking a single faster CPU?

In short, no. Virtulization is able to work quickly only when it can execute the OS and applications instructions on the CPU natively. In theory, one possibly could rewrite incomming instructions to better utilitize multiple CPU's, but that would likely fail on all but very simple tasks. How do you know that you are not executing the insturctions to send data, but the calculations on that data are not finnised yet?

This is one reason applications have to be written and compiled specificly for multithreaded operation.

0

As Sage said, if you want to see one big cpu instead of multiple cores, then no. At least, not that I know of.

In Linux however, you can temporary disable a core like so:

echo 0 >> /sys/devices/system/cpu/cpu1/online

Your performance will suffer though, because now everything running on the system will be running on whatever cores are left.

0

I have been wondering about this very thing. I think it would be possible to achieve this on current multi core CPU's if a VM used emulated processor that could spread it's bit width across all physical CPU's in sync. For example you could make a 3 Ghz 8 core 16 thread chip appear to the OS and programs running in the VM as a 6 Ghz 4 Core 8 Thread chip, or a 12 Ghz 2 Core 4 Thread chip. I know of no such VM but it is likely possible that this can be done (with some IPC reductions from the physical CPU obviously).

As for a chip designed to do this, there are none, but if a design allowed for physical connection of the bit width connecting the cores to accept instructions along the entire width per cycle, then you could do this without using a VM and a smaller hit on IPC.

Very surprised no hardware or software companies like VM Ware, Intel, or AMD, have tried to figure out how to do this, given the current state of affairs in the CPU market. Imagine not having to choose between a fast gaming CPU or a monster multi core CPU with all those extra PCIe lanes... you could then simple change the cpu's mode when you are using a program that does not utilize many threads of CPU. Then it takes the pressure off of developers back's, if CPU's can do this, there is less need to multi thread the application. VM's can already appear as more cores than your physical CPU at a heavy tax on IPC, we need something that can do the opposite, many programs performance would still benefit greatly if you could do what is asked in this thread.

0

AMD a few years back had Core Control software that merged cores to increase clock speeds. The user was limited on core combinations, i used to run my 6 core down at 2 cores merged and was able to get up to 4.2 clocks from the base 3.2

0

Okay... let's pretend we are very wealthy and we get the latest greatest processor out at the time of this post. The Intel I9 7880X with 18 cores. How can I tie all of those cores into 1 processor? The quick answer is, you can't.

The best way to explain it is your processor is a room with 18 people inside. You can't combine them into 1 person. The programmer of the software has to set up the program to use more cores. Most programs use only 1 core. So the problem will have that core do 1 task at a time.

Some programs know what the next tasks will be so they assign more cores to do more functions but to my knowledge and at the time of this post the most any MAINSTREAM software uses is 4 cores. There are several speicalty programs that will use all of your processor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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