Publications

Back to Peer-reviewed journal papers

Time-Based Dynamic Load Balancing Algorithm for Domain Decomposition with Particle Method Adopting Three-Dimensional Polygon-Wall Boundary Model

Authors
Y. Mizuno†, N. Mitsume, T. Yamada, S. Yoshimura
Published in
Journal of Advanced Simulation in Science and Engineering
Volume, pages
Vol.6, No.2, pp.282–297
Year
2019
Type
Peer-reviewed journal papers
Link
https://doi.org/10.15748/jasse.6.282
Topics
Particle methods Large-scale parallel computing Tsunami and disaster mitigation Fluid dynamics
Keywords
Time-based dynamic load balancing algorithm Domain decomposition Particle method Polygon wall boundary model Dynamic load balancing Distributed memory parallel computing Free-surface flow analysis Three-dimensional ERP wall boundary model Weight values based on calculation time Domain repartition
グラフィカルアブストラクト
グラフィカルアブストラクト

概要

津波などの自由表面流れの解析には、粒子法が有効な手法の一つとされています。なかでも、Navier–Stokes 方程式のすべての項を陽的に計算する EMPS(Explicit Moving Particle Simulation)法は、圧力の項を陰的に解く MPS 法より、並列計算を行いやすい手法です。EMPS 法による自由表面流れの並列解析システム HDDM_EMPS は、これまで、壁を粒子で表す壁粒子境界モデルを使っていました。壁をポリゴンで表す ERP(Explicitly Represented Polygon)壁境界モデルは、仮想的な粒子を置かずに済みますが、2 次元の解析領域にしか使えませんでした。また、ERP 壁境界モデルでは、ポリゴンの近くにある粒子に追加の計算が要ります。このため、各プロセッシングエレメント(PE)の粒子数をそろえる従来の領域分割では、ポリゴンが偏って置かれた問題で、特定の PE に計算負荷が偏るおそれがあります。

本論文は、ERP 壁境界モデルを 3 次元に拡張して HDDM_EMPS に組み込み、このモデルに適した領域分割の方法として、計算時間に基づく動的負荷分散アルゴリズムを提案しています。このアルゴリズムは、EMPS と ERP の計算にかかった時間を粒子ごとに記録し、それを重みにして、PE の計算時間がそろうように解析領域を分割します。領域を分割し直すかどうかも、PE ごとの計算時間の偏りで判定します。静水圧問題とダムブレイク問題を使った動的負荷分散のテストと強スケーリングのテストで、粒子数に基づく従来のアルゴリズムより少ない計算コストで解析できることと、並列化の効率が高いことを示しています。

重要点

1. ERP 壁境界モデルを 3 次元に拡張し、並列解析システム HDDM_EMPS に組み込む

ERP 壁境界モデル(Mitsume ら)は、EMPS 法のためのポリゴン壁境界モデルです。粒子 ii からの力が、ポリゴン壁の上で粒子 ii に最も近い点 xiwall\boldsymbol{x}_i^{\mathrm{wall}} だけに働くとみなし、鏡像粒子の考え方を使って、壁の上の圧力のノイマン境界条件と、スリップまたはノンスリップの境界条件を満たします。仮想的な粒子を置く必要がありません。論文は、このモデルには、任意の形の三角形ポリゴンを壁境界として扱える可能性と、平らな壁の計算コストを壁粒子境界モデルより減らせる可能性があると述べています。

HDDM_EMPS(Murotani ら)は、EMPS 法で自由表面流れを並列計算機の上で解析するシステムです。解析領域をバウンディングボックスで囲み、その中に置いたバケットに粒子を格納して、グラフ分割のライブラリ ParMETIS で、PE に割り当てる領域に分割します。これまでの HDDM_EMPS は壁粒子境界モデルを使っており、ERP 壁境界モデルは 2 次元の解析領域にしか使えませんでした。本論文は、ERP 壁境界モデルを 3 次元の解析領域に拡張して、HDDM_EMPS に組み込みました。論文は、壁粒子境界モデルを使う場合に比べて、複雑な形状の境界を表せることと、自由表面流れをより短い計算時間で解析できることを利点に挙げています。ERP の計算は、次の手順で行います(図 1)。

  • (a) 任意の数のポリゴンを囲む、全体のバウンディングボックスを置きます。
  • (b) 全体のバウンディングボックスの中に、局所のバウンディングボックスを置きます。局所のバウンディングボックスの長さは、3 つの方向とも、EMPS 法の近傍粒子の探索に使う影響半径の長さです。
  • (c) 粒子を ERP の計算に使うかどうかを選別します。局所のバウンディングボックスの中にある粒子 ii だけを、最も近い点 xiwall\boldsymbol{x}_i^{\mathrm{wall}} の計算に使います。
  • (d) (b) と (c) を、節点と粒子のそれぞれについて繰り返します。

全体のバウンディングボックスの中に流体粒子がないときは、(b) を省きます。

ERP の計算の手順 (a)、(b)、(c) の模式図
図 1 ERP の計算の手順の模式図。左から、手順 (a)、(b)、(c) です。桃色の破線は全体のバウンディングボックス、橙色の破線は局所のバウンディングボックス、灰色の点はポリゴンの節点、青の丸は流体粒子、黄色の丸は ERP の計算に使う粒子 ii を表します。出典:原論文 Fig. 6(左)、Fig. 7(中央)、Fig. 8(右)(© 2019 Japan Society for Simulation Technology)。原論文で横に並んでいる 3 つの図を、並びのまま 1 枚に切り出しています。

