linux 使用intel mpi进阶(二)

本文介绍了如何使用Intel提供的工具进行MPI程序的调试与性能分析。主要包括使用Intel®TraceAnalyzerandCollector进行程序跟踪,利用ApplicationPerformanceSnapshot进行高级性能分析,以及通过启用正确性检测来确保MPI程序的数据类型、缓冲区等组件的一致性和正确性。

1.跟踪和正确性验证
在你运行mpi程序的时候,可以使用Intel® Trace Analyzer and Collector以及Application Performance Snapshot来跟踪和收集数据。
High-Level Performance Analysis:
intel提供了一个轻量级的analysis,就是上面说的aps,下面是一个使用示例:

//启动相关程序
$ source <psxe_installdir>/compilers_and_libraries_<version>.<update>.<package>/linux/bin/compilervars.sh intel64 
$ source <psxe_installdir>/compilers_and_libraries_<version>.<update>.<package>/linux/mpi/intel64/bin/mpivars.sh 
$ source <psxe_installdir>/performance_snapshots/apsvars.sh
//运行aps
$ mpirun -n 4 -aps ./myprog
//运行aps-report
$ aps-report ./aps_result_<date>-<time>

注意//那几行是我的注释,命令行时请不要输入,下同,后面不再重复。
这时候会弹出控制台显示结果。当然aps也会生成一个html文件包含相关信息。文件名为:

aps_report_<date>_<time>.html

Tracing Applications:
当使用Intel Trace Analyzer and Collector时,你需要生成一个你的应用的trace文件,然后用Intel® Trace Analyzer去分析相关信息。trace文件的生成可以使用Intel® Trace Collector,可以用-t(-trace)命令快速调用Intel® Trace Collector,下面是一个例子:

//启动相关程序
$ source <mpi_installdir>/intel64/bin/mpivars.sh 
$ source <itac_installdir>/intel64/bin/itacvars.sh
//启动trace Collector
$ mpirun -trace -n 4 ./myprog
//使用分析器分析
$ traceanalyzer ./myprog.stf &

检测正确性:
使用-check_mpi来启用正确性检测,正确性检测可以检测一些比较常见的问题,具体包括(data types, buffers, communicators, point-to-point messages and collective operations, detect deadlocks, or data corruption),注意最好打开debug选项(-g),例如:

$ mpirun -check_mpi -n 4 ./myprog 
... 
[0] ERROR: GLOBAL:COLLECTIVE:DATATYPE:MISMATCH: error 
...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值