• 検索結果がありません。

性能解析ツール

ドキュメント内 SGI AltixUV1000 並列化プログラミング講習会 (ページ 55-66)

Altix UV Blade

並列実行領域では全てのプロセッサから 1 ノードへのアクセスが集中してプログラムの 性能が低下します。

10. 性能解析ツール

性能解析ツール

 プログラムのホットスポットやボトルネックを検出するための性 能解析ツールを用意しています。

– シリアルプログラムだけでなく、 OpenMP や MPI による並列プログラム の性能解析も可能。

– MPI 通信の解析も可能。

– 性能解析ツール

• PerfSuite

– MPI 通信解析ツール

• MPInside

PerfSuite

 PerfSuite は、プログラムのホットスポットをルーチンレベル、ラ

インレベルで調査することができます。

 PerfSuite の特徴

– 再リンクを必要としない

• (ラインレベルの解析は ”-g” を付けて再ビルドの必要があります。)

– MPI や OpenMP による並列プログラムに対応 – シンプルなコマンドライン・ツール

– スレッド / プロセスごとにレポートを出力

– ソースラインレベルで解析可能

PerfSuite 利用方法 ( 準備 )

 準備

– bash 系の場合 – csh 系の場合

$ . /opt/sgi/PERFSUITE/bin/psenv.sh

$ source /opt/sgi/PERFSUITE/bin/psenv.csh

PerfSuite 利用方法 ( 実行コマンド )

 psrun コマンドを用いてプロファイルの取得をします。ラインレベルでの

取得が必要な場合は ”-g” オプションを付けてビルドします。

 PerfSuite でプロファイル取得時の実行コマンドです。 dplace コマンドの オプションが変わりますのでご注意ください。

 シリアルプログラム (0 番のコアで実行 )

 OpenMP プログラム (4 スレッドを 0 から 3 番のコアで実行 )

 MPI プログラム (SGI MPT を用いて、 4 プロセスを 0 から 3 番のコアで実行 )

$ dplace –s1 –c0 psrun ./a.out

$ dplace –x5 –c0-3 psrun -p ./a.out

$ mpirun –np 4 dplace –s2 –c0-3 psrun -f ./a.out

PerfSuite 利用方法 ( 実行例 )

 OpenMP プログラム 4 スレッドの実行例

– 実行後、スレッド / プロセス毎に以下の名前のファイルが生 成されます。

” プロセス名 .( スレッド番号 .)PID. ホスト名 .xml”

$ ls -l a.out.*.xml

-rw-r--r-- 1 appadm crj 9999 2012-06-18 16:53 a.out.0.387865.uva.xml

-rw-r--r-- 1 appadm crj 5146 2012-06-18 16:53 a.out.1.387865.uva.xml

-rw-r--r-- 1 appadm crj 11040 2012-06-18 16:53 a.out.2.387865.uva.xml

-rw-r--r-- 1 appadm crj 9253 2012-06-18 16:53 a.out.3.387865.uva.xml

-rw-r--r-- 1 appadm crj 9498 2012-06-18 16:53 a.out.4.387865.uva.xml

PerfSuite 利用方法 ( 結果の表示例 )

 プロファイル結果として出力されたファイルを

psprocess コマンドで成形してプロファイル結果を表

示します。

$ psprocess a.out.0.387865.uva.xml

PerfSuite Hardware Performance Summary Report

Version : 1.0

Created : Mon Jun 18 16:54:28 JST 2012 Generator : psprocess 0.5

XML Source : a.out.0.387865.uva.xml

Execution Information

============================================================================================

Collector : libpshwpc

Date : Mon Jun 18 16:53:30 2012 Host : uva

Process ID : 387865 Thread : 0 User : appadm Command : a.out

Processor and System Information

============================================================================================

Node CPUs : 512 Vendor : Intel

Family : Pentium Pro (P6)

Brand : Intel(R) Xeon(R) CPU E7- 8837 @ 2.67GHz CPU Revision : 2

Clock (MHz) : 2666.582 Memory (MB) : 8272784.73 Pagesize (KB) : 4

Cache Information

============================================================================================

Cache levels : 3

============================================================================================

………

Profile Information

============================================================================================

Class : itimer Version : 1.0

Event : ITIMER_PROF (Process time in user and system mode) Period : 10000

Samples : 801

PerfSuite 利用方法 ( 結果の表示例 )

 OpenMP プログラムを 4 スレッドで実行したときのマスタースレッドの結果。

Module Summary

--- Samples Self % Total % Module

798 99.63% 99.63% /home/appadm/gojuki/training_2012/a.out 3 0.37% 100.00% /lib64/libc-2.11.1.so

1 0.12% 100.12% /lib64/libpthread-2.11.1.so File Summary

--- Samples Self % Total % File

798 99.63% 99.63% /home/appadm/gojuki/training_2012/himenoBMTomp.c 4 0.50% 100.12% ??

Function Summary