論文は、これらの手順の計算時間はポリゴンの数が増えるほど長くなり、ポリゴンが解析領域の中に偏って置かれていると、PE の間で計算負荷が釣り合わなくなる問題(動的負荷分散の問題)が起きうると述べています。

2. 粒子数をそろえる従来の領域分割では、PE の計算負荷がそろわない

HDDM_EMPS は、ParMETIS のルーチン ParMETIS_V3_PartGeomKway で領域を分割します。このルーチンは、頂点と辺の重みに基づいて、解析領域の k-way 分割を行います。HDDM_EMPS は、粒子を頂点とみなして頂点の重みを調整し(辺の重みは変えません)、PE への粒子の割り当てに基づいて解析領域を分割します。論文は、この重みを適切に調整しないと、PE の間の計算負荷が釣り合わず、並列計算の効率が下がると述べています。

従来の分散メモリ型並列アルゴリズム(Murotani ら)は、それぞれの PE がほぼ同じ数の粒子を持つように、粒子を配ります。図 2 は、壁粒子境界モデルを使う解析領域を 3 つの PE に分ける例です。粒子は全部で 45 個で、右端に縦に並ぶ 15 個が壁を表します。このアルゴリズムは、それぞれの PE に 15 個の粒子を配ります。

壁粒子境界モデルを使う場合の、従来のアルゴリズムによる領域分割の模式図
図 2 壁粒子境界モデルを使う場合の、従来のアルゴリズムによる領域分割の模式図。3 つの PE(PE0 は緑、PE1 は赤、PE2 は茶色の枠)が、15 個ずつの粒子を持ちます。出典:原論文 Fig. 9(© 2019 Japan Society for Simulation Technology)。

ERP 壁境界モデルでは、壁を表す粒子は要りません。その代わりに、それぞれのポリゴン壁の近くにある粒子を見つけ、その中で最も近い粒子から圧力の値を得る計算が要ります。図 3 の左は、同じ解析領域を ERP 壁境界モデルで表した例です。粒子は全部で 30 個になり、黄色の 4 個が ERP の計算に使う粒子です。従来のアルゴリズムは、黄色の粒子をほかの粒子と区別せず、粒子数だけに基づいて、それぞれの PE に 10 個の粒子を配ります。論文は、黄色の粒子の計算には青の粒子より多くの計算コストがかかるので、特定の PE の計算負荷がほかの PE より大きくなりうると指摘しています。図 3 の右は、次の項で述べる、提案するアルゴリズムによる分割です。

ERP 壁境界モデルを使う場合の、従来のアルゴリズムと提案するアルゴリズムによる領域分割の模式図
図 3 ERP 壁境界モデルを使う場合の、領域分割の模式図。左:従来のアルゴリズム。3 つの PE が、10 個ずつの粒子を持ちます。右:提案するアルゴリズム。図の中の T0T_0、T1T_1、T2T_2 は、PE0、PE1、PE2 でかかる時間です。黄色の丸は ERP の計算に使う粒子です。出典:原論文 Fig. 10(左)と Fig. 11(右)(© 2019 Japan Society for Simulation Technology)。原論文で横に並んでいる 2 つの図を、並びのまま 1 枚に切り出しています。

3. 粒子ごとの計算時間を重みにして、領域を分割する

提案する「計算時間に基づく動的負荷分散アルゴリズム」は、EMPS と ERP の計算にかかる時間によって、ERP の計算に使う粒子(図 3 の左の黄色の粒子)と、それ以外の粒子(青の粒子)を区別します。ポリゴン壁の境界条件を満たすための追加の計算があるので、それぞれの粒子に計算時間に応じた重みを与え、計算時間に基づいて解析領域を分割します。pp 番目の PE の計算時間 TpT_p は、時間ステップごとに次の式で測ります。

Tp=∑i=0npfluidtifluid+∑i=0npERPtiERP(16)T_p = \sum_{i=0}^{n_p^{\mathrm{fluid}}} t_i^{\mathrm{fluid}} + \sum_{i=0}^{n_p^{\mathrm{ERP}}} t_i^{\mathrm{ERP}} \tag{16}

ここで、npfluidn_p^{\mathrm{fluid}} は pp 番目の PE にある粒子のうち ERP の計算に使わない粒子の数、npERPn_p^{\mathrm{ERP}} は ERP の計算に使う粒子の数です。tifluidt_i^{\mathrm{fluid}} は ERP の計算に使わない粒子のそれぞれに記録された計算時間、tiERPt_i^{\mathrm{ERP}} は ERP の計算に使う粒子のそれぞれに記録された計算時間で、ii は粒子の番号です。

このアルゴリズムは、TpT_p が PE の間でほぼ同じになるように、粒子を割り当てます。図 3 の右は、左と同じ解析領域を、提案するアルゴリズムで分割した例です。粒子は全部で 30 個、ERP の計算に使う黄色の粒子も同じですが、PE0、PE1、PE2 が持つ粒子は、それぞれ 13 個、8 個、9 個になります。EMPS と ERP の計算に要る時間に基づいて粒子を割り当てるので、PE ごとの粒子数は同じになりません。

