摘要
基于申威处理器,在底层虚拟机(Low Level Virtual Machine, LLVM)编译器后端对锁机制提供编译支持,保证多线程环境下,对共享内存操作的原子性。锁机制研究与实现主要包括实现原子指令语义映射策略保证原子操作的原子性并在锁机制算法中加入对8位和16位数据类型的数据处理,实现锁机制在申威处理器上对小粒度数据类型的支持。基于并行计算机基准测试集NPB进行测试,在多线程环境下所有程序皆自校验通过。在16个线程下,Fortran语言程序平均加速比为11.91,最大加速比为15.73,C语言程序平均加速比为8.08,最大加速比为13.32。
Based on the Sunway processor, the LLVM compiler backend provides compile support for the lock mechanism, ensuring atomicity of shared memory operations in a multi-threaded environment. The research and implementation of the lock mechanism mainly includes the implementation of the atomic instruction semantic mapping strategy to ensure the atomicity of atomic operation and the addition of data processing for 8-bit and 16-bit data types in the lock mechanism algorithm, so as to realize the support of the lock mechanism for small size data types on the Sunway processor. Based on the parallel computer benchmark test set NPB, all programs passed the self-check in a multi-threaded environment. Under 16 threads, the average speedup of Fortran programs is 11.91, the maximum speedup is 15.73, the average speedup of C programs is 8.08, and the maximum speedup is 13.32.
作者
巩令钦
沈莉
周清雷
胡浩
Gong Lingqin;Shen Li;Zhou Qinglei;Hu Hao(School of Information Engineering,Zhengzhou University,Zhengzhou 450000,Henan,China;School of Computer Science and Technology,University of Science and Technology of China,Hefei 230000,Anhui,China;Wuxi Jiangnan Institute of Computing Technology,Wuxi 214083,Jiangsu,China)
出处
《计算机应用与软件》
北大核心
2021年第11期11-17,97,共8页
Computer Applications and Software
基金
国家自然科学基金项目(61572444)。
关键词
LLVM
锁机制
多线程
原子性
申威处理器
LLVM
Locking mechanism
Multithreading
Atomicity
Sunway processor