哈工大_软件学院_《并行程序设计》课程实验报告之一_第1页
哈工大_软件学院_《并行程序设计》课程实验报告之一_第2页
哈工大_软件学院_《并行程序设计》课程实验报告之一_第3页
哈工大_软件学院_《并行程序设计》课程实验报告之一_第4页
哈工大_软件学院_《并行程序设计》课程实验报告之一_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、并行程序设计课程实验报告 实骑1: intel多核编译器及vtune性能分析器姓名 *院系软件学院学号 *任课教师张伟哲指导教师苏统华实验地点软件学院五楼机房实验时闽2015-4-1实验课表现出勤、表现得分实验报告 得分实验总分操作结果得分一、实验目的要求:需分析本次实验的基本0的,弁综述你足如何实现这些0的的?1. 掌握intel® compiler的特点和基本使用方注;2. 掌握在windows下如何使川intel® compiler提高应川程序的性能;3. 掌握intel® compiler的主要优化选项和参数的使用二、实验内容该部分填写在实验过程中,你都完

2、成了哪些工作。一、intel® c+ compiler 的使用1、配置 intel c+compiler (icl)编译器环境设置(visual studio* .net* 环境);2、使用msvc*和intel c+compiler编译器分別编译示例程序,并记录程序执行时间,分 析实验结果;3、使用w级优化参数(-03)对程序进行优化编译,记录结果并予以分析;4、使用过程间优化参数(-qipo)进行程序优化编译,记录结果并予以分析;5、使用配置向导优化(pgo)进行程序优化编译,记录结果并予以分析;6、使用矢量化优化参数(-qxp)进行程序优化编译,记录结果并予以分析:7、使用多个

3、优化参数(-03、-qxp、ipo和pgo)进行程序优化编译,记录结果并予以分 析。二、intel® vtune performance analyzer 的使用1、关ki病毒妇描和监投程序;2、运行 intel vtune performance analyzer,外新建 i :程项目;3、启动 sampling wizard,选择 windows*/windows* ce/linux profile,选择 automatically adjust tunning;4、选择gzip.exe程序的完整路径,并载入到vtune sampling中,配置入卜图5、采样(通过samplin

4、g wizard建立工程)并分析采样结果;6、在实验报告屮记录如下实验结果: gzip.exe屮哪个函数消耗丫最多的吋间? gzip.exe屮哪个函数cpi最高? gzip.exe源代码中中消耗时间敁长的函数里,哪一行时钟周期敁多? gzip.exe是多线程程序吗?7、采用call graph方式(通过call graph wizard建立工程)对应用程序gzip.exe进行重新采样并找出关键路径(实验报告中要给出截图),外找出开销时间最大的函数(selftime) 及函数调用过程(关键路径),丼对程序进行分析;三、intel® mkl数学函数库的使用与性能1、演示原始计算、一级bl

5、as、二级blas、三级blas的性能特征和它们之间的差异。2、蒙特卡罗法计算阏周率三、实验结果记录实验错果。1.1(1)略 使川cl.exed: ppi*aytrace2sourceraytrace2>raytrace2 .exe 320 240press 9op space bar to start ray tracing. <and then wait? >press 9gj to return to opengl render node.press 9qj to return to quit.raytrace2 640 480 will size the graphi

6、cs to the specified width/heic arrow keys change uiew direction <and use opengl>.hone/end keys alter uiew distance resizing keeps it same uiew siuw=320uh=240renderuithglut raytracemodeelapsed tine = 1.922000 seconds使用 icl.exed: ppraiitrace2sourceraytrace2>raytrace2 .exe 320 240 press j or s

7、pace bar to start ray tracing. <and then wait? >press j gj to return to opengl render node.press 9q1 to return to quit.raytrace2 640 480 will size the graphics to the specified viidth/heic arrow keys change view direction <and use opengl.hone/end keys alter view distance resizing keeps it s

