査読付き雑誌論文の一覧へ戻るBack to Peer-reviewed journal papers
Development of Hierarchical Domain Decomposition Explicit MPS Method and Application to Large-Scale Tsunami Analysis with Floating Objects
- 著者Authors
- K. Murotani†, S. Koshizuka, T. Tamai, K. Shibata, N. Mitsume, S. Yoshimura, S. Tanaka, K. Hasegawa, E. Nagai, T. Fujisawa
- 掲載先Published in
- Journal of Advanced Simulation in Science and EngineeringJournal of Advanced Simulation in Science and Engineering
- 巻号、ページVolume, pages
- Vol.1, No.1, pp.16–35
- 年Year
- 2014
- 種類Type
- 査読付き雑誌論文Peer-reviewed journal papers
- Link
- https://doi.org/10.15748/jasse.1.16
- 研究テーマTopics
- 粒子法Particle methods 連成解析Coupled analysis 大規模並列解析Large-scale parallel computing 津波・防災Tsunami and disaster mitigation 流体Fluid dynamics
- キーワードKeywords
- 階層型領域分割Hierarchical domain decomposition 陽的 MPS 法Explicit MPS method 大規模津波解析Large-scale tsunami analysis 浮遊物Floating objects MPS 法MPS 分散メモリ型並列計算Distributed memory parallel computing 陽的アルゴリズムExplicit algorithm ParMETISParMETIS 津波Tsunami バケットによる粒子データの管理Particle data management by buckets
- 備考Note
- 日本シミュレーション学会 Best Paper Award 受賞
概要
粒子法は、連続体を粒子の集まりとみなし、微分方程式で表される物理法則を粒子の間の相互作用で離散化して、粒子の状態と運動を計算する手法です。計算点である粒子が時間とともに動くので、自由表面や大変形のような動的な現象を、格子を使う手法より扱いやすい一方で、粒子が動くことが、分散メモリ型の並列計算機での並列化を難しくしています。論文は、これまでの粒子法の分散メモリ型の並列化には、多数のプロセッシングエレメント(PE)で十分な性能が得られていないものや、並列化の効率のような相対的な値だけを示し、達成した FLOPS を示していないものがあると指摘しています。
本論文は、陽的 MPS(moving particle simulation)法のための、新しい分散メモリ型の並列アルゴリズムを示しています。解析領域をバケットで区切り、グラフ分割のライブラリ ParMETIS で PE に分割する既存の方法(バケットを単位とする 1 階層の領域分割による、陽的な粒子法の分散並列計算)に対して、2 階層の領域分割と、バケットによる粒子データの管理の 2 点を改良しました。東京大学の FX10 で、理想的な粒子の配置と領域分割の下、12 から 4800 の PE への強スケーリング効率は 0.823 と 0.931、弱スケーリング効率は 0.952 と 0.957、4800 PE でのピーク性能比は 3.810 % と 7.246 % でした(影響半径を粒子間距離の 2.0 倍と 4.0 倍にした場合)。さらに、東日本大震災の津波で直径 10 m の 2 基のタンクが運ばれた、石巻市の市街地の浸水を含む津波遡上解析に適用しています。
重要点
1. 陽的 MPS 法:圧力を状態方程式から陽的に求める
本論文の陽的 MPS 法は、Shakibaeinia らが、自由表面を持つ弱圧縮性の流れを解析するために提案した方法です。低いマッハ数(0.1〜0.2)の下で人工的な弱い圧縮性を導入することで、圧力を陽的に高速に計算でき、非圧縮性もよく近似できます。支配方程式は、圧力を求めるための状態方程式と、非圧縮性流れの Navier–Stokes 方程式です。
ここで、 は圧力、 は密度、 は音速、 は速度、 は流体の動粘性係数、 は重力、 は時間です。 は粒子とともに動きながら見た時間微分(物質微分)、 はラプラシアンです。
1 時間ステップの計算は、式 (1)、(2) を離散化した次の手順です。まず、粘性項と重力から仮の速度 を求め(式 (3))、それで粒子を動かして仮の位置 を求めます(式 (4))。ここで、 は粒子の位置、上付きの はそのステップでの仮の値です。次に、仮の位置での粒子数密度から、圧力を陽的に求めます。
ここで、上付きの は時間ステップの番号、下付きの は粒子の番号です。 は単位体積あたりの粒子の数(粒子数密度)で、 は初期の状態での単位体積あたりの粒子の数です。続いて、圧力の勾配から速度の修正量 を求めます。
ここで、 は時間増分です( の は、式 (2) のラプラシアンとは別の意味です)。角括弧 は、圧力の勾配を、粒子の間の相互作用で近似した離散的な演算子で計算したものです。最後に、 と で、速度と位置を更新します(式 (7)、(8))。
論文は、MPS 法の粒子の間の相互作用のモデルは、影響半径の中の粒子が格子状に規則正しく並ぶことを前提にしているので、境界を含む不規則な粒子の配置では精度が低くなるという Tamai らの指摘を挙げ、Tamai らが提案した、Taylor 展開に基づく任意の高次の一貫性を持つ空間の離散化を採用しています。
2. バケットを単位に領域を分割し、隣り合う PE とハローで粒子データを交換する
本論文の並列アルゴリズムは、バケットを単位とする 1 階層の領域分割による、陽的な粒子法の分散並列計算(Ferrari らの方法)を改良したものです。まず、解析領域の全体を囲む直方体(バウンディングボックス)を、立方体のバケットで埋め、すべての粒子をバケットに割り当てます。MPS 法では粒子の影響半径が決まっているので、バケットの幅は影響半径より大きくします。次に、各 PE の粒子数が等しくなるように、バケットを単位として領域を分割します。分割には、グラフ分割のライブラリ METIS と、その並列計算機版の ParMETIS を使います。バケットの一つ一つを頂点に、バケットの面を辺に対応させたグラフを作り、PE の間で粒子数をそろえるため、バケットの中の粒子数を頂点の重みにします。
分割した各領域は、境界から 1 バケットの幅だけ広げ、広げた領域の粒子も同じ PE に割り当てます。この 1 バケットの幅の領域を「ハロー」と呼びます。ハローの粒子データは、隣り合う PE の間の通信(ハロー交換)で一致させます(図 1)。ハロー交換は、1 時間ステップに 3 回、式 (4)、(5)、(8) の計算の後に行います。解析が進んで、領域の間で粒子数の偏りが生じたときは、METIS で領域を分割し直して、粒子数の釣り合いを取り戻します。

