What is the difference between the number of cores and the number of logical processors?

6

5

I have been doing some image processing on my computer using Erdas Imagine. Specifically, I am running a 5x5 median filter on imagery. I can specify the number of processes that occur simultaneously within the Erdas batch command window. I have been observing unusual behavior when I specify 16 simultaneous processes, which lead me to double check the number of processors on the machine. I used the following command prompt command to assess the number of processors:

wmic cpu > cpu.txt

Which yielded (in part):

Number of Cores: 8 
Number of Logical Processors: 16

How does the number of cores differ from the number of logical processors in the context of software like Erdas imagine where the user can specify the number of simultaneous processes? I am trying to determine if I should be specifying 8 or 16 simultaneous processes to maximize efficiency.

Borealis

Posted 2014-06-21T18:06:24.413

Reputation: 233

Question was closed 2014-06-23T09:14:43.603

2Look up Hyperthreading. – HopelessN00b – 2014-06-21T18:56:12.020

Regarding your final question: in most cases, you'd want 16 processes to maximize efficiency. For memory-intensive operations such as image processing, I'm not sure: I recommend you do some benchmarking and find out what works best for you. You may find that you get the best performance if you disable HyperThreading altogether (it is usually possible to do this via the BIOS settings). – Harry Johnston – 2014-06-21T22:38:18.793

Answers

14

Hyper-threading will make one physical core appear to the OS as two.

Hyper-threading essentially allows one core to execute two sets of instructions at once, depending on the nature of the instructions. When it was first introduced (back in 2002, and it was quite the buzz at the time, with overclockers and then-new bloggers going crazy debating HT vs. true multicore - some things never change) it was sort of like "dual core lite". To make the use of hyperthreading transparent to existing software and operating systems, they were designed to appear as two cores, and so the kernel could continue using its existing scheduling and load balancing and take advantage of hyperthreading without any changes (later, of course, optimizations were made). That's why it started that way - so that hyperthreaded CPUs could just be drop-in replacements on platforms that already had multiprocessor support anyways.

Anyways, since efficiency will depend on the nature of the application you may wish to do a bench mark at 8 and 16 (and higher if the processes are not CPU bound but, e.g. network or IO bound).

Jason C

Posted 2014-06-21T18:06:24.413

Reputation: 8 273

5I essentially agree, but want to clarify that hyper-threading (HT) does not allow one core to execute two sets of instructions at once. HT makes switching between two sets of instructions very fast, or "cheap" in terms of minimizing impact on performance. Only one of two HT threads is being executed per physical core at any one moment, but the overhead of switching between them is greatly reduced. However some overhead remains. Some sysadmins might turn off hyper-threading if they routinely have a high number of extremely CPU-bound threads, to eliminate that overhead. – Basil Bourque – 2014-06-22T02:08:44.293

There's a short and rather amusing video here. Do not, under any circumstances, attempt to eat the ice cream cone first.

– Jason C – 2014-06-22T22:02:43.140

3

Number of cores (8) represents the actual number of physical cores. For each processor core that is physically present, the operating system addresses two virtual or logical cores, and shares the workload between them when possible.

Where multiprocessing systems include multiple complete processing units, multithreading aims to increase utilization of a single core by using thread-level as well as instruction-level parallelism. As the two techniques are complementary, they are sometimes combined in systems with multiple multithreading CPUs and in CPUs with multiple multithreading cores.

See Wikipedia's articles on HyperThreading and Multithreading.

Cornelius

Posted 2014-06-21T18:06:24.413

Reputation: 2 524

1Note that not all CPUs support HyperThreading and it may also be disabled by the motherboard (this is typically a BIOS option). If HyperThreading is not supported or is disabled, there is only one logical processor per core. – Harry Johnston – 2014-06-21T22:35:01.943

-3

A logical CPU is usually used to describe the grand total of CPUs on the chip. the 8 cores are physical cores that exist on the chip. So each CPU can address to processes at once giving you 16 logical processors. The hyper-threading allows a core to complete two tasks at once. So as you have 8 cores each hyper-threading you will have a total of 16 logical processors.

In the basic sense the cores are real i.e. you have 8 physical cores on your chip. While logical processors is anything on the chip that can do a calculation. All cores are logical processors but not all logical processors are cores.

Sandesh Damkondwar

Posted 2014-06-21T18:06:24.413

Reputation: 150

4This is actually not correct. Hint: Hyperthreading. – HopelessN00b – 2014-06-21T18:54:42.373