ѧ
JOURN AL OF SOFTWARE
1999ꡡ1010ڡVol.10No.101999



һHPFļ
־ ƽ   ׿Ⱥ ʯϼ

ժҪĽһHPF(high performance Fortran)ϵͳ֮ϵܼܷ.¸HPFϵͳ,ܷҪԼҪ,ϸһʹõܷܼռ,Դ˹ߵʹЧܽ.
ؼʡܷ,ӻ,HPF,ܼ,б.
ͼšTP314

A Tool for Monitoring and Profiling HPF Programs
DU Zhi-hui WANG Jian-ping CHENG Xu XU Zhuo-qun SHI Li-xia
(Department of Computer Science and Technology Beijing University Beijing 100871)
Abstract In this paper, the authors introduce a monitoring and profiling tool which is used in a high performance Fortran (HPF) compilation system. A brief overview of the HPF compilation system is given first, then the importance and main tasks of performance analysis are discussed, the method of performance profiling and monitoring and the method of performance data collecting are given in detail. The paper is concluded with a description of the tools role in the HPF compilation system.
Key words Performance analysis, visualization, high performance Fortran (HPF), performance monitoring, parallel compilation.

1HPF֧ϵͳ
ѧ빤̼еĴ󲿷ݲ,HPF(high performance Fortran)[1,2]ǵ͵ݲ.ڱֶܼܷܵǹǿHPFϵͳ֮ϵ,ȼ򵥽һһHPFϵͳ.
һϵͳһΪʱʱ󲿷,ǿHPFHPFתFORTRAN77,һԴԴת.HPFͨõıǰ˺ͺ˱任󲿷.ǰɶHPF﷨;̬.˰Ĺ淶ͳ任3׶,ͨŵļĲ,HPFеÿһִ,תFORTRAN77ҵӦĳ,˺׶HPFÿһм.ʱʹһC++,ֲĹͨ󲿷.ͨʱʱĽӿڡֲDAD(distributed array descriptor),մӱʱݹֲϢ,ɶԷֲļ.ͨŲֱͨӵMPI[3]ͨźʵֵ.ͨ,˼򵥶Чͨż㷨.ǽͨŷΪ3:ͨšλͨźͨ,ʱ֧ʵ3ͨ,ԼλͨŽŻ,ʹкܸߵͨЧ.Ŀǰ,ϵͳת,һೣHPF(LAPLACE),ϵͳܲнϸִЧʵĽ,.
2ܷҪ
г봮гűʵ,гƵıԻܲȫ,ټϲб̱еĸ,гƵѶȺܴ,дĳ׵ά,ҪһЭгĹ,Ҫг򿪷֧.ǲгƵһҪĿ,,гܷ[4]ͳΪһʮҪɲ.
HPFΪĸ߼Եĳִ󽵵˲гƵѶ,˲гĿЧ,ͬʱҲһ,α֤߼гִЧ.ܷԸ߼гԵΪҪ.˵,гܷӦܻشԱش.
(1) òг?Բгϵ,Ӷʹ򿪷Ա֪òгǷﵽҪ,δﵽҪ,Ҫһش.óҪָԽԶ,ԽҪϸϢԱ߳.
(2) òгܷҪʲôط?ܶλ.ӰܵҪ,ҳӰܵƿ.ƿֵĸĽԴȵ߳,,ܶλܵҪһ.
(3) òгƿҪԭʲô?ܵķ[5].ǵ(2)ļ,Ϊ֪ʲôط,Ҫ֪ڸôľԭ,ڸزƽ,ͨ.ԭͬ,İ취ȻҲͲͬ.
ǲгܷӦûش,ҲҪ.ǵHPFHPFľ,ܷԴHPFԴͱõSPMD(single program multiple data)HPFִг,ͬʱΪĽǵHPFṩԺͶָ.
Ŀǰ,гܷ߿԰乤ʽΪͺԤ[6].͹ͨڳʵʱռ,ȻͳƷ.Ԥ͹Ҫһѧģ,ɲʾӰܵ,ȻͨԳṹо̬,Щֵ,Ԥ.ǵHPFһڿı,ܲ޷ȷ,˺ѽһѧģԤ,ʶǵܷƳɼ͵,Ԥ͵.
3ܷ
ܷܼռĻϽе,ҪȽһǵܷߵҪ,Ȼ˵ЩԳнмԼռݵ.
ӰݲгܵҪ3.
(1) ƽ.ƽǲмеҲӰ첢гܵҪ.νƽ,һ񻮷ֳɼ൱Ĳ,öͬе.еĴضеĴ,ͻʧȥм,Ӱ첢г.븺ƽйصϢѼгϢһҪ.
(2) ͨ.ͨһⲻɷָ,ͨ,ֻвжûͨǼ.п߳,ͨŻԳܲӰ,һͨŵĿܳʮμĿ,гбʮֽشͨ,ܱⲻҪͨ.ֿͨϸΪͨŴࡢͨͨ·ȷ.ͨйصϢѼгϢһҪ.
(3) .Ϊﵽһļ,Բòͬļ㷽ֶ,ԳӰܴ,罫ѭеһ򵥵ĺøΪinlineֱӼ,Գɱ߳Ч.ҲӰ첢гܵһҪ.
Ӱݲгܵػкܶ.ǵܷص3ܼ,ݼõݽܷ.
ЩйصϢ,пӻ(visualization)[7]һҪķѧݵķ.ԲгݵĿӻøֱۡķʽչʾ.г,ṹ,ΪЧذԱЩϢ,ӻһҪıֶ.
ĽܵHPFӻܷHPFϵͳһҪɲ,ܰHPF򿪷߸ĽHPF,ͬʱΪHPF򿪷ṩ,ĽĿ,ԲЧHPF.
ǵĿӻܷߵϵͳͼ1ʾ.ṩ¼Ĺ:(1) мʾṹԴӦϵĿӻ;(2) ݷֲĿӻ;(3) ͨŷͨĿӻ;(4) Ŀӻ;(5) ʱϢͳƷ.