3. 2 階層の領域分割(Part と Subdomain)
改良の 1 つ目は、2 階層の領域分割です。解析領域を 2 段階で分割します(図 2)。第 1 階層の大きな単位を「Part」、Part をさらに分けた第 2 階層の小さな単位を「Subdomain」と呼びます。並列計算機では、1 つの Part を 1 つの PE に割り当て、各 Part を複数の Subdomain に分けます。Subdomain のループに OpenMP の動的スケジューリングを割り当てると、OpenMP が Subdomain の間の動的な負荷分散を自動で行います。

論文は、この改良の利点として、問題の単位が小さくなるのでデータの局所性が高まることと、Part を Subdomain に分ければ、並列化の難しい計算アルゴリズムも Subdomain ごとに自動で並列化できることを挙げています。
4. バケットごとに粒子データを並べ替え、メモリを直接アクセスする
改良の 2 つ目は、粒子データをバケットで管理することです。MPS 法では、影響半径の中にある粒子どうしの相互作用を計算します。影響半径の中の粒子を探すときは、対象の粒子が属するバケットを中心とする 3×3×3 個のバケットの粒子だけを探せば十分です。この探し方は、分子動力学のシミュレーションで、カットオフの距離の中の原子の組をすべて探す「セルリンクリスト」と同じものです。
従来の方法は、バケットごとの粒子番号の並びを片方向の連結リストで持ち、粒子データ(位置、速度、圧力など)の配列の順番は、解析の初めから終わりまで変えません。図 3 の (a) の例では、6 個の粒子を 4 つのバケットに割り当て、各バケットの最初の粒子番号を書いた配列 FirstIdxInBucket[4] = {0, 4, -1, 1}(-1 は空のバケット)と、各粒子から連結される粒子番号を書いた配列 NextIdx[6] = {2, 3, -1, 5, -1, -1}(-1 は、そのバケットにそれより先の粒子がないこと)を用意します。連結リストを通して粒子データを読むので、メモリの読み方は「間接アクセス(Indirect access)」になります。解析が進むと、メモリで隣り合う粒子データが、解析領域では遠く離れることが多くなり、粒子番号が 1 増えるだけで、粒子が属するバケットが前のバケットから遠く離れることがよくあります(図 4 の (a))。この場合、バケットのすべての粒子データを L1 キャッシュに読み込み直す必要があり、計算の効率が下がります。


本論文は、粒子番号をバケットに割り当てた後に、粒子データをバケットごとに並べ替えます(図 3 の (b))。バケットの中で並べる必要はなく、バケットの間の粒子番号の境目の位置を、NumParticleInBucket[5] = {0, 2, 3, 3, 6} のような配列で持てば十分です。n 番目のバケットの粒子データは NumParticleInBucket[n] から NumParticleInBucket[n+1]-1 までにあり(この n はバケットの番号で、式 (5) の粒子数密度 とは別です)、粒子データを直接読む「直接アクセス(Direct access)」になります。解析領域で隣り合う粒子がメモリでも隣り合って置かれるので、対象の粒子が同じバケットにとどまる間は、同じ近傍粒子のデータを、L1 キャッシュに読み込み直さずに使えます。対象の粒子が隣のバケットに移っても、粒子データの 3 分の 2 は L1 キャッシュに残ります(図 4 の (b))。
論文は、この直接アクセスによって、ソフトウェアパイプラインと SIMD のベクトル化がより有効になり、達成する FLOPS の向上に役立っていると述べています。
数値実験の結果
バケットごとの並べ替えの効果(ダムブレイク問題)
バケットごとに並べ替える前と後の計算時間を、ダムブレイク問題で比べました。解析領域は 1.0 m × 0.2 m × 0.6 m、水柱は 0.25 m × 0.2 m × 0.5 m、解析する時間は 1 秒です。影響半径 は、初期の粒子の間隔 の 2.1 倍です。九州大学の CX400 の 1 PE(16 スレッド)を使いました。 を 0.01 と 0.005 にした 2 つの場合を調べています。図 5 は、 を 0.005 にした場合(粒子数は 416,016)の、1 時間ステップあたりの計算時間の推移です。

