MATLAB® における並列・分散コンピューティング …...4 MATLAB Distributed Computing...

16
1 © 2016 The MathWorks, Inc. MATLAB ® における並列・分散コンピューティング ~ Parallel Computing Toolbox & MATLAB Distributed Computing Server ~ MathWorks ® Japan Application Engineering Group Takashi Yoshida

Transcript of MATLAB® における並列・分散コンピューティング …...4 MATLAB Distributed Computing...

1© 2016 The MathWorks, Inc.

MATLAB® における並列・分散コンピューティング~ Parallel Computing Toolbox™ & MATLAB Distributed Computing Server™ ~

MathWorks® Japan

Application Engineering Group

Takashi Yoshida

2

System Configuration

MATLAB Desktop (Client)

Local

Desktop Computer

Computer Cluster

Scheduler

Scale-out

3

Parallel Computing Toolboxローカル環境によるスケールアップ

並列・分散コンピューティング向けアプリ開発環境を提供– 最大 512CPUコアをサポート

– GP-GPU (NVIDIA社製グラフィックスカード Compute

Capability 2.0以上) をサポート

https://developer.nvidia.com/cuda-gpus

– 初心者から上級者向けまでの機能を提供

ビルトイン関数の並列化

Parallel FOR-loop

MPI プログラミング

MATLAB Desktop (Client)

Local

Desktop Computer

Parallel Computing Toolbox

4

MATLAB Distributed Computing Serverクラスタ環境へのスケールアウト

クラスタ上での並列・分散コンピューティング環境を提供– 大規模解析・シミューレーション

– MATLAB / Simulink® Product

Family をサポート

– 汎用スケジューラとの連携 IBM® Platform LSF

Microsoft® Windows® HPC Server

Altair PBS Professional®

TORQUE

Generic Scheduler

Grid Engine / SLURM / etc.

Computer Cluster

Scheduler

MATLAB Distributed Computing Server

5

クラウドを利用したソフトウェア開発PaaS (Platform as a Service)

MATLAB / Simulink のクラウド利用の例– MATLABのライセンスは”Bring Your Own License”

Remote Access

Activation

MathWorks

6

クラウドを利用した計算環境の拡張IaaS (Infrastructure as a Service)

MATLAB Distributed Computing Server のクラウド利用の例– MATLABのライセンスは”Bring Your Own License”

計算

ライセンス認証

LicenseServer

license.dat

7

Distributed Simulationパラメータ・スウィープなシミューレーションを分散処理

既存モデルの繰り返し実行の例

parfor

QROUT = zeros(320,320,10);

parfor n = 1:10

QROUT(:,:,n) = QR_Trans_PCT_wrapper(n);

end

8

Offload Simulationシミューレーション実行環境の移行

既存モデルのオフロード実行の例

batch

>> %% Run a model on a cluster using BATCH>> mycluster = parcluster(’mycluster’); % Select a cluster profile>> job = batch('callmodelscript'); % Create a job and submit it>> wait(job); % Wait until the submitted job has done>> out = load(job); % Retrieve the output from a worker>> >> %% Do a post-process>> delete(job); % Delete the job object>> datastr = get(out.ans, 'ScopeData'); % Get the output from outport block>> clear out % Discard large data>> %% Plot the result of simulation>> figure;>> plot(datastr.time, datastr.signals.values);

mdl = 'sldemo_suspn_3dof';open_system(mdl,'loadonly');sim(mdl);

callmodelscript.m

9

Benchmark Testing

評価モデル– Dual Clutch Transmission Model

詳細に関しては以下をご覧くださいhttp://www.mathworks.com/matlabcentral/fileexchange/32246-dual-clutch-transmission-model-in-simulink

http://www.mathworks.com/videos/shift-schedule-optimization-of-a-dual-clutch-transmission-81828.html

– シフトスケジュール161セットの中から燃費効率の最も良いケースを探索

10

Benchmark TestingOffload Simulation

環境 CPU Memory Storage Type OS

Lenovo T520 Intel Core i7 2640M @ 2.80GHz(2 physical cores / 2 virtual cores)

8GB HDD Windows 7 SP1 64bit Enterprise Edition

c3.2xlarge Intel Xeon E5-2680v2 @ 2.80GHz(4 physical cores / 8 virtual cores)

15GB SSD Windows Server 2012 R2 Standard

c4.8xlarge Intel Xeon E5-2666v3 @ 2.90GHz × 2(Total : 18 physical / 36 virtual cores)

60GB SSD Windows Server 2012 R2 Standard

0

1

2

3

4

5

シミュレーション1回辺りの計算時間 (秒)

T520 c3.2xlarge c4.8xlarge

11

Benchmark TestingDistributed Simulation

環境 CPU Memory Storage Type OS

Lenovo T520 Intel Core i7 2640M @ 2.80GHz(2 physical cores / 2 virtual cores)

8GB HDD Windows 7 SP1 64bit Enterprise Edition

c3.2xlarge Intel Xeon E5-2680v2 @ 2.80GHz(4 physical cores / 8 virtual cores)

15GB SSD Windows Server 2012 R2 Standard

c4.8xlarge Intel Xeon E5-2666v3 @ 2.90GHz × 2(Total : 18 physical / 36 virtual cores)

60GB SSD Windows Server 2012 R2 Standard

0

100

200

300

400

全 161 シミュレーションの計算時間 (秒)

T520 c3.2xlarge c3.2xlarge ✕ 2 c4.8xlarge2

12

まとめ

シミュレーション時間の短縮

1回のシミュレーション時間短縮

複数回のシミュレーション時間短縮

開発はローカル、実行はサーバ

開発と実行、両方をサーバ

13

まとめHPC環境へのリモートアクセス

シミュレーション時間の短縮

1回のシミュレーション時間短縮

複数回のシミュレーション時間短縮

開発はローカル、実行はサーバ

開発と実行、両方をサーバ

サーバ環境に MATLAB/Simulink を用意

MATLABライセンスはBYOL

Cloud(Amazon EC2)

On-premise

Remote access

14

まとめHPC環境を使った Offload Simulation

シミュレーション時間の短縮

1回のシミュレーション時間短縮

複数回のシミュレーション時間短縮

開発はローカル、実行はサーバ

開発と実行、両方をサーバ

ローカルホストには Parallel Computing Toolbox

サーバ環境には MATLAB Distributed Computing Server

ネットワークライセンスの負荷低減

Cloud(Amazon EC2)

On-premise

MATLAB Distributed Computing Server

15

まとめHPC環境へのリモートアクセスと分散シミュレーション

シミュレーション時間の短縮

1回のシミュレーション時間短縮

複数回のシミュレーション時間短縮

開発はローカル、実行はサーバ

開発と実行、両方をサーバ

サーバ環境に MATLAB/Simulink、そしてParallel Computing Toolbox

MATLAB Distributed Computing Sever による拡張

Cloud(Amazon EC2)

Parallel Computing

Toolbox

On-premise

Parallel Computing Toolbox

Remote access

16

まとめHPC環境を用いた分散シミュレーション

シミュレーション時間の短縮

1回のシミュレーション時間短縮

複数回のシミュレーション時間短縮

開発はローカル、実行はサーバ

開発と実行、両方をサーバ

ローカルホストには Parallel Computing Toolbox

サーバ環境には MATLAB Distributed Computing Server

Cloud(Amazon EC2)

On-premise

MATLAB Distributed Computing Server