ͼ1ܿӻϵͳ
ͨӻ,չʾԴκмʾṹ,ݷĽṹ;FORALLĽṹ;IF,DOȿĽṹ.
νݷֲӻǶÿһֲʽ,ڲͬϵķֲչʾ,ͼ2ʾ.ݷֲж̬;̬.ݷֲϢ,ԴԵ˽ĸ,ͼʶݷֲȷ.ݲеһҪڲͬϵĻ,ݻֵϢ,ڷݲǺ.

ͼ2ݷֲʾͼ
ͨſӻ,Ҫչʾ֮ͨϵ,ͨ,ͼ3ʾ.ͨͨŻĽͨſЧ.ⲿֵĿӻڳкõ,ǳĶ̬.

ͼ3ͨʾͼ
ڼӻ,Ҫָĸ,罫ĸKiviatͼʾ,ͼ4ʾ,ЩϢ,ͿŻ,߲.

ͼ4Kiviatͼ
ڳĸͳϢ,ҪĿӻʾͼʾͼʾKiviatͼʾ.ӳִгҪָ,ʱͨ״,ΪԱѸ˽ṩһ.
ͨӻ߶Ծ̬ݷֲ̬ͨźͼз,ҵƿ,ΪHPFԱ,ҲΪHPF򿪷ṩ˸ĽԳ,ڿHPFHPF.
4м⼰ݵռ
˵,ͨڱFORTRAN77֧ܼԳнмռ.
A. ռϢΪ3:ͳϢʱϢݷֲϢ.
 ͳϢַΪͳƺ͸ͳϢ.һͳϢǶԸĶִеͳƽ,еʱ䡢ͨѭϢ.
 ʱóй״̬ת.ǰÿγ״̬ת䶨Ϊһ¼,¼.ÿ¼һʾǰ״̬ԡǰԼʱʴ.Ŀǰĳ״̬м㡢м㡢͡պͿ.ÿЩ״̬֮ת¼Ϊһ¼.Էͺͽ¼ͨĿġͨԼͨŷʽ.
 HPFݷֲĶ⴦顢ģԼķֲͶϵ.ܷ3Էֱʾ⴦顢ģ.ÿռ3Ϣ,ΪһȫϢ,ҲΪһ.