- 赤の線(直接アクセス)の計算時間は、紫の線(間接アクセス)より短くなりました。緑と青の線の時間は、赤と紫の線よりずっと短くなりました。論文は、粒子データの並べ替えにかかる時間は、MPS の計算の全体に比べて小さいと述べています。
- 直接アクセスと間接アクセスの計算時間の差は、初めは大きくありませんが、解析が進むにつれて大きくなりました。論文は、その理由を、粒子は初めは座標の順に並んでいるが、解析が進むと入り混じり、メモリで隣り合う粒子が解析領域では遠く離れていくためと説明しています。
- 論文は、 が 0.01 と 0.005 の 2 つの場合について、解析の終わりには、直接アクセスと間接アクセスの計算時間の差が 1.5〜2.0 倍になると述べています。
計算時間の差の原因を調べるため、東京大学の FX10(SPARC64 IXfx。コアあたり 32 KB の L1 キャッシュを持つ)で、富士通のプロファイラを使って L1 キャッシュミス率を測りました。比べたのは、最も時間のかかる粒子の間の相互作用の計算(高次の微分スキームのモーメント行列を作る計算)です。多項式の次数 0 は、元の MPS 法のラプラシアンの演算子を使う場合です。結果は次のとおりです(原論文 Table 1。 は 0.005)。
| 影響半径 | 多項式の次数 | 計算時間(s):直接 | 計算時間(s):間接 | L1 キャッシュミス率(%):直接 | L1 キャッシュミス率(%):間接 |
|---|---|---|---|---|---|
| 0 | 0.530 | 1.501 | 8.584 | 34.240 | |
| 1 | 0.703 | 1.509 | 5.251 | 22.873 | |
| 2 | 1.186 | 2.048 | 2.328 | 9.937 | |
| 0 | 1.441 | 4.878 | 8.278 | 47.515 | |
| 1 | 2.213 | 5.154 | 3.531 | 23.797 | |
| 2 | 4.470 | 7.801 | 1.089 | 7.995 | |
| 3 | 10.760 | 14.584 | 0.351 | 2.467 |
計算時間は、1 時間ステップあたりの平均の計算時間(wall-clock time)です。
- 一般に、多項式の次数が低いほど、L1 キャッシュミス率は大きくなります。論文は、次数が低いと粒子データの再利用の割合が低く、次数が高いと再利用の割合が高くなるためと説明しています。
- 論文は、次数 0 では、間接アクセスの計算時間が直接アクセスの 3 倍になるが、次数が上がるにつれて差は小さくなると述べ、直接アクセスと間接アクセスの計算時間の差は L1 キャッシュミス率から生じていると結論づけています。
並列性能(強スケーリングと弱スケーリング)
論文は、開発の状況として、(a) 領域分割による動的負荷分散、(b) 隣り合う PE の間のハロー交換、(c) PE の中のチューニングによる高速化の 3 点を挙げ、(b) のハロー交換はほぼ完成したとしています。そこで、ハロー交換の並列性能を主に確かめるため、流体粒子だけの粒子モデルで並列性能を測りました。
計算機は東京大学の FX10(16 コアの SPARC64 IXfx 1.848 GHz の CPU を 1 つずつ持つ 4800 の PE と、6 次元メッシュ/トーラスの相互結合網「Tofu」を持つ)です。ハロー交換の理想的な条件を測るため、ParMETIS による領域分割ではなく、格子状の領域分割を使い、PE の数(12〜4800)ごとに決めた 3 次元の PE の配置(原論文 Table 2)に合わせて分割しました。粘性項(式 (3))は 2 次の多項式近似で、圧力勾配の項(式 (6))は 1 次の多項式近似で計算し、どちらも 1 次の精度の近似になります。
強スケーリング効率と弱スケーリング効率は、 個から 個の PE()について、それぞれ と で定義します。ここで、 と はそれぞれの PE の数での計算時間(wall-clock time)で、基準の は 12 です(この は PE の数で、式 (5) の粒子数密度 とは別です)。強スケーリングは、640 × 960 × 512 個の流体粒子を等間隔に並べた 314,572,800 粒子のモデルで、弱スケーリングは、PE あたり 32 × 64 × 32 個の流体粒子を等間隔に並べた 65,536 粒子のモデルで測りました。影響半径 は、粒子間距離 の 2.0 倍と 4.0 倍の 2 とおりです。


