MATLAB における並列 分散コンピューティング ~ Parallel Computing Toolbox & MATLAB Distributed Computing Server ~ MathWorks Japan Application Engineering Group Takashi Yoshida 2016 The MathWorks, Inc. 1
System Configuration Desktop Computer Local Computer Cluster Scheduler MATLAB Desktop (Client) Scale-out 2
Parallel Computing Toolbox ローカル環境によるスケールアップ Desktop Computer Local 並列 分散コンピューティング向けアプリ開発環境を提供 最大 512CPU コアをサポート GP-GPU (NVIDIA 社製グラフィックスカード Compute Capability 2.0 以上 ) をサポート https://developer.nvidia.com/cuda-gpus 初心者から上級者向けまでの機能を提供 ビルトイン関数の並列化 Parallel FOR-loop MPI プログラミング MATLAB Desktop (Client) Parallel Computing Toolbox 3
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 4
クラウドを利用したソフトウェア開発 PaaS (Platform as a Service) MATLAB / Simulink のクラウド利用の例 MATLAB のライセンスは Bring Your Own License Activation MathWorks Remote Access 5
クラウドを利用した計算環境の拡張 IaaS (Infrastructure as a Service) MATLAB Distributed Computing Server のクラウド利用の例 MATLAB のライセンスは Bring Your Own License ライセンス認証 license.dat 計算 License Server 6
Distributed Simulation パラメータ スウィープなシミューレーションを分散処理 parfor 既存モデルの繰り返し実行の例 QROUT = zeros(320,320,10); parfor n = 1:10 end QROUT(:,:,n) = QR_Trans_PCT_wrapper(n); 7
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 8
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 セットの中から燃費効率の最も良いケースを探索 9
Benchmark Testing Offload Simulation 環境 CPU Memory Storage Type OS Lenovo T520 c3.2xlarge Intel Core i7 2640M @ 2.80GHz (2 physical cores / 2 virtual cores) Intel Xeon E5-2680v2 @ 2.80GHz (4 physical cores / 8 virtual cores) c4.8xlarge Intel Xeon E5-2666v3 @ 2.90GHz 2 (Total : 18 physical / 36 virtual cores) 8GB HDD Windows 7 SP1 64bit Enterprise Edition 15GB SSD Windows Server 2012 R2 Standard 60GB SSD Windows Server 2012 R2 Standard シミュレーション 1 回辺りの計算時間 ( 秒 ) 5 4 3 2 1 0 T520 c3.2xlarge c4.8xlarge 10
Benchmark Testing Distributed Simulation 環境 CPU Memory Storage Type OS Lenovo T520 c3.2xlarge Intel Core i7 2640M @ 2.80GHz (2 physical cores / 2 virtual cores) Intel Xeon E5-2680v2 @ 2.80GHz (4 physical cores / 8 virtual cores) c4.8xlarge Intel Xeon E5-2666v3 @ 2.90GHz 2 (Total : 18 physical / 36 virtual cores) 8GB HDD Windows 7 SP1 64bit Enterprise Edition 15GB SSD Windows Server 2012 R2 Standard 60GB SSD Windows Server 2012 R2 Standard 全 161 シミュレーションの計算時間 ( 秒 ) 400 300 200 100 0 T520 c3.2xlarge c3.2xlarge 2 c4.8xlarge2 11
まとめ 1 回のシミュレーション時間短縮 開発と実行 両方をサーバ シミュレーション時間の短縮 複数回のシミュレーション時間短縮 開発はローカル 実行はサーバ 12
まとめ HPC 環境へのリモートアクセス 1 回のシミュレーション時間短縮 開発と実行 両方をサーバ シミュレーション時間の短縮 複数回のシミュレーション時間短縮 開発はローカル 実行はサーバ サーバ環境に MATLAB/Simulink を用意 MATLAB ライセンスは BYOL On-premise Remote access Cloud (Amazon EC2) 13
まとめ HPC 環境を使った Offload Simulation 1 回のシミュレーション時間短縮 開発と実行 両方をサーバ シミュレーション時間の短縮 複数回のシミュレーション時間短縮 開発はローカル 実行はサーバ ローカルホストには Parallel Computing Toolbox サーバ環境には MATLAB Distributed Computing Server ネットワークライセンスの負荷低減 MATLAB Distributed Computing Server On-premise Cloud (Amazon EC2) 14
まとめ HPC 環境へのリモートアクセスと分散シミュレーション 1 回のシミュレーション時間短縮 開発と実行 両方をサーバ シミュレーション時間の短縮 複数回のシミュレーション時間短縮 開発はローカル 実行はサーバ サーバ環境に MATLAB/Simulink そして Parallel Computing Toolbox MATLAB Distributed Computing Sever による拡張 Remote access Parallel Computing Toolbox On-premise Parallel Computing Toolbox Cloud (Amazon EC2) 15
まとめ HPC 環境を用いた分散シミュレーション 1 回のシミュレーション時間短縮 開発と実行 両方をサーバ シミュレーション時間の短縮 複数回のシミュレーション時間短縮 開発はローカル 実行はサーバ ローカルホストには Parallel Computing Toolbox サーバ環境には MATLAB Distributed Computing Server MATLAB Distributed Computing Server On-premise Cloud (Amazon EC2) 16