粒子に記録された計算時間は前の時間ステップで得るので、最初のステップだけは、例外として粒子数を重みに使います。このため、2 ステップ目には必ず領域の再分割が起きます。

4. 領域の再分割も、計算時間の偏りで判定する

解析の途中で PE の間の計算量が釣り合わなくなったときは、解析領域を分割し直す必要があります。論文は、静水圧問題のような静的な問題では、解析領域が最初の配置から動かないので、通常は再分割が要らないのに対し、ダムブレイク問題のような動的な問題では、解析領域が動的に変わって負荷の釣り合いに影響するので、再分割が必要になりうると説明しています。

従来のアルゴリズムは、次の不等式が成り立つときに、粒子数に基づいて領域を再分割します。

c<Np×max⁡0≤p≤Np−1np∑p=0Np−1np(17)c < \frac{N_p \times \max_{0 \leq p \leq N_p - 1} n_p}{\sum_{p=0}^{N_p - 1} n_p} \tag{17}

ここで、cc は 1.0 より大きいしきい値、NpN_p は PE の総数、npn_p は pp 番目の PE にある粒子の総数です。論文は、式 (17) の右辺は常に 1.0 より大きくなるので、再分割の時期は cc の値によって変わると述べています。

提案するアルゴリズムは、粒子に記録された計算時間に基づいて、次の不等式が成り立つときに領域を再分割します。

c<Np×max⁡0≤p≤Np−1Tp∑p=0Np−1Tp(18)c < \frac{N_p \times \max_{0 \leq p \leq N_p - 1} T_p}{\sum_{p=0}^{N_p - 1} T_p} \tag{18}

図 4 は、ダムブレイク問題での再分割の時期の例です。従来のアルゴリズムで cc を 1.05 にすると、式 (17) の右辺は 65 ステップ目と 66 ステップ目にしきい値を超え、それぞれのステップで再分割が行われました(左)。提案するアルゴリズムで cc を 1.5 にすると、式 (18) の右辺は 21、27、71 ステップ目にしきい値を超えました(右)。論文は、右の図の線がジグザグになるのは、それぞれの PE の計算時間が時間ステップごとにばらつくためと説明しています。以下の数値実験では、式 (17) と式 (18) のどちらでも cc を 1.5 にしています。

ダムブレイク問題での、PE ごとの粒子数と計算時間の推移
図 4 ダムブレイク問題での再分割の時期の例。左:従来のアルゴリズム(cc は 1.05)での、PE ごとの粒子数の推移。右:提案するアルゴリズム(cc は 1.5)での、PE ごとの計算時間の推移。横軸は時間ステップです。出典:原論文 Fig. 12(左)と Fig. 13(右)(© 2019 Japan Society for Simulation Technology)。原論文で横に並んでいる 2 つの図を、並びのまま 1 枚に切り出しています。

数値実験の結果

ポリゴンの数と計算時間の関係(静水圧問題)

静水圧問題(次の項)で、ポリゴンの数を変えて、EMPS と ERP の計算に要る時間を PE ごとに調べました(図 5)。この問題では、提案するアルゴリズムだけが、例外の処理として 2 ステップ目に 1 回、解析領域を再分割します。

ポリゴンの数と、PE ごとの計算時間の関係
図 5 静水圧問題での、ポリゴンの数と、PE ごとの計算時間の関係。左:従来のアルゴリズム、右:提案するアルゴリズム。出典:原論文 Fig. 14(左)と Fig. 15(右)(© 2019 Japan Society for Simulation Technology)。原論文で横に並んでいる 2 つの図を、並びのまま 1 枚に切り出しています。
  • 従来のアルゴリズムでは、ポリゴンの数が増えるほど、PE3 の計算負荷だけが増えました。
  • 論文は、提案するアルゴリズムがこの負荷の偏りを解消し、EMPS と ERP の計算に要る時間を減らすと述べています。

解析した問題

動的負荷分散と強スケーリング効率を確かめるために、静的な問題として静水圧問題を、動的な問題としてダムブレイク問題を使いました。PE の間の計算負荷の偏りを意図的に起こすため、三角形ポリゴンを偏らせて配置しています。

  • 静水圧問題(図 6):直方体の容器に、静止した流体粒子を置きます。容器の体積は 5.0 × 0.4 × 1.0 m³、流体粒子の体積は 5.0 × 0.4 × 0.6 m³ です。容器の右側の面を 16,200 枚の三角形ポリゴンで表し、ほかの面は、それぞれ 2 枚の三角形ポリゴンで表します。
  • ダムブレイク問題(図 7):静水圧問題と同じ直方体の容器に、ダムの形に流体粒子を置きます。流体粒子の体積は 1.0 × 0.4 × 1.0 m³ です。流体粒子は、やがて体積 0.5 × 0.2 × 0.6 m³ の剛体の構造物に衝突します。構造物の面のうち、流体粒子に面した面に 16,200 枚の三角形ポリゴンを置き、残りの面は、それぞれ 2 枚のポリゴンで表します。
静水圧問題の設定
図 6 静水圧問題の設定。出典:原論文 Fig. 16(© 2019 Japan Society for Simulation Technology)。
ダムブレイク問題の設定
図 7 ダムブレイク問題の設定。出典:原論文 Fig. 17(© 2019 Japan Society for Simulation Technology)。

動的負荷分散のテスト

