1. Automatic Copying of Pointer-Based Data Structures
- Author
-
Hyojin Sung, Tong Chen, and Zehra Sura
- Subjects
010302 applied physics ,Copying ,Programming language ,business.industry ,Fortran ,Computer science ,Smart pointer ,02 engineering and technology ,Parallel computing ,computer.software_genre ,Data structure ,01 natural sciences ,020202 computer hardware & architecture ,Runtime system ,Software ,Pointer (computer programming) ,0103 physical sciences ,0202 electrical engineering, electronic engineering, information engineering ,Compiler ,business ,computer ,computer.programming_language - Abstract
In systems with multiple memories, software may need to explicitly copy data from one memory location to another. This copying is required to enable access or to unlock performance, and it is especially important in heterogeneous systems. When the data includes pointers to other data, the copying process has to recursively follow the pointers to perform a deep copy of the entire data structure. It is tedious and error-prone to require users to manually program the deep copy code for each pointer-based data structure used. Instead, a compiler and runtime system can automatically handle deep copies if it can identify pointers in the data, and can determine the size and type of data pointed to by each pointer. This is possible if the language provides reflection capabilities, or uses smart pointers that encapsulate this information, e.g. Fortran pointers that intrinsically include dope vectors to describe the data pointed to. In this paper, we describe our implementation of automatic deep copy in a Fortran compiler targeting a heterogeneous system with GPUs. We measure the runtime overheads of the deep copies, propose techniques to reduce this overhead, and evaluate the efficacy of these techniques.
- Published
- 2017