- 12 から 4800 の PE への強スケーリング効率は、 で 0.823、 で 0.931 でした。
- 弱スケーリング効率は、 で 0.952、 で 0.957 でした。
- 論文は、強スケーリングと弱スケーリングのどちらも高い性能を示したので、(b) のハロー交換の部分はほぼ完成したと述べています。
計算時間と、ピーク性能比(達成した FLOPS を理論ピーク性能で割ったもの)を、FX10 の富士通のプロファイラで測りました。 の結果は次のとおりです(原論文 Table 3)。
| 項目 | 12 PE:時間(s) | 12 PE:ピーク性能比(%) | 4800 PE:時間(s) | 4800 PE:ピーク性能比(%) |
|---|---|---|---|---|
| 計算の全体 | 0.138 | 3.898 | 0.146 | 3.810 |
| 粘性項 | 0.024 | 9.657 | 0.025 | 9.639 |
| 衝突(Collision) | 0.009 | 5.830 | 0.009 | 5.863 |
| 圧力 | 0.015 | 5.493 | 0.015 | 5.720 |
| 圧力勾配の項 | 0.033 | 5.154 | 0.034 | 5.137 |
| その他 | 0.058 | 0.062 |
の結果は次のとおりです(原論文 Table 4)。
| 項目 | 12 PE:時間(s) | 12 PE:ピーク性能比(%) | 4800 PE:時間(s) | 4800 PE:ピーク性能比(%) |
|---|---|---|---|---|
| 計算の全体 | 0.566 | 7.102 | 0.590 | 7.246 |
| 粘性項 | 0.150 | 11.214 | 0.159 | 10.993 |
| 衝突(Collision) | 0.053 | 7.474 | 0.060 | 7.086 |
| 圧力 | 0.087 | 7.278 | 0.096 | 7.056 |
| 圧力勾配の項 | 0.185 | 7.087 | 0.201 | 6.930 |
| その他 | 0.091 | 0.074 |
- 4800 PE でのピーク性能比は、 で 3.810 %、 で 7.246 % でした。
- 「その他」は、ハロー交換、通信のテーブルの作成、粒子のバケットへの割り当て、粒子データの並べ替えです。
- 論文は、粘性項は 2 次の多項式近似で計算するので粒子データの再利用が多く、ピーク性能比が高くなると説明しています。圧力勾配の項は、最小の圧力を求めるために近傍粒子のループを 2 回行うので、計算時間が最も長くなります。
- では、4800 PE の計算時間は 12 PE より長いものの、ピーク性能比は 4800 PE のほうが大きくなりました。論文は、4800 PE では 12 PE より内部のバケットの数が多く、ハローの領域が大きいので、MPS の計算の規模が大きくなるためと説明しています。
石巻市の津波遡上解析の条件
東日本大震災(2011 年 3 月 11 日)の津波で、直径 10 m の 2 基のタンクが運ばれた、石巻市の市街地の浸水などを解析しました。地表は国土地理院の 5 m 間隔の数値標高データから作り、海の深さは JTOPO30(1 km 間隔)から得て、川の深さは 10 m と仮定しました。3 次元の建物は、東日本大震災より前のデータから作りました。
海から陸までの範囲で浅水方程式を解くのは難しいので、石巻湾の沖約 1.5 km での浅水方程式の解を使います。石巻湾から市街地までを同じ粒子間距離で解くと、多くの粒子が必要になります。計算資源の都合で、最大で数千万〜数億の粒子の解析を対象とし、石巻湾と沿岸域(4.0 km × 3.5 km)の解析と、石巻市の市街地(400 m × 550 m)の解析に分けた、ズームアップ解析を行いました。
解析領域の境界には、流入と流出の境界条件を設定します(図 8)。流入境界では、解析領域の外に並べた壁粒子を、解析領域の内側に向けて動かします。壁粒子が解析領域に入ると流体粒子に変え、最も外側の壁粒子の後ろに新しい壁粒子を作ります。さらに、境界から の幅の範囲で、境界での水位より高い所にある粒子をすべて消します。これで、境界の付近の水位が一定になります。流出境界では、解析領域の外の壁粒子を止めておき、同じように粒子を消します。論文は、理想的には流出境界でも壁粒子を解析領域の外側へ動かすべきだが、その場合は最も外側の壁粒子の後ろに新しい壁粒子を作れないことと、津波の押し波と引き波が何度も起きて流入と流出がたびたび入れ替わることから、壁粒子をきれいに並べた状態に保つために、やむを得ずこの流出境界条件を採用したと説明しています。

石巻湾と沿岸域の津波遡上解析
石巻湾と沿岸域(4.0 km × 3.5 km)の津波遡上解析です。粒子間距離は 1.0 m です。音速は、マッハ数が 0.1 より小さくなるように 200 m/s とし、各時間ステップの時間増分は、クーラン数が 0.1 になるように決めました。東北大学の Tsunami Engineering Laboratory と KOKUSAI KOGYO CO., LTD. が提供した流入と流出のデータ(浅水方程式を解いた、東日本大震災のシミュレーションの結果)を、図 9 の下側(南側)の境界に設定し、ほかの辺には粒子の壁を置きました。圧力の境界条件は、自由表面で通常のディリクレ境界条件、ほかの境界で通常のノイマン境界条件を、陽的に設定しています。
FX10 の 96 PE で、800 秒の解析に約 7 日かかりました。最大の粒子数は 2 億 6 千万個、1 時間ステップの計算時間は平均 5.5 秒でした。

- 論文は、東日本大震災の津波は牡鹿半島の南から来たので、石巻湾には南東から北西へ向かって押し寄せたが、タンクは市街地を南西から北東へ運ばれたことが分かっていると述べています。その理由として、津波が石巻湾の防波堤で東へ向きを変えたことと、旧北上川を遡上して川からあふれたことを挙げています。
- 論文は、これらの現象を再現し(図 9 の (c) と、次の項の図 10 の (b))、詳しい 3 次元の地表のデータによって、市街地への津波の流れの向きを示せたと述べています。
石巻市の市街地での 2 基のタンクの漂流
石巻湾と沿岸域の解析から、市街地(400 m × 550 m)に絞り込んだズームアップ解析で、直径 10 m の 2 基のタンクが津波で運ばれた事象を解析しました。2 基のタンクは剛体とみなし、剛体と流体の相互作用を、Koshizuka らの方法による弱連成で解きます。この方法では、剛体を、相対的な配置を固定した粒子で表し、剛体の粒子も流体の粒子と同じ手順で計算します。剛体の並進と回転を剛体の粒子から求め、最後に、剛体の粒子の位置を剛体の運動で置き換えます。この研究では破壊の現象を扱わないので、2 基のタンクの拘束は 60 秒で外すだけにしています。
市街地の境界条件は、沿岸域の解析の結果から、図 10 の (a) の赤い線に沿って作りました。市街地の境界線の上に等間隔に並べた格子点で、粒子のデータから補間した値を、流入と流出の条件に使います(図 10 の (b))。