提案するアルゴリズムが、特定の PE の計算負荷を、従来のアルゴリズムに比べてどれだけ減らせるかを調べました。テストは、4 つの PE を持つ Intel Core i5-650 のローカルの計算機で、4 つの PE を使って行いました。解析の条件は次のとおりです(原論文 Table 1)。

条件 静水圧問題 ダムブレイク問題
粒子数 76,800 25,600
解析する時間 1.5×10−11.5 \times 10^{-1} s 4.0×10−14.0 \times 10^{-1} s
時間刻み 1.0×10−41.0 \times 10^{-4} s 1.0×10−41.0 \times 10^{-4} s
粒子間距離 2.5×10−22.5 \times 10^{-2} m 2.5×10−22.5 \times 10^{-2} m
動粘性係数 1.0×10−61.0 \times 10^{-6} m²/s 1.0×10−61.0 \times 10^{-6} m²/s
流体の密度 1.0×1031.0 \times 10^{3} kg/m³ 1.0×1031.0 \times 10^{3} kg/m³
影響半径 3.1×10−23.1 \times 10^{-2} m 3.1×10−23.1 \times 10^{-2} m
重力 -9.81 m/s² -9.81 m/s²

PE ごとの計算時間を、図 8 に示します。

動的負荷分散のテストの結果
図 8 動的負荷分散のテストの結果(PE ごとの計算時間)。左:静水圧問題、右:ダムブレイク問題。Original は従来のアルゴリズム、Proposed は提案するアルゴリズムで、縦軸の計算時間は、EMPS と ERP の計算に要った時間の合計です。出典:原論文 Fig. 18(左)と Fig. 19(右)(© 2019 Japan Society for Simulation Technology)。原論文で横に並んでいる 2 つの図を、並びのまま 1 枚に切り出しています。

静水圧問題の結果は、次のとおりです。

  • 領域の再分割の回数は、従来のアルゴリズムが 0 回、提案するアルゴリズムが 1 回でした。
  • 従来のアルゴリズムでは、PE3 の計算時間が最も長くなりました。論文は、PE3 が担当する領域で、ERP の計算が計算コストを増やすためと説明しています。解析全体(EMPS と ERP の計算、PE の間の通信、入出力などを含む)には 2,470 s かかりました。
  • 提案するアルゴリズムでは、PE3 の計算時間が減り、すべての PE の計算時間がほぼ同じになりました。解析全体にかかった時間は 1,753 s で、従来のアルゴリズムより 717 s 短くなりました。
  • 図 9 は、4 つの PE による最初の領域分割です。従来のアルゴリズムは再分割をしないので、解析の間、この分割のままです。図 10 は、提案するアルゴリズムが 2 ステップ目に行った再分割の結果で、赤の領域(PE3 が担当する領域)が小さくなっています。論文は、ERP の計算に要る計算コストがほかの領域よりずっと大きくなるので、提案するアルゴリズムが PE3 の赤の領域の粒子を減らしたと説明しています。
静水圧問題の、4 つの PE による最初の領域分割
図 9 静水圧問題の、4 つの PE による最初の領域分割。PE0 は緑、PE1 は青、PE2 は黄、PE3 は赤です。出典:原論文 Fig. 20(© 2019 Japan Society for Simulation Technology)。
静水圧問題の、提案するアルゴリズムによる再分割の結果
図 10 静水圧問題の、提案するアルゴリズムによる領域の再分割の結果。出典:原論文 Fig. 21(© 2019 Japan Society for Simulation Technology)。

ダムブレイク問題の結果は、次のとおりです。

  • 領域の再分割の回数は、従来のアルゴリズムが 0 回、提案するアルゴリズムが 4 回でした。
  • 従来のアルゴリズムでは、静水圧問題と同じく、PE3 の計算時間が最も長くなりました。PE の間で計算負荷が釣り合わないため、解析には 3,508 s かかりました。
  • 提案するアルゴリズムは、PE3 の計算コストを減らし、EMPS と ERP の計算を残りの PE に配ります。解析にかかった時間は 2,874 s で、従来のアルゴリズムより 634 s 短くなりました。
  • 論文は、この問題では提案するアルゴリズムの効果が小さくなると述べ、その理由を、容器の中に偏って置かれたダムの形の流体粒子が、静水圧問題の静止した流体粒子と違って、剛体の構造物に向かって動いていくためと説明しています。

強スケーリングのテスト

強スケーリングは、問題の大きさを固定したときに、計算時間が PE の数によってどう変わるかを測るものです。pp 個の PE を使うときの強スケーリング効率 EpE_p を、次の式で計算します。

Ep=2t2p tp(19)E_p = \frac{2 t_2}{p\, t_p} \tag{19}

ここで、tpt_p は pp 個の PE を使うときの計算時間で、t2t_2 は 2 個の PE を使うときの計算時間です。式 (16)〜(18) の pp は PE の番号でしたが、式 (19) の pp は PE の数です。論文は、HDDM_EMPS は少なくとも 2 つの PE でプログラムを実行する必要があると注記しています。

テストは、スーパーコンピュータ PRIMEHPC FX100(FX100。1 ノードあたり 32 個の PE を持つ SPARC64 XIfx)で、2、4、16、32、48 個の PE を使って行いました。粒子数は、静水圧問題が 392,196、ダムブレイク問題が 400,000 です(原論文 Table 2)。

