摘要
我国自主研发的新一代神威异构众核计算平台主要采用athread异构编程方法,athread异构编程属于大同步并行模型,难以充分挖掘程序中的细粒度并行性,其采用的同步方式难以实现众核上的任务负载均衡。数据流并行编程模型因其天然并行性、点对点同步的特点能够很好地解决上述问题。基于Codelet程序执行模型和申威主从核架构特点,设计并实现面向申威处理器的数据流运行时系统swTasklet,通过对Codelet功能的进一步细化和对Codelet机器模型到主从核的映射,避免从核阵列上的同步操作,减少同步开销;由主核完成从核计算任务的调度分配,将计算和同步操作分离,保证运行时系统可以和从核计算库的共用。实验以NPB LU程序和向量-向量加作为测试用例,采用相同的优化方法分别对swTasklet和athread实现进行并行化。实验结果表明:在规模较大情况下,LU程序的swTasklet实现版本比athread版本快16%,向量-向量加swTasklet实现版本比athread版本快1倍;使用swTasklet实现的LU并行版本较主核本取得了平均8倍以上的加速,而向量-向量加swTasklet版本较主核版本取得30倍左右的加速。
The domestic Sunway heterogeneous many-core computing platform uses athread heterogeneous programming method.Exploring fine-grain parallelism in athread is challenging,as its synchronization method struggles to maintain an effective workload balancing among tasks and computing cores.The data-flow parallel programming model solves these problems well because of its natural parallelism and point-to-point synchronization.swTasklet,a data-flow runtime designed on Sunway,is developed based on the Codelet program execution model.It avoids using synchronous operation on the slave cores owing to its refined Codelet function mapping of Codelet machine model to master-slave kernel.The scheduling of tasks is completed by the master core,ensuring compatibility of the runtime and libraries.In order to evaluate the efficiency of swTasklet,NPB LU and vector-vector addition are used as case studies.Furthermore,when implemented in swTasklet,LU achieves an average speedup of 8,and vector-vector addition achieves an average speedup of 30.On a large scale,the swTasklet implementation of the LU program is 16%faster than athread version,and the vector-vector addition is twice as fast as athread version.
作者
张鹏飞
陈俊仕
郑重
沈沛祺
安虹
许乐
ZHANG Pengfei;CHEN Junshi;ZHENG Zhong;SHEN Peiqi;AN Hong;XU Le(School of Computer Science and Technology,University of Science and Technology of China,Hefei 230026,China)
出处
《计算机工程》
CAS
CSCD
北大核心
2023年第12期46-54,共9页
Computer Engineering
基金
国家自然科学基金(62102389)。