粒子間距離は 0.5 m です。音速とクーラン数は、沿岸域の解析と同じ 200 m/s と 0.1 です。FX10 の 600 PE で、200 秒の解析に約 6 時間かかりました。最大の粒子数は 4 千万個、1 時間ステップの計算時間は平均 0.25 秒でした。

- 図 11 の (b) から、津波が大通りを南から北へ、県道を西から東へ遡上していることが分かります。
- 図 11 の (a)〜(d) は、建物の間に津波が急に流れ込むことで生じる縮流の現象を示しています。
- 図 11 の (c) と (d) では、2 基のタンクが高速で運ばれています。その向きは、震災の当日に 1 基のタンクが南西から北東へ運ばれた向きと同じでした。
- 論文は、タンクは解析領域の外へ出てしまうものの、詳しい 3 次元の建物のデータによって、市街地でのタンクの流れの向きを示せたと述べています。
今後の展開
論文は、開発を進めている 3 つの点のうち、(a) の領域分割による動的負荷分散を、最も重要で難しい問題に挙げています。現時点では、METIS で、PE の間の粒子数の差を約 5 % にできています。難しい問題の一つは、流体粒子と壁粒子の各 PE への配分です。壁粒子は式 (5) の圧力の計算だけに使われますが、全粒子の 30〜70 % を占めることが多く、すべての PE で粒子数が同じでも、流体粒子と壁粒子の割合は PE ごとに違うことがよくあります。論文は、流体粒子の計算コストは壁粒子よりずっと大きいので、計算コストの負荷の釣り合いを保つことが難しいと述べています。
Overview
A particle method regards a continuum as a set of particles, discretizes the physical laws expressed by differential equations through interactions between the particles, and computes the states and motions of the particles. Because the particles, which are the calculation points, move over time, particle methods handle dynamic phenomena such as free surfaces and large deformations more easily than grid-based methods; on the other hand, the motion of the particles makes parallelization on distributed memory parallel computers difficult. The paper points out that previous distributed memory parallelizations of particle methods either did not achieve sufficient performance with many processing elements (PEs) or reported only relative values such as parallel efficiency, not the achieved FLOPS.
This paper presents a new distributed memory parallel algorithm for the explicit moving particle simulation (MPS) method. Starting from an existing approach that divides the analysis domain into buckets and partitions it among PEs with the graph-partitioning library ParMETIS (distributed parallel computation of an explicit particle method with single-level, bucket-based domain decomposition), the paper makes two improvements: a two-level hierarchical domain decomposition and the management of particle data by buckets. On the FX10 at the University of Tokyo, with ideal particle arrangements and domain decompositions, the strong scaling efficiencies from 12 to 4800 PEs were 0.823 and 0.931, the weak scaling efficiencies were 0.952 and 0.957, and the performed efficiencies to peak with 4800 PEs were 3.810 % and 7.246 % (for influence radii of 2.0 and 4.0 times the particle spacing). The method was further applied to tsunami run-up analyses, including the inundation of the urban area of Ishinomaki City, where two 10-m diameter tanks were carried along by the tsunami of the Great East Japan Earthquake.
Key points
1. Explicit MPS method: pressure is computed explicitly from the equation of state
The explicit MPS method used in this paper was proposed by Shakibaeinia et al. for analyzing weakly compressible flows with a free surface. Introducing artificial weak compressibility under a low Mach number (0.1 to 0.2) allows a fast explicit calculation of pressure and a good approximation of incompressibility. The governing equations are the equation of state, used to obtain the pressure, and the Navier–Stokes equations for an incompressible flow.
Here, is the pressure, the density, the sound speed, the velocity, the kinematic viscosity coefficient of the fluid, the gravity, and the time. is the time derivative seen while moving with a particle (the material derivative), and is the Laplacian.
One time step consists of the following steps, which discretize Eqs. (1) and (2). First, a temporal velocity is obtained from the viscosity term and gravity (Eq. (3)), and the particles are moved with it to obtain temporal positions (Eq. (4)). Here, is the position of a particle, and the superscript denotes a temporal value in the step. Next, the pressure is computed explicitly from the particle number density at the temporal positions.
Here, the superscript is the time step number and the subscript is the particle number. is the number of particles in a unit volume (the particle number density), and is the number of particles in a unit volume in the initial state. Then, a velocity correction is obtained from the pressure gradient.
Here, is the time increment (the in has a different meaning from the Laplacian in Eq. (2)). The square brackets denote the pressure gradient computed with a discrete operator that approximates it through interactions between particles. Finally, the velocity and position are updated by and (Eqs. (7) and (8)).
The paper cites the remark by Tamai et al. that the particle interaction models of MPS assume that the particles within the influence radius are regularly arranged in a grid, so the accuracy is low for random particle distributions including boundaries; it adopts the spatial discretization with arbitrary high-order consistency based on a Taylor expansion proposed by Tamai et al.
2. The domain is decomposed by buckets, and neighboring PEs exchange particle data through halos
The parallel algorithm of this paper improves on the distributed parallel computation of an explicit particle method with single-level, bucket-based domain decomposition (the method of Ferrari et al.). First, the box bounding the whole analysis domain is filled with cubic buckets, and all particles are assigned to buckets. Because the influence radius of a particle is fixed in the MPS method, the bucket width must be larger than the influence radius. Next, the domain is decomposed bucket by bucket so that each PE has an equal number of particles. The decomposition uses the graph-partitioning library METIS and its parallel version, ParMETIS. A graph is made in which each bucket corresponds to a vertex and the faces of the buckets correspond to edges, and the number of particles in a bucket is used as the vertex weight so that the numbers of particles in the PEs are equal.
Each decomposed subdomain is expanded by one bucket width from its boundaries, and the particles in the expanded region are also assigned to the same PE. This region of one bucket width is called a "halo". The particle data in a halo are kept consistent by communication between neighboring PEs (halo exchange; Figure 1). Halo exchange is performed three times in one time step, after the calculations of Eqs. (4), (5), and (8). When the numbers of particles in the subdomains become unbalanced as the analysis progresses, the domain is decomposed again with METIS to recover the balance of the number of particles.

