获取 NUMA 系统中的节点距离(跳数)
是否有任何 API/方法可以获取两个 NUMA 节点之间的“距离”(文献中称为“跳数”)?我想实现一个利用这一点的内存分配系统(重用最近节点的内存,因为访问速度更快)。
Windows似乎没有这样的功能......并且libnuma(在Linux下)似乎也没有它。有什么方法可以获取此信息(即使使用“cpuid”之类的信息)?
Is there any API/way to get the "distance" (called 'hops' in literature) between two NUMA nodes? I want to implement a memory allocation system that takes advantage of this (reuse memory from the nearest node, because the access is faster).
Windows doesn't seem to have such a feature... and libnuma (under Linux) doesn't seem to have it too. Is there any way to get this info (even with something like 'cpuid') ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于 Linux,至少可以通过解析 /proc 来获取拓扑。例如,Ulrich Drepper 的“每个程序员都应该了解内存知识”的第 5 章对此进行了解释。第 6.5 章也有些相关。
For Linux it's possible to get the topology at least by parsing /proc. This is explained e.g. in chapter 5 of Ulrich Drepper's "What every programmer should know about memory". Chapter 6.5 is also somewhat relevant.
查看 hwloc 中的库和工具。
Have a look at the library and tools in hwloc.