静水圧問題の結果は、次のとおりです。

  • 従来のアルゴリズムの強スケーリング効率は、48 個の PE で 14.0 % でした。2、4、16、32、48 個の PE での平均は、約 43.6 % でした。
  • 論文は、静的な問題で、提案するアルゴリズムのほうが並列化の効率が高いと述べています。

ダムブレイク問題の結果は、次のとおりです(図 11)。

ダムブレイク問題の強スケーリング効率
図 11 ダムブレイク問題の強スケーリング効率。横軸は PE の数です。Original は従来のアルゴリズム、Proposed は提案するアルゴリズムです。出典:原論文 Fig. 23(© 2019 Japan Society for Simulation Technology)。
  • 提案するアルゴリズムの強スケーリング効率は、48 個の PE で 78.0 % でした。従来のアルゴリズムは、同じ PE の数で 36.0 % でした。
  • 2、4、16、32、48 個の PE での平均は、提案するアルゴリズムが約 88.2 %、従来のアルゴリズムが約 68.0 % でした。
  • 論文は、動的な問題でも、提案するアルゴリズムのほうが並列化の効率が高いと述べています。

今後の展開

論文は、今後の計画として、スーパーコンピュータでの津波の挙動の解析を挙げています。本研究で使ったのは、最大で約 400,000 個の粒子と 48 個の PE です。論文は、津波の解析を、より正確に、より短い時間で行うには、さらに多くの粒子と PE が必要になると見込んでいます。

Graphical abstract
Graphical abstract

Overview

Particle methods are regarded as one of the most effective techniques for analyzing free-surface flows such as tsunamis. Among them, the Explicit Moving Particle Simulation (EMPS) method, which computes all the terms of the Navier–Stokes equations explicitly, can be parallelized more easily than the MPS method, which solves the pressure term implicitly. HDDM_EMPS, a parallel free-surface flow analysis system based on the EMPS method, has so far used the wall-particle boundary model, in which walls are represented by particles. The Explicitly Represented Polygon (ERP) wall boundary model, in which walls are represented by polygons, needs no virtual particles, but it was available only for two-dimensional analysis domains. In addition, the ERP wall boundary model requires extra computation for particles located close to polygons. Therefore, the conventional domain decomposition, which gives each processing element (PE) the same number of particles, may concentrate the computational load on a certain PE when polygons are allocated asymmetrically.

This paper extends the ERP wall boundary model to three dimensions, incorporates it into HDDM_EMPS, and proposes a time-based dynamic load balancing algorithm as a domain decomposition method suited to this model. The algorithm stores, in each particle, the time taken for the EMPS and ERP computations, uses it as a weight, and decomposes the analysis domain so that the calculation times of the PEs become nearly equal. Whether to repartition the domain is also judged by the imbalance of the calculation time among the PEs. Dynamic load balancing tests and strong scaling tests with a hydrostatic pressure problem and a dam break problem show that the proposed algorithm analyzes the problems with less computational cost and has higher parallel efficiency than the conventional algorithm based on the number of particles.

Key points

1. Extending the ERP wall boundary model to three dimensions and incorporating it into the parallel analysis system HDDM_EMPS

The ERP wall boundary model (Mitsume et al.) is a polygon-wall boundary model for the EMPS method. It assumes that the force from particle ii acts only on the point xiwall\boldsymbol{x}_i^{\mathrm{wall}} of a polygon wall nearest to particle ii, and it uses the mirror particle approach to fulfill the pressure Neumann boundary condition and the slip or no-slip boundary condition on walls. It needs no virtual particles. The paper states that this model has the potential to treat arbitrarily shaped triangular polygons as wall boundaries and to reduce the computational cost for planar walls compared with the wall-particle boundary model.

HDDM_EMPS (Murotani et al.) is a system that analyzes free-surface flows by the EMPS method on parallel computers. It encloses the analysis domain in a bounding box, stores the particles in buckets placed in the box, and decomposes the domain into the parts assigned to the PEs with the graph partitioning library ParMETIS. HDDM_EMPS has so far used the wall-particle boundary model, and the ERP wall boundary model was available only for two-dimensional analysis domains. This paper extends the ERP wall boundary model to three-dimensional analysis domains and incorporates it into HDDM_EMPS. As advantages over the use of the wall-particle boundary model, the paper lists the ability to express complicated-shaped boundaries and the simulation of free-surface flows with less computational time. The ERP computation is carried out in the following steps (Figure 1).

  • (a) Locate a global bounding box that encloses an arbitrary number of polygons.
  • (b) Allocate a local bounding box inside the global bounding box. The length of the local bounding box in each of the three directions is the effective radius used for the neighboring particle search in the EMPS method.
  • (c) Filter whether each particle is used for the ERP computation. Only particle ii inside the local bounding box is used to compute the nearest point xiwall\boldsymbol{x}_i^{\mathrm{wall}}.
  • (d) Repeat (b) and (c) for each node and each particle.

Step (b) is skipped when there is no fluid particle inside the global bounding box.

Schematic of steps (a), (b) and (c) of the ERP computation
Figure 1. Schematic of the steps of the ERP computation. From left to right: steps (a), (b) and (c). The pink dashed line is the global bounding box, the orange dashed line is the local bounding box, the gray dots are the nodes of the polygons, the blue circles are fluid particles, and the yellow circle is particle ii used for the ERP computation. Source: Fig. 6 (left), Fig. 7 (center) and Fig. 8 (right) of the original paper (© 2019 Japan Society for Simulation Technology). The three figures, which are placed side by side in the original paper, are cropped as one image in the same arrangement.