3. Two-level hierarchical domain decomposition (Parts and Subdomains)
The first improvement is the two-level hierarchical domain decomposition. The analysis domain is decomposed in two steps (Figure 2). The large unit of the first level is called a "Part", and the smaller unit of the second level, obtained by dividing a Part, is called a "Subdomain". In a parallel computer, one Part is assigned to one PE, and each Part is further divided into several Subdomains. When the dynamic scheduling of OpenMP is assigned to the loop over Subdomains, OpenMP automatically performs dynamic load balancing among the Subdomains.

The paper lists two advantages of this improvement: the locality of data increases because the units of the problem become smaller, and once a Part is divided into Subdomains, even calculation algorithms that are difficult to parallelize can be parallelized automatically over the Subdomains.
4. Particle data are rearranged by buckets, and memory is accessed directly
The second improvement is that particle data are managed by buckets. In the MPS method, the interactions between particles within the influence radius are computed. When searching for the particles within the influence radius, it is sufficient to search only the particles in the 3×3×3 buckets centered on the bucket to which the target particle belongs. This search is the same as the "cell linked lists" used in molecular dynamics simulations to search all atom pairs within a cut-off distance.
The conventional approach keeps the sequence of particle numbers in each bucket as a one-way linked list, and the order of the arrays of particle data (position, velocity, pressure, and so on) is not changed from the beginning to the end of the analysis. In the example of Figure 3 (a), six particles are assigned to four buckets, and two arrays are prepared: FirstIdxInBucket[4] = {0, 4, -1, 1}, which holds the first particle number in each bucket (-1 means an empty bucket), and NextIdx[6] = {2, 3, -1, 5, -1, -1}, which holds the particle number linked from each particle (-1 means that no further particle exists in the bucket). Because particle data are read through the linked list, memory reads become "Indirect access". As the analysis progresses, particle data that are neighbors in memory often become far apart in the analysis domain, and an increase of the particle number by one often moves the bucket to which the particle belongs far away from the previous bucket (Figure 4 (a)). In this case, all particle data in a bucket must be reloaded into the L1 cache, and the calculation becomes less efficient.


In this paper, after particle numbers are assigned to buckets, the particle data are rearranged by bucket (Figure 3 (b)). The particle data need not be sorted within each bucket; it is sufficient to keep the positions of the boundaries of particle numbers between buckets in an array such as NumParticleInBucket[5] = {0, 2, 3, 3, 6}. The particle data of bucket n lie from NumParticleInBucket[n] to NumParticleInBucket[n+1]-1 (this n is a bucket number and is different from the particle number density in Eq. (5)), so memory reads become "Direct access", which reads particle data directly. Because particles that are neighbors in the analysis domain are also stored next to each other in memory, the same neighboring-particle data can be used without reloading them into the L1 cache while the target particles remain in the same bucket. Even when the target particles move to a neighboring bucket, two-thirds of the particle data remain in the L1 cache (Figure 4 (b)).
The paper states that this direct access makes software pipelining and SIMD vectorization more effective, contributing to a higher achieved FLOPS.
Numerical results
Effect of rearrangement by bucket (dam break problem)
The calculation times before and after rearranging by bucket were compared on a dam break problem. The analysis domain is 1.0 m × 0.2 m × 0.6 m, the water column is 0.25 m × 0.2 m × 0.5 m, and the analyzed time is 1 second. The influence radius is 2.1 times the initial particle spacing . One PE (16 threads) of the CX400 at Kyushu University was used. Two cases, with of 0.01 and 0.005, were examined. Figure 5 shows the history of the calculation time per time step for of 0.005 (416,016 particles).

