问题描述
如果我的多处理器主板具有缓存一致性 非统一内存访问(NUMA),即单独的"北桥"每个处理器具有单独的RAM,是否有任何编译器都知道如何在不同的内存系统之间自动分配数据,从而使进程在本地工作线程主要是从与线程在其上运行的处理器相关联的RAM中检索数据的?
If I have a multi-processor board that has cache-coherent non-uniform memory access ( NUMA ), i.e. separate "northbridges" with separate RAM for each processor, does any compiler know how to automatically spread the data across the different memory systems such that processes working on local threads are mostly retrieving their data from the RAM associated with the processor the thread is running on?
我有一个设置,其中1 GB连接到处理器0,1 GB连接到处理器1,等等.最多4个处理器.在相干内存空间中,第一个处理器上RAM的物理内存是地址0到1GB, 1.对于第二个处理器,它是1GB到2GB-1,依此类推.
I have a setup where 1 GB is attached to processor 0, 1 GB is attached to processor 1, et c. up to 4 processors. In the coherent memory space the physical memory for the RAM on the 1st processor is addresses 0 to 1GB-1. For the second processor it is 1GB to 2GB-1, and so on.
任何编译器,或者也许是malloc
,是否会将特定内核上的进程分配的新内存与与该内核相关联的物理RAM相关联?
Will any compilers, or perhaps malloc
specifically, associate new memory alloc'd by a process on a specific core to the physical RAM associated with that core?
推荐答案
Linux内核了解NUMA,并将尝试为您的进程页面提供当前CPU本地的内存(来源: U.Drepper,每个程序员应该了解的内存知识" .)
Linux kernel knows about NUMA and will try to give your process pages from memory local to the current CPU (source: U. Drepper, "What Every Programmer Should Know About Memory".)
这篇关于gcc,icc或Microsoft的C/C ++编译器是否支持NUMA或对NUMA有所了解?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!