Survey of Memory Management Techniques for HPC and Cloud Computing <s> C. MEMORY LOCALITY <s> High-performance computing requires a deep knowledge of the hardware platform to fully exploit its computing power. The performance of data transfer between cores and memory is becoming critical. Therefore locality is a major area of optimization on the road to exascale. Indeed, tasks and data have to be carefully distributed on the computing and memory resources. We discuss the current way to expose processor and memory locality information in the Linux kernel and in user-space libraries such as the hwloc software project. The current de facto standard structural modeling of the platform as the tree is not perfect, but it offers a good compromise between precision and convenience for HPC runtimes. We present an in-depth study of the software view of the upcoming Intel Knights Landing processor. Its memory locality cannot be properly exposed to user-space applications without a significant rework of the current software stack. We propose an extension of the current hierarchical platform model in hwloc. It correctly exposes new heterogeneous architectures with high-bandwidth or non-volatile memories to applications, while still being convenient for affinity-aware HPC runtimes. <s> BIB001 </s> Survey of Memory Management Techniques for HPC and Cloud Computing <s> C. MEMORY LOCALITY <s> Heterogeneity in memory is becoming increasingly common in high-end computing. Several modern supercomputers, such as those based on the Intel Knights Landing or NVIDIA P100 GPU architectures, already showcase multiple memory domains that are directly accessible by user applications, including on-chip high-bandwidth memory and off-chip traditional DDR memory. The next generation of supercomputers is expected to take this architectural trend one step further by including NVRAM as an additional byte-addressable memory option. Despite these trends, allocating and managing such memory are still tedious tasks. In this paper, we present hexe, a highly flexible and portable memory allocation toolkit. Unlike other memory allocation tools such as malloc, memkind, and cudaMallocManaged, hexe presents a rich and portable memory allocation framework that allows applications to carefully and precisely manage their memory across the various memory subsystems available on the system. Together with a detailed description of the design and capabilities of hexe, we present several case studies where the flexible memory allocation in hexe allows applications to achieve superior performance compared with that of other memory allocation tools. <s> BIB002 </s> Survey of Memory Management Techniques for HPC and Cloud Computing <s> C. MEMORY LOCALITY <s> Experience with Intel Xeon Phi suggests that NUMA alone is inadequate for assignment of pages to devices in heterogeneous memory systems. We argue that this is because NUMA is based on a single distance metric between all domains (i.e., number of devices "in between" the domains), while relationships between heterogeneous domains can and should be characterized by multiple metrics (e.g., latency, bandwidth, capacity). We therefore propose elaborating the concept of NUMA distance to give better and more intuitive control of placement of pages, while retaining most of the simplicity of the NUMA abstraction. This can be based on minor modification of the Linux kernel, with the possibility for further development by hardware vendors. <s> BIB003
A way to expose processor and memory locality information in the Linux kernel and in user-space libraries such as the hwloc software project was discussed in BIB001 . An extension of the hierarchical tree to include upcoming heterogeneous memory architectures and memory-side caches was proposed. This solution is convenient to find local resources and to apply recursive top-down placement algorithms while correctly exposing the topology of these new architectures. Flexible and portable memory allocation toolkit hexe BIB002 divides memory allocation into three parts: allocating a virtual address, mapping a virtual address to a physical memory class that is under control of the toolkit, and mapping a virtual address to an exact physical memory page that will be used by the OS. The initialisation of the hexe runtime system and the topology detection are initially performed on the OS level using hwloc library. Hexe is responsible for a more comprehensive topology and for architectural feature detection. An extension of the heap management system jemalloc in conjunction with memkind library was proposed in  . The goal here is to enable fine-grained client control over memory properties and to reuse memory modified by expensive system calls for the highly threaded environment. A minor modification of the Linux kernel for more intuitive control of the placement of memory pages was proposed in BIB003 . Generally, NUMA is based on a single distance metric between all domains. In addition, other metrics characterising relationships between nodes were included, such as latency, bandwidth, capacity. The NUMA distance becomes a twodimensional metric, since this approach matches the source node with the CPU performing a querying process with the ordered list of NUMA nodes with memory devices. The performance of the application is significally affected by the explicit control of the locality of physical memory. Furthermore, being able to allocate memory by taking into account memory locality becomes imperative with upcoming new memory technologies. A general scheme of the memory locality usage is shown in Figure 3 . Memory allocation requires not only knowledge about memory hierarchy and configuration but also detailed application analysis. Current research shows that the automatic use of memory locality is still not as efficient as having explicit instructions from the application developer that might require rewriting the code for each different architecture.