- The calculation time of the red line (Direct access) was shorter than that of the purple line (Indirect access). The times of the green and blue lines were much shorter than those of the red and purple lines. The paper states that the time for rearranging particle data is small compared with the total MPS calculation.
- The difference in calculation time between Direct access and Indirect access was not large at first but grew as the analysis progressed. The paper explains that the particles are initially arranged in the order of their coordinates but become mixed as the analysis progresses, so particles that are neighbors in memory become farther apart in the analysis domain.
- The paper states that, for the two cases with of 0.01 and 0.005, the difference in calculation time between Direct access and Indirect access at the end of the analysis is a factor of 1.5 to 2.0.
To investigate the cause of the difference in calculation time, the L1 cache miss rate was measured with a Fujitsu profiler on the FX10 at the University of Tokyo (SPARC64 IXfx, with a 32-KB L1 cache per core). The comparison was made for the particle-interaction calculation that takes the longest time (the calculation that generates the moment matrix of the higher-order derivative scheme). Polynomial order 0 corresponds to the Laplacian operator of the original MPS method. The results are as follows (Table 1 of the original paper; is 0.005).
| Influence radius | Polynomial order | Time (s): direct | Time (s): indirect | L1 cache miss rate (%): direct | L1 cache miss rate (%): indirect |
|---|---|---|---|---|---|
| 0 | 0.530 | 1.501 | 8.584 | 34.240 | |
| 1 | 0.703 | 1.509 | 5.251 | 22.873 | |
| 2 | 1.186 | 2.048 | 2.328 | 9.937 | |
| 0 | 1.441 | 4.878 | 8.278 | 47.515 | |
| 1 | 2.213 | 5.154 | 3.531 | 23.797 | |
| 2 | 4.470 | 7.801 | 1.089 | 7.995 | |
| 3 | 10.760 | 14.584 | 0.351 | 2.467 |
The time is the average calculation time (wall-clock time) per time step.
- In general, the lower the polynomial order, the larger the L1 cache miss rate. The paper explains that the reuse ratio of particle data is low for a low polynomial order and high for a high polynomial order.
- The paper states that, for polynomial order 0, the calculation time with Indirect access is three times that with Direct access, but the difference decreases as the polynomial order increases, and concludes that the difference in calculation time between Direct access and Indirect access stems from the L1 cache miss rate.
Parallel performance (strong and weak scaling)
As the status of development, the paper lists three points, (a) dynamic load balancing by domain decomposition, (b) halo exchange between neighboring PEs, and (c) speed-up by tuning within a PE, and states that the halo exchange of (b) has been mostly completed. Therefore, the parallel performance was measured with particle models consisting only of fluid particles, mainly to confirm the parallel performance of the halo exchange.
The computer is the FX10 at the University of Tokyo, which has 4800 PEs, each with one 16-core SPARC64 IXfx 1.848-GHz CPU, and the six-dimensional mesh/torus interconnect "Tofu". To measure an ideal condition for the halo exchange, a grid-like domain decomposition was used instead of the domain decomposition by ParMETIS, following the three-dimensional configuration of PEs defined for each number of PEs (12 to 4800; Table 2 of the original paper). The viscosity term (Eq. (3)) is computed with a second-order polynomial approximation and the pressure gradient term (Eq. (6)) with a first-order polynomial approximation, both resulting in first-order accurate approximations.
The strong and weak scaling efficiencies from to PEs () are defined as and , respectively. Here, and are the calculation times (wall-clock time) with the respective numbers of PEs, and the reference is 12 (this is a number of PEs and is different from the particle number density in Eq. (5)). Strong scaling was measured with a model of 314,572,800 particles, in which 640 × 960 × 512 fluid particles are arranged at equal distances, and weak scaling with a model of 65,536 particles per PE, in which 32 × 64 × 32 fluid particles are arranged at equal distances. Two influence radii were used: 2.0 and 4.0 times the particle spacing .


- The strong scaling efficiencies from 12 to 4800 PEs were 0.823 for and 0.931 for .
- The weak scaling efficiencies were 0.952 for and 0.957 for .
- The paper states that both strong and weak scaling showed high performance, and therefore the part of the halo exchange of (b) has been mostly completed.
The calculation time and the performed efficiency to peak (the achieved FLOPS divided by the theoretical peak performance) were measured with a Fujitsu profiler on the FX10. The results for are as follows (Table 3 of the original paper).
| Item | 12 PEs: time (s) | 12 PEs: efficiency to peak (%) | 4800 PEs: time (s) | 4800 PEs: efficiency to peak (%) |
|---|---|---|---|---|
| Total calculation time | 0.138 | 3.898 | 0.146 | 3.810 |
| Viscosity term | 0.024 | 9.657 | 0.025 | 9.639 |
| Collision | 0.009 | 5.830 | 0.009 | 5.863 |
| Pressure | 0.015 | 5.493 | 0.015 | 5.720 |
| Pressure gradient term | 0.033 | 5.154 | 0.034 | 5.137 |
| Other | 0.058 | 0.062 |
The results for are as follows (Table 4 of the original paper).
| Item | 12 PEs: time (s) | 12 PEs: efficiency to peak (%) | 4800 PEs: time (s) | 4800 PEs: efficiency to peak (%) |
|---|---|---|---|---|
| Total calculation time | 0.566 | 7.102 | 0.590 | 7.246 |
| Viscosity term | 0.150 | 11.214 | 0.159 | 10.993 |
| Collision | 0.053 | 7.474 | 0.060 | 7.086 |
| Pressure | 0.087 | 7.278 | 0.096 | 7.056 |
| Pressure gradient term | 0.185 | 7.087 | 0.201 | 6.930 |
| Other | 0.091 | 0.074 |
- The performed efficiencies to peak with 4800 PEs were 3.810 % for and 7.246 % for .
- "Other" consists of the halo exchange, the generation of communication tables, the assignment of particles to buckets, and the arrangement of particle data.
- The paper explains that the viscosity term, which is computed with a second-order polynomial approximation, reuses particle data heavily, so its performed efficiency to peak is high. The pressure gradient term takes the longest time because the loop over neighboring particles is performed twice to obtain the minimum pressure.
- For , although the calculation time with 4800 PEs was longer than with 12 PEs, the performed efficiency to peak was larger with 4800 PEs. The paper explains that, with 4800 PEs, the number of interior buckets is larger than with 12 PEs and the halo area is larger, so the size of the MPS calculation becomes larger.
Conditions of the tsunami run-up analysis for Ishinomaki City
The analyses covered events such as the inundation of the urban area of Ishinomaki City, where two 10-m diameter tanks were carried along by the tsunami of the Great East Japan Earthquake (March 11, 2011). The land surface was generated from 5-m spacing digital elevation data of the Geospatial Information Authority of Japan, the sea depth was obtained from JTOPO30 (1-km spacing), and the river depth was assumed to be 10 m. The three-dimensional buildings were generated from data prior to the Great East Japan Earthquake.
Because it is difficult to solve the shallow water equation over the area from the sea to dry land, solutions of the shallow water equation about 1.5 km off Ishinomaki bay are used. Solving the area from Ishinomaki bay to the urban area with the same particle spacing would require a large number of particles. Because of computational resources, analyses with up to tens of millions to hundreds of millions of particles were targeted, and a zoom-up analysis was performed, divided into an analysis of Ishinomaki bay and the coastal area (4.0 km × 3.5 km) and an analysis of the urban area of Ishinomaki City (400 m × 550 m).
Inflow and outflow boundary conditions are set on the boundaries of the analysis domain (Figure 8). At an inflow boundary, wall particles arranged outside the analysis domain are moved toward the inside of the analysis domain. When the wall particles enter the analysis domain, they are changed to fluid particles, and new wall particles are generated behind the outermost wall particles. In addition, all particles above the water height on the boundary within a width of from the boundary are deleted. This keeps the water height near the boundary constant. At an outflow boundary, the wall particles outside the analysis domain are kept static, and particles are deleted in the same way. The paper explains that, ideally, the wall particles should also be moved toward the outside of the analysis domain at an outflow boundary, but new wall particles cannot then be generated behind the outermost wall particles; moreover, because the incoming and receding waves of the tsunami occur several times, inflow and outflow are often switched. Therefore, this outflow boundary condition was reluctantly adopted to keep the wall particles neatly arranged.