--- Samples Self % Total % Function

425 53.06% 53.06% L_jacobi_201__par_loop0_2_132 355 44.32% 97.38% jacobi

18 2.25% 99.63% main Function:File:Line Summary

--- Samples Self % Total % Function:File:Line

327 40.82% 40.82% jacobi:/home/appadm/gojuki/training_2012/himenoBMTomp.c:230

58 7.24% 48.06% L_jacobi_201__par_loop0_2_132:/home/appadm/gojuki/training_2012/himenoBMTomp.c:211 58 7.24% 55.31% L_jacobi_201__par_loop0_2_132:/home/appadm/gojuki/training_2012/himenoBMTomp.c:213 57 7.12% 62.42% L_jacobi_201__par_loop0_2_132:/home/appadm/gojuki/training_2012/himenoBMTomp.c:206

プロファイルを取得したシステムの環境のサマリー

モジュール毎のプロファイル結果

ファイル毎のプロファイル結果

関数毎のプロファイル結果

ラインレベルでのプロファイル結果

MPInside

 MPInside は MPI プログラムにおいて、どの MPI 関数で

時間がかかっているのか、また通信するデータサイズ などのプロファイルを取得することができます。

 プロファイル結果によって、 MPI プログラムのチューニン

グに有用な情報が得られます。

MPInside 利用方法 ( 準備と実行 )

 準備

– module コマンドで MPInside を利用できるように設定します。

 実行例

– 4 プロセスを 0 から 3 番のコアで実行する場合を示します。

– 実行結果は mpinside_stats ファイルに保存されます。

$ module load MPInside/3.5.1

$ mpirun -np 4 dplace -s1 -c0-3 MPInside ./a.out

MPInside 利用方法 ( 実行結果 )

 4 並列で実行したときの実行結果

MPInside 3.5.1 standard(Oct 13 2011 06:32:25) >>> column meanings <<<<

init : MPI_Init

waitall : mpi_waitall : Ch_send=0,R_send+=count;Ch_recv=0,R_recv++

isend : mpi_isend irecv : mpi_irecv

barrier : mpi_barrier : R_send+=comm_sz;R_recv++

allred : mpi_allreduce : R_send+=comm_sz;Ch_recv+=count,R_recv++

carcrea : mpi_cart_create cartget : mpi_cart_get carshif : mpi_cart_shift

overhead : mpinside_overhead : Various MPInside overheads

>>>> Elapse times in (s) 0 1<<<<

CPU Comput init waitall isend irecv barrier allred carcrea cartget carshif overhead 0000 29.6462 0.0002 0.0411 1.3795 0.0056 0.0003 0.0360 0.0002 0.0000 0.0000 0.0069 0001 29.6491 0.0002 0.0936 1.3694 0.0026 0.0031 0.0055 0.0002 0.0000 0.0000 0.0067 0002 29.6862 0.0002 0.0147 1.3753 0.0061 0.0055 0.0372 0.0002 0.0000 0.0000 0.0023 0003 29.7152 0.0002 0.0169 1.3541 0.0242 0.0084 0.0075 0.0002 0.0000 0.0000 0.0011

>>>> Ch_send array: Mbytes with send attribute <<<<

CPU Comput init waitall isend irecv barrier allred carcrea cartget carshif overhead 0000 --- 0 0 98 0 0 0 0 0 0 0 0001 --- 0 0 98 0 0 0 0 0 0 0 0002 --- 0 0 98 0 0 0 0 0 0 0 0003 --- 0 0 98 0 0 0 0 0 0 0

>>>> R_send array: Number of requests with Send attribute<<<<

CPU Comput init waitall isend irecv barrier allred carcrea cartget carshif overhead 0000 --- 1 2080 520 0 8 1048 0 0 0 0 0001 --- 1 2080 520 0 8 1048 0 0 0 0 0002 --- 1 2080 520 0 8 1048 0 0 0 0 0003 --- 1 2080 520 0 8 1048 0 0 0 0

>>>> Ch_recv array: Mbytes with Recv attribute <<<<

CPU Comput init waitall isend irecv barrier allred carcrea cartget carshif overhead 0000 --- 0 0 0 98 0 0 0 0 0 0 0001 --- 0 0 0 98 0 0 0 0 0 0 0002 --- 0 0 0 98 0 0 0 0 0 0 0003 --- 0 0 0 98 0 0 0 0 0 0

>>>> R_recv array: Number of requests with Recv attribute<<<<

CPU Comput init waitall isend irecv barrier allred carcrea cartget carshif overhead 0000 --- 0 520 0 520 2 262 1 1 2 0 0001 --- 0 520 0 520 2 262 1 1 2 0

経過時間ごとの通信プロファイル結果

送信サイズ

[Mbytes]

送信回数

受信サイズ

[Mbytes]

受信回数

ドキュメント内 SGI AltixUV1000 並列化プログラミング講習会 (ページ 55-66)

関連したドキュメント