Detecting the number of processors

System.Environment.ProcessorCount returns the number of logical processors http://msdn.microsoft.com/en-us/library/system.environment.processorcount.aspx For physical processor count you’d probably need to use WMI – the following metadata is supported in XP/Win2k3 upwards (Functionality enabled in SP’s prior to Vista/Win2k8). Win32_ComputerSystem.NumberOfProcessors returns physical count Win32_ComputerSystem.NumberOfLogicalProcessors returns logical (duh!) Be cautious that HyperThreaded CPUs appear identical to multicore’d CPU’s yet the performance … Read more

Tensorflow: executing an ops with a specific core of a CPU

There’s no API for pinning ops to a particular core at present, though this would make a good feature request. You could approximate this functionality by creating multiple CPU devices, each with a single-threaded threadpool, but this isn’t guaranteed to maintain the locality of a core-pinning solution: with tf.device(“/cpu:4”): # … with tf.device(“/cpu:7”): # … … Read more

Accurate calculation of CPU usage given in percentage in Linux?

According the htop source code, my assumptions looks like they are valid: (see static inline double LinuxProcessList_scanCPUTime(LinuxProcessList* this) function at LinuxProcessList.c) // Guest time is already accounted in usertime usertime = usertime – guest; # As you see here, it subtracts guest from user time nicetime = nicetime – guestnice; # and guest_nice from nice … Read more

Difference between core and processor

A core is usually the basic computation unit of the CPU – it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs), maintaining the correct program state, registers, and correct execution order, and performing the operations through ALUs. For optimization purposes, a core can … Read more