Tsunami run-up analysis of Ishinomaki bay and the coastal area
This is the tsunami run-up analysis of Ishinomaki bay and the coastal area (4.0 km × 3.5 km). The particle spacing is 1.0 m. The sound speed was set to 200 m/s so that the Mach number is less than 0.1, and the time increment of each time step was determined so that the Courant number is 0.1. The inflow and outflow data provided by the Tsunami Engineering Laboratory of Tohoku University and KOKUSAI KOGYO CO., LTD. (results of a simulation of the Great East Japan Earthquake obtained by solving the shallow water equation) were set on the bottom (south) boundary in Figure 9, and particle walls were placed on the other sides. For pressure, the standard Dirichlet boundary condition on the free surface and the standard Neumann boundary condition on the other boundaries are set explicitly.
The analysis of 800 seconds took about 7 days with 96 PEs of the FX10. The maximum number of particles was 260 million, and the calculation time per time step was 5.5 seconds on average.

- The paper states that, because the tsunami of the Great East Japan Earthquake came from the south of the Ojika Peninsula, it struck Ishinomaki bay from southeast to northwest, whereas it is known that the tanks were carried from southwest to northeast in the urban area. As the reasons, it gives that the tsunami was turned east by the breakwaters in Ishinomaki bay and that it went upstream along the former Kitakami River and overflowed from the river.
- The paper states that these phenomena were reproduced (Figure 9 (c) and Figure 10 (b) in the next section) and that the flow direction of the tsunami toward the urban area was demonstrated by means of detailed three-dimensional land surface data.
Drift of two tanks in the urban area of Ishinomaki City
In a zoom-up analysis narrowed from the analysis of Ishinomaki bay and the coastal area to the urban area (400 m × 550 m), the event in which two 10-m diameter tanks were carried along by the tsunami was analyzed. The two tanks are regarded as rigid bodies, and the interplay between the rigid bodies and the fluid is solved by weak coupling with the method of Koshizuka et al. In this method, the rigid bodies are represented by particles with fixed relative configurations, and the rigid-body particles are calculated with the same procedure as the fluid particles. The translations and rotations of the rigid bodies are calculated from the rigid-body particles, and finally the positions of the rigid-body particles are replaced by the motions of the rigid bodies. Because fragmentation is not simulated in this study, the restraint of the two tanks is simply released at 60 seconds.
The boundary conditions for the urban area were generated from the results of the coastal analysis along the red lines in Figure 10 (a). Values interpolated from the particle data at grid points arranged at equal distances on the boundary lines of the urban area are used as the inflow and outflow conditions (Figure 10 (b)).

The particle spacing is 0.5 m. The sound speed and the Courant number are the same as in the coastal analysis, 200 m/s and 0.1. The analysis of 200 seconds took about 6 hours with 600 PEs of the FX10. The maximum number of particles was 40 million, and the calculation time per time step was 0.25 seconds on average.

- Figure 11 (b) shows that the tsunami runs up along an avenue from south to north and along a prefectural road from west to east.
- Figure 11 (a) to (d) show contracted flow phenomena generated by the rapid flooding of the tsunami among the buildings.
- In Figure 11 (c) and (d), the two tanks are carried along at high speed. Their direction was the same as that of one tank carried from southwest to northeast on the day of the earthquake.
- The paper states that, although the tanks move out of the analysis domain, the flow direction of the tanks in the urban area was demonstrated by using detailed three-dimensional building data.
Outlook
Of the three points under development, the paper identifies (a), dynamic load balancing by domain decomposition, as the most important and difficult problem. To date, the difference in the number of particles between PEs has been reduced to about 5 % with METIS. One of the most difficult problems is the distribution of fluid and wall particles to the PEs. The wall particles are used only for the pressure calculation of Eq. (5), but they often account for 30 % to 70 % of all particles, and even when all PEs have the same number of particles, the ratio of fluid to wall particles often differs among the PEs. The paper states that, because the calculation cost of fluid particles is much larger than that of wall particles, it is difficult to maintain the load balance of the calculation cost.