The paper states that the computational time of these steps increases as the number of polygons becomes greater, and that, if the polygons are allocated asymmetrically in the analysis domain, the computational load may become unbalanced among the PEs (a dynamic load balancing problem).

2. The conventional domain decomposition, which equalizes the number of particles, does not equalize the computational load of the PEs

HDDM_EMPS decomposes the domain with the ParMETIS routine ParMETIS_V3_PartGeomKway. This routine conducts a k-way partitioning of the analysis domain based on the weights of vertices and edges. HDDM_EMPS regards the particles as vertices, modifies the weights of the vertices (the weights of the edges are not changed), and partitions the analysis domain based on the allocation of the particles to the PEs. The paper states that, unless these weights are adjusted appropriately, the computational load becomes unbalanced among the PEs and the efficiency of parallel computing decreases.

The conventional distributed memory parallel algorithm (Murotani et al.) distributes the particles so that each PE holds almost the same number of particles. Figure 2 is an example in which an analysis domain with the wall-particle boundary model is divided among three PEs. The total number of particles is 45, and the 15 particles placed vertically on the right edge represent a wall. This algorithm sends 15 particles to each PE.

Schematic of the domain decomposition by the conventional algorithm with the wall-particle boundary model
Figure 2. Schematic of the domain decomposition by the conventional algorithm with the wall-particle boundary model. Each of the three PEs (PE0 in the green frame, PE1 in the red frame and PE2 in the brown frame) holds 15 particles. Source: Fig. 9 of the original paper (© 2019 Japan Society for Simulation Technology).

The ERP wall boundary model needs no particles to represent walls. Instead, it needs to detect the particles located close to each polygon wall and to obtain a pressure value from the nearest particle among them. The left of Figure 3 is an example in which the same analysis domain is represented with the ERP wall boundary model. The total number of particles becomes 30, and the four yellow particles are the particles used for the ERP computation. The conventional algorithm does not differentiate the yellow particles from the others and sends 10 particles to each PE based only on the number of particles. The paper points out that the computational load of a certain PE can become larger than that of the other PEs, because the yellow particles take more computational cost than the blue ones. The right of Figure 3 is the decomposition by the proposed algorithm, which is described in the next item.

Schematic of the domain decomposition by the conventional algorithm and by the proposed algorithm with the ERP wall boundary model
Figure 3. Schematic of the domain decomposition with the ERP wall boundary model. Left: conventional algorithm. Each of the three PEs holds 10 particles. Right: proposed algorithm. T0T_0, T1T_1 and T2T_2 in the figure are the times taken in PE0, PE1 and PE2. The yellow circles are the particles used for the ERP computation. Source: Fig. 10 (left) and Fig. 11 (right) of the original paper (© 2019 Japan Society for Simulation Technology). The two figures, which are placed side by side in the original paper, are cropped as one image in the same arrangement.

3. Decomposing the domain with the calculation time of each particle as the weight

The proposed time-based dynamic load balancing algorithm differentiates the particles used for the ERP computation (the yellow particles in the left of Figure 3) from the other particles (the blue particles) by the time taken for the EMPS and ERP computations. Since additional computation is required to fulfill the boundary condition on polygon walls, the algorithm gives each particle a weight corresponding to its calculation time and decomposes the analysis domain based on the calculation time. The calculation time TpT_p of the ppth PE is measured every time step as

Tp=∑i=0npfluidtifluid+∑i=0npERPtiERP(16)T_p = \sum_{i=0}^{n_p^{\mathrm{fluid}}} t_i^{\mathrm{fluid}} + \sum_{i=0}^{n_p^{\mathrm{ERP}}} t_i^{\mathrm{ERP}} \tag{16}

Here, npfluidn_p^{\mathrm{fluid}} is the number of particles in the ppth PE that are not used for the ERP computation, and npERPn_p^{\mathrm{ERP}} is the number of particles used for the ERP computation. tifluidt_i^{\mathrm{fluid}} is the calculation time stored in each particle that is not used for the ERP computation, tiERPt_i^{\mathrm{ERP}} is the calculation time stored in each particle used for the ERP computation, and ii is the index of a particle.

The algorithm allocates the particles so that TpT_p becomes almost the same among the PEs. The right of Figure 3 is an example in which the same analysis domain as in the left is decomposed by the proposed algorithm. The total number of particles is 30 and the yellow particles used for the ERP computation are the same, but PE0, PE1 and PE2 hold 13, 8 and 9 particles, respectively. The number of particles is not the same among the PEs, because the particles are allocated based on the time required for the EMPS and ERP computations.

Because the calculation time stored in each particle is obtained in the previous time step, the number of particles is exceptionally used as the weight only at the very first step. For this reason, a domain repartition always occurs at the 2nd step.

4. Domain repartition is also judged by the imbalance of the calculation time

When the amount of computation becomes unbalanced among the PEs during an analysis, the analysis domain has to be repartitioned. The paper explains that static problems such as the hydrostatic pressure problem usually need no repartition because the analysis domain does not move from the first configuration, whereas dynamic problems such as the dam break problem may need repartitions because the analysis domain changes dynamically and affects the load balance.

The conventional algorithm repartitions the domain based on the number of particles when the following inequality is satisfied:

c<Np×max⁡0≤p≤Np−1np∑p=0Np−1np(17)c < \frac{N_p \times \max_{0 \leq p \leq N_p - 1} n_p}{\sum_{p=0}^{N_p - 1} n_p} \tag{17}

Here, cc is a threshold greater than 1.0, NpN_p is the total number of PEs, and npn_p is the total number of particles in the ppth PE. The paper states that the timing of repartitions varies with the value of cc, because the right-hand side of Eq. (17) always becomes larger than 1.0.

The proposed algorithm repartitions the domain based on the calculation time stored in the particles when the following inequality is satisfied:

c<Np×max⁡0≤p≤Np−1Tp∑p=0Np−1Tp(18)c < \frac{N_p \times \max_{0 \leq p \leq N_p - 1} T_p}{\sum_{p=0}^{N_p - 1} T_p} \tag{18}

Figure 4 shows an example of the timing of repartitions for the dam break problem. With the conventional algorithm and cc set to 1.05, the right-hand side of Eq. (17) exceeded the threshold at the 65th and 66th steps, and a repartition was executed at each of these steps (left). With the proposed algorithm and cc set to 1.5, the right-hand side of Eq. (18) exceeded the threshold at the 21st, 27th and 71st steps (right). The paper explains that the lines in the right figure are zigzag because the calculation time of each PE varies from time step to time step. In the numerical experiments below, cc is set to 1.5 for both Eq. (17) and Eq. (18).

Transition of the number of particles and of the calculation time of each PE in the dam break problem
Figure 4. Example of the timing of repartitions for the dam break problem. Left: transition of the number of particles of each PE with the conventional algorithm (cc is 1.05). Right: transition of the calculation time of each PE with the proposed algorithm (cc is 1.5). The horizontal axis is the time step. Source: Fig. 12 (left) and Fig. 13 (right) of the original paper (© 2019 Japan Society for Simulation Technology). The two figures, which are placed side by side in the original paper, are cropped as one image in the same arrangement.

Numerical results

Relationship between the number of polygons and the calculation time (hydrostatic pressure problem)

Using the hydrostatic pressure problem (next subsection), the time required for the EMPS and ERP computations was examined for each PE while changing the number of polygons (Figure 5). In this problem, only the proposed algorithm repartitions the analysis domain, once at the 2nd step as the exceptional execution.

Relationship between the number of polygons and the calculation time of each PE
Figure 5. Relationship between the number of polygons and the calculation time of each PE in the hydrostatic pressure problem. Left: conventional algorithm. Right: proposed algorithm. Source: Fig. 14 (left) and Fig. 15 (right) of the original paper (© 2019 Japan Society for Simulation Technology). The two figures, which are placed side by side in the original paper, are cropped as one image in the same arrangement.
  • With the conventional algorithm, only the computational load of PE3 increased as the number of polygons became greater.
  • The paper states that the proposed algorithm solves this imbalance of the load and decreases the time required for the EMPS and ERP computations.

Problems analyzed

To confirm the dynamic load balancing and the strong scaling efficiency, a hydrostatic pressure problem was used as a static problem and a dam break problem as a dynamic problem. The triangular polygons are allocated asymmetrically to cause an imbalance of the computational load among the PEs intentionally.

  • Hydrostatic pressure problem (Figure 6): static fluid particles are placed in a cuboid container. The volume of the container is 5.0 × 0.4 × 1.0 m³, and that of the fluid particles is 5.0 × 0.4 × 0.6 m³. The surface on the right side of the container is represented by 16,200 triangular polygons, and each of the other surfaces is represented by 2 triangular polygons.
  • Dam break problem (Figure 7): fluid particles are placed in the shape of a dam in the same cuboid container as in the hydrostatic pressure problem. The volume of the fluid particles is 1.0 × 0.4 × 1.0 m³. The fluid particles eventually impact on a rigid structure whose volume is 0.5 × 0.2 × 0.6 m³. Among the surfaces of the structure, 16,200 triangular polygons are placed on the surface facing the fluid particles, and each of the remaining surfaces is represented by 2 polygons.
Configuration of the hydrostatic pressure problem
Figure 6. Configuration of the hydrostatic pressure problem. Source: Fig. 16 of the original paper (© 2019 Japan Society for Simulation Technology).
Configuration of the dam break problem
Figure 7. Configuration of the dam break problem. Source: Fig. 17 of the original paper (© 2019 Japan Society for Simulation Technology).

Dynamic load balancing tests

These tests examined how much the proposed algorithm can reduce the computational load of certain PEs compared with the conventional algorithm. The tests were conducted with four PEs on a local machine with an Intel Core i5-650, which has four PEs. The conditions of the analyses are as follows (Table 1 of the original paper).

Conditions Hydrostatic pressure problem Dam break problem
Number of particles 76,800 25,600
Simulation time 1.5×10−11.5 \times 10^{-1} s 4.0×10−14.0 \times 10^{-1} s
Time step 1.0×10−41.0 \times 10^{-4} s 1.0×10−41.0 \times 10^{-4} s
Particle distance 2.5×10−22.5 \times 10^{-2} m 2.5×10−22.5 \times 10^{-2} m
Kinematic viscosity 1.0×10−61.0 \times 10^{-6} m²/s 1.0×10−61.0 \times 10^{-6} m²/s
Fluid density 1.0×1031.0 \times 10^{3} kg/m³ 1.0×1031.0 \times 10^{3} kg/m³
Effective radius 3.1×10−23.1 \times 10^{-2} m 3.1×10−23.1 \times 10^{-2} m
Gravity -9.81 m/s² -9.81 m/s²

