こしぞーのひとり情シス

Windows/仮想化の小規模環境を運用するリーマンの日々を綴っています。

WindowsでLinpackの実行(最強CPUベンチマークとしてのHPL)

f:id:bfx62324:20200125233356p:plain

CPU / Memoryを含めたコンピュータ計算性能の総合的なベンチマーク試験のLinpack(リンパック)について記載します
実行が最も簡単なビルド済みLinpack実行方法を記述します
ただし、同時複数台で計算することはできないのでご注意ください(MPIが必要な場合はソースコードからのコンパイルが必要です)

Linpackダウンロード

ビルド済み(コンパイル済み)LinpackはこちらのURLからダウンロード可能です

Intel Math Kernel Library (Intel MKL) Benchmarks Suite」と表示されます
一般的にはMKLと呼ばれている、Intel Math Kernerl LibraryでコンパイルされたLinpackの実行バイナリがダウンロード可能です

f:id:bfx62324:20200317190140p:plain

Windowsで実行する場合は、Windows用のバイナリをダウンロードしてください

f:id:bfx62324:20200317190228p:plain

Linpack (HPL) 実行

実行のためのマニュアルはこちらのURLも参考にしてください

フォルダを展開して、「benchmarks_2019¥windows¥mkl¥benchmarks¥linpack」フォルダまで移動しましょう

f:id:bfx62324:20200317231154p:plain

まず最初に、Linpackの実行パラメータとして計算サイズなどを「lininput_xeon64」を編集することで行いましょう

計算サイズは1コアでのシングルスレッド実行時に10分ほど要する計算サイズであれば問題なくベンチマークとして成立すると思います
同じサイズで8コア実行すると大体1分半くらい、16コアで実行すると40秒位で完了させるサイズでまずは初めて見るくらいがちょうどいいです
(計算サイズはあとでいくらでも大きくできるので)

  • lininput_xeon64 (デフォルト)
Sample data file lininput_xeon64.
15                     # number of tests
1000 2000 5000 10000 15000 18000 20000 22000 25000 26000 27000 30000 35000 40000 45000 # problem sizes
1000 2000 5008 10000 15000 18008 20016 22008 25000 26000 27000 30000 35000 40000 45000 # leading dimensions
4 2 2 2 2 2 2 2 2 2 1 1 1 1 1 # times to run a test
4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 # alignment values (in KBytes)
  • lininput_xeon64 (変更後)
    以下の内容に変更します。これで大体10GBメモリサイズくらいでフル計算した際に1コアあたり10分程度の試験が実施できます
Sample data file lininput_xeon64.
1                     # number of tests
30000  # problem sizes
30000  # leading dimensions
2  # times to run a test
4  # alignment values (in KBytes)

計算サイズを大きくしたい場合は、「Probrem Size」と「Leading dimensions」を大きくしていってください

最後に、実行ファイルの「runme_xeon64」を編集してください

  • runme_xeon64.bat (デフォルト:編集前)
@echo off
rem ============================================================================
rem Copyright 2001-2019 Intel Corporation.
rem
rem This software  and the related  documents  are Intel  copyrighted materials,
rem and your use  of them is  governed by the express  license under  which they
rem were provided to you (License).  Unless the License provides otherwise,  you
rem may not use,  modify,  copy, publish,  distribute, disclose or transmit this
rem software or the related documents without Intel's prior written permission.
rem
rem This software and the related documents are provided as is,  with no express
rem or implied warranties,  other  than those that  are expressly  stated in the
rem License.
rem ============================================================================

echo This is a SAMPLE run script for running a shared-memory version of
echo Intel(R) Distribution for LINPACK* Benchmark. Change it to refect
echo the correct number of CPUs/threads, problem input files, etc..
echo *Other names and brands may be claimed as the property of others.

SETLOCAL

rem Setting path to OpenMP library
set PATH=..\..\..\redist\intel64\compiler;%PATH%
set PATH=..\..\..\redist\intel64_win\compiler;%PATH%
rem Setting up affinity for better threading performance
set KMP_AFFINITY=nowarnings,compact,1,0,granularity=fine

date /t
time /t

echo Running linpack_xeon64.exe. Output could be found in win_xeon64.txt.
linpack_xeon64.exe lininput_xeon64 > win_xeon64.txt

date /t >> win_xeon64.txt
time /t >> win_xeon64.txt

echo    Done:
date /t
time /t

ENDLOCAL

環境変数に、OMP_NUM_THREADS=XX を追加 して使用するコア数を指定します

  • OMP_NUM_THREADS=1  なら、1コアで実行される
  • OMP_NUM_THREADS=4  なら、4コアで実行される
  • OMP_NUM_THREADS=16 なら、16コアで実行される

  • runme_xeon64.bat (環境変数に、OMP_NUM_THREADS=XX を追加)

set PATH=..\..\..\redist\intel64\compiler;%PATH%
set PATH=..\..\..\redist\intel64_win\compiler;%PATH%
rem Setting up affinity for better threading performance
set KMP_AFFINITY=nowarnings,compact,1,0,granularity=fine
OMP_NUM_THREADS=4    *こんな感じ

あとはコマンドプロンプトから「runme_xeon64.bat」を実行すればOKです

関連記事です

Windows HCI の S2D を手作りでセットアップする方法です

www.hitoriit.com

www.hitoriit.com

www.hitoriit.com

以上