B. ϢռʵһϢCԺProfLibɵ,ṩһݽṹĺһֱӴȡȫֱ,CԺFortranԵ.
 гͳάȫֿ֧,ʱͨProfLibĳʼʱͽʱõ,ͨŷͳϢɲʱܶ.
 ͳж̬ɵ,ÿһ䴴һ.HPFFORTRAN77,벢м㲿ʱProfPushStack,ǰڸӦĶ,ʱ,ProfPopStack,ͳϢ浽ö.ҪǶ׵,Բջṹ.ͳϢɲ뵽֧еļ.ProfLibжһȫֱ,ӦڲͳĸԱ,һϵͳеļĴ,ProfPushStackʱ,ֳ浽ԭջ,¶ͳϢָĴ,ԺͳƶȫֱֱӲ,ֱProfPopStackʱ,ֳٰö,ָԭջֳ.ĺô,ϢͳֱӲȫֱ,ֻڱͻֳָʱⷽ,ӶʡЩõĿ.
 ¼֧ͨewEvent̬,ProfLib(ProfPushStack)Ҳܲ¼.FORTRAN 77.
 ݷֲϢݷֲ庯мռ,ҪFORTRAN 77вProfLibĵ.
ϢռҪѭҪԭǾܽռʱ俪,ٶԳܵӰ.вȡһЩʩ:þ̬,ٶ̬;ٺ,ѱĺΪinline;Ϣڴд,ֱ˳ʱһ.
5ع
[4]һּ͵ܷ͵Թ,ҪԵMPPƽ̨.ǵĹ߲еԹ,Ҳ޶ضƽ̨.[6]Ԥ͵ܷ,ڶ㷨Ͳлָ׼ȷؽ,ͨһ򵥵ģԤ.Ǽƻڵļ͹ߵĻ,һЩ͵Ӧƽ̨ʵԤĹ.[8]ĹصǽһԭʼŻĶӦϵ,ܷĹܽ,ǵĹߵصڶݵļͷ,ҲʵԭʼŻĶӦϵ.
6ܷԱŻ
ĿǰʹôHPFܼܷ,ѶHPFŻ.ͨHPFķ,ҵӰHPFܵҪ.ڴ˹ߵõĽ,µǵHPFŻصŻ,,4̨õĲͬӵļٱ0.31.2.ܼܷʹǶHPF򼰱õĽӶԵ涼˱ȽϾ̵ʶ,ҶԱŻصҲ,Щ鹦һ߷ֱϢ,ʹܹԵHPF.
л лź֣˶ʿΪĵĹͶ,лѧѧ뼼ϵбоȫʦͬѧ.
עͣоõشоʵǼƻ͹863߿ƼĿ
߼飺־ԣ1970,ʿ,ҪоΪм,ѧӻ,Ϣϵͳ
ƽ1964,ʿ,ҪоΪб,㷨.
1966,,ҪоΪ,ֲʽ,ϵṹ
׿Ⱥ1936,,ʿʦҪоΪѧӻռݷ
ܾߣм
ʯϼ1973,˶ʿ,ҪоΪ
ߵλ:ѧѧ뼼ϵ  100871
E-mail: duzh@bigfoot.com
ο
1High Performance Fortran Forum. High performance Fortran language specification. 
Version 1.0, Houston, Texas: Rice University, 1993
2Fortran.׼Fortran 90Գ.:ѧԷ,1994
(Fortran Group. Standard Fortran 90 Programming Language. Beijing: Xueyuan 
Publishing House, 1994)
3Snir M, Otto S, Lederman S H et al. MPI: the Complete Reference. New York: MIT 
Press, 1997. http: //www.mpi-forum.org/, Message Passing Interface (MPI) Forum 
Home Page
4Wisuler R, Oberhuber M, Krammer S et al. Interactive debugging and performance 
analysis of massively parallel applications. Parallel Computing, 1996,22
(3):415442
5Fahringer T. Estimating and optimizing performance for parallel programs. 
Computer, 1995,28(11):4756
6Driscoll M A, Daasch R W. Accurate prediction of parallel program execution time.
Journal of Parallel and Distributed Computing, 1995,25(1):1630
7Heath M T, Malony A D, Rover D T. Parallel performance visualization: from 
practice to theory. IEEE Parallel and Distributed Technology, 1995,3(4):4460
8Shaun Kaneshiro, Tatsuyn Shindo. Profiling optimized code: a profiling system for
an HPF compiler. In: Proceedings of the 10th International Parallel Processing 
Symposium. 1996. 469473
ոڣ1998-01-20޸ڣ1998-11-02