Figure 8 shows the calculation time of each PE.

Results of the dynamic load balancing tests
Figure 8. Results of the dynamic load balancing tests (calculation time of each PE). Left: hydrostatic pressure problem. Right: dam break problem. Original is the conventional algorithm and Proposed is the proposed algorithm; the calculation time on the vertical axis is the total time required for the EMPS and ERP computations. Source: Fig. 18 (left) and Fig. 19 (right) of the original paper (© 2019 Japan Society for Simulation Technology). The two figures, which are placed side by side in the original paper, are cropped as one image in the same arrangement.

The results for the hydrostatic pressure problem are as follows.

  • The number of domain repartitions was 0 with the conventional algorithm and 1 with the proposed algorithm.
  • With the conventional algorithm, the calculation time of PE3 was the longest. The paper explains that this is because the ERP computation increases the computational cost in the domain in charge of PE3. The whole execution (including the EMPS and ERP computations, the communication between the PEs, input/output and so forth) took 2,470 s.
  • With the proposed algorithm, the calculation time of PE3 decreased, and all the PEs had almost the same calculation time. The whole execution took 1,753 s, which is 717 s shorter than with the conventional algorithm.
  • Figure 9 shows the initial domain decomposition with four PEs. Since the conventional algorithm does not repartition the domain, this decomposition remains during the whole analysis. Figure 10 shows the result of the repartition conducted by the proposed algorithm at the 2nd step, in which the red domain (the domain in charge of PE3) becomes smaller. The paper explains that the proposed algorithm decreased the number of particles in the red domain of PE3 because the computational cost required for the ERP computation becomes much larger there than in the other domains.
Initial domain decomposition of the hydrostatic pressure problem with four PEs
Figure 9. Initial domain decomposition of the hydrostatic pressure problem with four PEs. PE0 is green, PE1 is blue, PE2 is yellow and PE3 is red. Source: Fig. 20 of the original paper (© 2019 Japan Society for Simulation Technology).
Result of the repartition of the hydrostatic pressure problem by the proposed algorithm
Figure 10. Result of the domain repartition of the hydrostatic pressure problem by the proposed algorithm. Source: Fig. 21 of the original paper (© 2019 Japan Society for Simulation Technology).

The results for the dam break problem are as follows.

  • The number of domain repartitions was 0 with the conventional algorithm and 4 with the proposed algorithm.
  • With the conventional algorithm, the calculation time of PE3 was the longest, as in the hydrostatic pressure problem. Because the computational load was unbalanced among the PEs, the analysis took 3,508 s.
  • The proposed algorithm decreases the computational cost of PE3 and distributes the EMPS and ERP computations to the remaining PEs. The analysis took 2,874 s, which is 634 s shorter than with the conventional algorithm.
  • The paper states that the effect of the proposed algorithm becomes smaller in this problem, and explains that this is because the fluid particles placed asymmetrically in the container in the shape of a dam move toward the rigid structure, unlike the static fluid particles of the hydrostatic pressure problem.

Strong scaling tests

Strong scaling measures how the computational time varies with the number of PEs for a fixed problem size. The strong scaling efficiency EpE_p with pp PEs is calculated as

Ep=2t2p tp(19)E_p = \frac{2 t_2}{p\, t_p} \tag{19}

Here, tpt_p is the computational time with pp PEs, and t2t_2 is the computational time with 2 PEs. While pp in Eqs. (16)–(18) is the index of a PE, pp in Eq. (19) is the number of PEs. The paper notes that HDDM_EMPS needs to execute programs with at least two PEs.

The tests were conducted with 2, 4, 16, 32 and 48 PEs on the supercomputer PRIMEHPC FX100 (FX100; SPARC64 XIfx with 32 PEs per node). The number of particles is 392,196 for the hydrostatic pressure problem and 400,000 for the dam break problem (Table 2 of the original paper).

The results for the hydrostatic pressure problem are as follows.

  • The strong scaling efficiency of the conventional algorithm was 14.0 % with 48 PEs. Its average over 2, 4, 16, 32 and 48 PEs was about 43.6 %.
  • The paper states that the proposed algorithm has higher parallel efficiency for the static problem.

The results for the dam break problem are as follows (Figure 11).

Strong scaling efficiency for the dam break problem
Figure 11. Strong scaling efficiency for the dam break problem. The horizontal axis is the number of PEs. Original is the conventional algorithm and Proposed is the proposed algorithm. Source: Fig. 23 of the original paper (© 2019 Japan Society for Simulation Technology).
  • The strong scaling efficiency of the proposed algorithm was 78.0 % with 48 PEs. That of the conventional algorithm was 36.0 % with the same number of PEs.
  • The average over 2, 4, 16, 32 and 48 PEs was about 88.2 % for the proposed algorithm and about 68.0 % for the conventional algorithm.
  • The paper states that the proposed algorithm has higher parallel efficiency for the dynamic problem as well.

Outlook

As a future plan, the paper mentions the analysis of tsunami behaviors on supercomputers. This study used approximately 400,000 particles and 48 PEs at maximum. The paper estimates that more particles and PEs will be required to analyze tsunamis more accurately and in a shorter time.