如何查找有关CPU并行架构的信息?

时间:2021-05-25 07:24:25

I'm Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz (as told to me by cat /proc/cpuinfo), but I need to go into as much depth as possible re. architecture for working on parallel programming (likely using pthreads). Any pointers?

我是Intel(R)Core(TM)2 Duo CPU T6600 @ 2.20GHz(正如cat / proc / cpuinfo告诉我的那样),但我需要尽可能深入地重新考虑。从事并行编程的架构(可能使用pthreads)。有什么指针吗?

3 个解决方案

#1


10  

The sys filesystem knows all about this:

sys文件系统知道所有这些:

$ ls /sys/devices/system/cpu 
cpu0  cpu2  cpuidle  possible  sched_mc_power_savings
cpu1  cpu3  online   present

$ ls /sys/devices/system/cpu/cpu0/topology/
core_id        core_siblings_list   thread_siblings
core_siblings  physical_package_id  thread_siblings_list

Here's the documentation

这是文档

Using this filesystem, you can find out how many CPUs you have, how many threads they have, which CPUs are next to which other cpus, and which CPUs share caches with which other ones.

使用这个文件系统,您可以了解您拥有多少CPU,拥有多少线程,哪些CPU与其他cpu相邻,以及哪些CPU与其他CPU共享高速缓存。

For example - Q: which CPUs does cpu0 share it's L2 cache with?

例如 - 问:哪些CPU使用cpu0共享它的L2缓存?

$ cat /sys/devices/system/cpu/cpu0/cache/index2/{type,level,shared_cpu_list}
Unified
2
0-1

A: It shares it's unified L2 cache with cpu1 (and itself).

答:它与cpu1(和它自己)共享它的统一L2缓存。

Another example: Q: which CPUs are in the same physical package as cpu0 (on a larger machine):

另一个例子:问:哪些CPU与cpu0位于同一物理包中(在较大的机器上):

cat /sys/devices/system/cpu/cpu0/topology/core_siblings
00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000055

A: cores 0, 2, 4 and 6. (taken from the bit pattern above, lsb=cpu0)

A:核心0,2,4和6.(取自上面的位模式,lsb = cpu0)


not all linux systems have the sys filesystem in, and it's not always in root. (possibly in proc/sys?). the thread_siblings_list form is not always available, but the thread_siblings (bit pattern) one is.

并非所有的Linux系统都有sys文件系统,并且它并不总是在root中。 (可能在proc / sys中?)。 thread_siblings_list表单并不总是可用,但是thread_siblings(位模式)是。

#2


2  

I found lstopo of the hwloc project quite useful. This will give you graphical output (based on information found in /proc and /sys as Alex Brown described) of the topology of your system (see their webpage for an example). From the graphical output you can easily see

我发现hwloc项目的lstopo非常有用。这将为您提供系统拓扑的图形输出(基于/ proc和/ sys中的信息,如Alex Brown所述)(有关示例,请参阅其网页)。从图形输出中您可以轻松看到

  • if hyperthreaded cores are present
  • 如果存在超线程核心

  • which cpu numbers correspond are different hyperthreads on the same physical core
  • 哪些cpu编号对应的是同一物理核心上的不同超线程

  • how many CPU sockets are used
  • 使用了多少个CPU插槽

  • which cores share the L3 cache
  • 哪些核心共享L3缓存

  • if the main memory is common between CPU sockets or whether you are on a NUMA system
  • 如果主内存在CPU插槽之间是常见的,或者您是否在NUMA系统上

etc.

If you need to access this information programmatically, there is some documentation how hwloc can be used as a library.

如果您需要以编程方式访问此信息,那么有一些文档可以将hwloc用作库。

#3


-2  

To get the lowest detail about the processor a system engineer could run their equivalent to CPUZ and get to the lowest levels when permitted in law for the home or office address where the processor is to be installed and used. Software engineers and developers are not usually permitted to know that level of detail but I can tell you that the architecture can be of the type where a processor spawns or instances a virtual second processor giving close to x1.75 processing equivalent, or there are real physical multiple cores on the same die using technology and control methods as enhancements of previous implementations of the design. The Core processor has an interface for system programmers, application developers to use and this mode of access would be the expectation of Intel, details available from them.

为了获得有关处理器的最低细节,系统工程师可以运行它们的等效CPUZ,并在法律允许的情况下达到安装和使用处理器的家庭或办公室地址的最低级别。通常不允许软件工程师和开发人员知道详细程度,但我可以告诉您,该体系结构可以是处理器生成的类型,也可以是虚拟第二处理器实现接近x1.75处理等效的类型,或者是真实的使用技术和控制方法在同一管芯上的物理多核作为先前设计实现的增强。核心处理器具有供系统程序员,应用程序开发人员使用的接口,这种访问模式将是英特尔的期望,可从他们获得详细信息。