8、ane view s:uw=320uh=240renderwithglut rayt racemodeelapsed tine = i.891000 seconds(3) 使用-03d: pprayti*ace2soin*ceraytpace2i*ayti*ace2 -exe 320 240press j gj or space bar to start pay tracing. <and then wait?press 9gj to return to opengl render mode.press 9qj to return to quit.raytrace2 640 480 wi

9、ll size the graphics to the specified width/height- arrow keys change view direction <and use opengl.home/end keps alter view distance resizing keeps it same view size-uw=320ub=240renderuithglutraytracemodeelapsed time = 1.890000 seconds(4) 使用 qipod: ppi*aytrace2source raytrace2 >raytrace2 .ex

10、e 320 240 press 9op space bar to start ray tracing. <and then wait!>press j to return to opengl render mode.press 9qj to return to quit.raytrace2 640 480 will size the graphics to the specified width/beight. arrow keys change view direction <and use opengl.hone/end keys alter view distance

11、resizing keeps it same view size-uw=320uh=240renderwitbglut raytracemodeelapsed time = 1.937000 seconds(5) 使用pgo第一次编译d:ppraytrace2sourceraytrace2trace2.exe 320 240 press jgj or space bar to stapt ray tracing. <and then wait?press jgj to return to opengl render node.press j qj to return to quit.ra

12、sftrace2 640 480 will size the graphics to the specified width/he igbt. arrow keys change uiew direction <and use opengl-home/end keys alter uiew distance resizing keeps it same uiew size.uw=320ub=240henderuithglut raytracemodeelapsed tine = 6.983000 seconds使川profile数据再次编译id:race2xsourcerayti*ace

13、2>raytrace2 .exe 320 240press j gf or space bar to start ray tracing. <and then wait? >press 9g9 to return to opengl render mode.press 9to return to quit.iraytrace2 640 480 will size the graphics to the specified width/beight. arrow keys change view direction <and use opengl.home/end key

14、s alter view distance resizing keeps it same uiew size.|uw=320ub=240penderv/itbg lut |raytracemodeelapsed time = 1.812000 seconds(6) 使用-qxpd: ppraiftrace2sourceraytrace2>raytrace2 .exe 320 240 press j g* or space bar to start ray tracing- <and then wait!>press 1g* to return to opengl render

15、 node.press 9to return to quit.raytrace2 640 480 will size the graphics to the specified width/height. arrow keys change view direction <and use opengl).hone/end keys alter view distance resizing keeps it sane view size.uw=320uh=240renderwithglutraytracemode疋lapsed time = 1.593000 seconds(7)使用多个优

16、化参数d: ppi*aytrace2 source raytrace2 >raytrace2 - exe 320 240press 9or space bar to start ray tracing. <and then wait? >pressto return to opengl render mode.press 9qj to return to quit.raytrace2 640 480 will size the graphics to the specified width/height- arrow keys change view direction &l

17、t;and use opengl.hone/end keys alter uiew distance resizing keeps it same uiew size.uw=320uh=240renderwithglut raytracemodeelapsed tine = 1.625000 seconds1.21.函数deflate消耗了最多的cpu时间sj rf| | ; i:h 其brjehst 一r. bus jrdycl.cfu一clkjj ins.clo.br_i.bus 一chlinj29601161902610.72828.31%29.52%24.05%了 4212925937

18、50.69121.88%32.82%32.78%25738101811.2477.58%9.67%12.78%1261010180.5563.72%2.54%1.27%21140.2500.06%0.25%0. 13%11323490.4690.03%3.31%2.91%10321.5000.03%0.00%0.38%00313.0000.00%0.00%0.38%01000.0000.00%0.25%0.00%00100.0000.00%0.00%0. 13%02120.5000.00%0.51%0. 13%00010.0000.00%0.00%0.00%02452600.8670.00%6