#1


10  

The sys filesystem knows all about this:

sys文件系统知道所有这些:

$ ls /sys/devices/system/cpu 
cpu0  cpu2  cpuidle  possible  sched_mc_power_savings
cpu1  cpu3  online   present

$ ls /sys/devices/system/cpu/cpu0/topology/
core_id        core_siblings_list   thread_siblings
core_siblings  physical_package_id  thread_siblings_list

Here's the documentation

这是文档

Using this filesystem, you can find out how many CPUs you have, how many threads they have, which CPUs are next to which other cpus, and which CPUs share caches with which other ones.

使用这个文件系统,您可以了解您拥有多少CPU,拥有多少线程,哪些CPU与其他cpu相邻,以及哪些CPU与其他CPU共享高速缓存。

For example - Q: which CPUs does cpu0 share it's L2 cache with?

例如 - 问:哪些CPU使用cpu0共享它的L2缓存?

$ cat /sys/devices/system/cpu/cpu0/cache/index2/{type,level,shared_cpu_list}
Unified
2
0-1

A: It shares it's unified L2 cache with cpu1 (and itself).

答:它与cpu1(和它自己)共享它的统一L2缓存。

Another example: Q: which CPUs are in the same physical package as cpu0 (on a larger machine):

另一个例子:问:哪些CPU与cpu0位于同一物理包中(在较大的机器上):

cat /sys/devices/system/cpu/cpu0/topology/core_siblings
00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000055

A: cores 0, 2, 4 and 6. (taken from the bit pattern above, lsb=cpu0)

A:核心0,2,4和6.(取自上面的位模式,lsb = cpu0)


not all linux systems have the sys filesystem in, and it's not always in root. (possibly in proc/sys?). the thread_siblings_list form is not always available, but the thread_siblings (bit pattern) one is.

并非所有的Linux系统都有sys文件系统,并且它并不总是在root中。 (可能在proc / sys中?)。 thread_siblings_list表单并不总是可用,但是thread_siblings(位模式)是。

#2


2  

I found lstopo of the hwloc project quite useful. This will give you graphical output (based on information found in /proc and /sys as Alex Brown described) of the topology of your system (see their webpage for an example). From the graphical output you can easily see

我发现hwloc项目的lstopo非常有用。这将为您提供系统拓扑的图形输出(基于/ proc和/ sys中的信息,如Alex Brown所述)(有关示例,请参阅其网页)。从图形输出中您可以轻松看到

  • if hyperthreaded cores are present
  • 如果存在超线程核心

  • which cpu numbers correspond are different hyperthreads on the same physical core
  • 哪些cpu编号对应的是同一物理核心上的不同超线程

  • how many CPU sockets are used
  • 使用了多少个CPU插槽

  • which cores share the L3 cache
  • 哪些核心共享L3缓存

  • if the main memory is common between CPU sockets or whether you are on a NUMA system
  • 如果主内存在CPU插槽之间是常见的,或者您是否在NUMA系统上

etc.

If you need to access this information programmatically, there is some documentation how hwloc can be used as a library.

如果您需要以编程方式访问此信息,那么有一些文档可以将hwloc用作库。

#3


-2  

To get the lowest detail about the processor a system engineer could run their equivalent to CPUZ and get to the lowest levels when permitted in law for the home or office address where the processor is to be installed and used. Software engineers and developers are not usually permitted to know that level of detail but I can tell you that the architecture can be of the type where a processor spawns or instances a virtual second processor giving close to x1.75 processing equivalent, or there are real physical multiple cores on the same die using technology and control methods as enhancements of previous implementations of the design. The Core processor has an interface for system programmers, application developers to use and this mode of access would be the expectation of Intel, details available from them.

为了获得有关处理器的最低细节,系统工程师可以运行它们的等效CPUZ,并在法律允许的情况下达到安装和使用处理器的家庭或办公室地址的最低级别。通常不允许软件工程师和开发人员知道详细程度,但我可以告诉您,该体系结构可以是处理器生成的类型,也可以是虚拟第二处理器实现接近x1.75处理等效的类型,或者是真实的使用技术和控制方法在同一管芯上的物理多核作为先前设计实现的增强。核心处理器具有供系统程序员,应用程序开发人员使用的接口,这种访问模式将是英特尔的期望,可从他们获得详细信息。