19、.11%6.58%idactivity idactivity resulttotal sample|cpu id1 56wed apr 01 19:48:52 2015 - sampling results s0ft71695610121 1 !3| processes j threads jmoduleshotspots2.函数 bi_reverse cpi 最高3. 第679行消耗的时钟周期最多4. 是多线程程序,如下图threadsgzip. exe3, 40677881398000thread了gzip. exe000000threadl1gzip. exe000000thread3g

20、zip.exe000000threadsgzip. exe00006872、9621.3n = 1000单线程:d:ppdgemm>natpix.exe enter matrix size n=1000ro1l_youp_own_nu11iply<>. elapsed tine = 6.047 seconds ddot_multiplyo. elapsed tine = 6.031 seconds dgenu_iiultiply<> . elapsed tine = 1.875 seconds dgenfi_nultiply<> . elapsed t

21、ine = 0.109 seconds双线程:d:ppdgemm>natpix.exe enter matrix size n=1000ro ll_»/our_o wn_nult iply < > . elapsed tine = 6.078 seconds ddot_multiplyo. elapsed tine = 6.109 seconds dgenu_nultiply<>. elapsed tine = 1.906 seconds dgenn_nultiply<>. elapsed tine = 0.156 seconds网线程:d:

22、ppdgemm >mat r ix.exeenter matrix size n=1000roll_your_own_nultiply<>. elapsed tine = 6.078 seconds ddot_multiply<>. elapsed tine = 6.078 seconds dgenu_nultiply<>. elapsed tine =secondsdgenn_inultiply<> . elapsed tine = 0.093 seconds八线程:d:ppdgemm >nat r ix.exe enter mat

23、rix size n=1000ro11一your_ownmultiplyo. elapsed time = 6.031 seconds ddot_multiplyo. elapsed tine = 6.047 seconds dgenu_nultiplyo. elapsed time = 1.891 seconds dgenn_nultiplyo. elapsed time = 0.109 seconds十六线程:d:ppdgemm>natrix.exe enter matrix size n=1000roll_your_own_nult iplyo - elapsed tine = 6

24、.125 seconds ddot_mult iplyo. elapsed tine = 6.093 seconds dgenu_nultiply<>. elapsed tine = 1.906 seconds dgenn_nultiply<>. elapsed tine = 0.14 seconds运行 pimonte_randd:ppmontecarlopi>pinonte_rand.exe pi = 3.141471940 seconds = 7.171000000运行 pimonte_vsld:ppmontecarlopi>pinonte_usl.e

25、xe pi = 3.141507280 seconds = 1.843000000d:pp mont©carlopi>pinonte_usl.exe pi = 3.141507280 seconds = 1.828000000十六线程:d:ppm1ontecarlopi>pinonte_usl.exe pi = 3.141507280 seconds = 1.812000000问题:1. 为什么不是1: 1的直接替换rand ()函数?vsl库生成随机数使川流的概念,因此不能直接使川原来的函数2. 设置blocksize的目的是什么?每次生成blocksize个随机数,避

26、免-次性生成2亿个随机数占用太多内存,影响性能3. 参数brng和vsl_brng_mcg31的作川是什么?表示使用mcg31这个基木随机数生成器来产生随机数。4. 对这个程序来说,它们是最好的选择吗?实验程序使用两亿个随机数,使用vsl_brng_mcg31计算出的圆周率与使用c语 言库函数计算出的结果相差不人,因此可能奋更好的随机数生成算法,使得计算结果更加精 确。5. 能用多线程实现吗?可以,计算不同的随机数互不影响,可以使用多线程并行进行。四、思考题思考题1: intel c+ compiler的基本特点?intel c+编译器的主要特点是自动向量化器,它能够生成sse、sse2和sse3的simd 指令及其适用于intel无线mmx和mmx 2的嵌入式变种。思考题2:如何使用intel c+ compiler进行应用程序优化,基木步骤包括?在编

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论