基盤技術構築Fundamental Technology

メタグラフによる超高忠実度・並列解析の一般化数理基盤

Generalized Mathematical Foundation for Ultra-High-Fidelity and Parallel Analysis via Metagraphs

研究概要

背景・動機

数値解析や力学シミュレーションが発達している昨今、対象とする問題は年々複雑化しており、その複雑問題を解析するためのプログラムも複雑化の一途を辿っています。これはあくまで大学の教育現場の視点になりますが、こういった問題を対象とした数値解析戦略の研究を実施しようとすると、プログラムの煩雑性がボトルネックとなり、修士学生の2年間ではまともに研究が成り行かない、といった事態が起きています。そこで我々は、データ分散型並列解析 (スーパーコンピュータなどを使用した並列解析) などの実装面で時間的コストがかかる対象に対し、計算点の相互作用をグラフとして記述できる事実に着目し、あらゆる数値解析手法を包括した一般的方法論とその可搬性の高いライブラリの開発を進めています。

計算点相互作用・疎行列構造・グラフ

数値解析手法は、各手法固有の「計算点の相互作用」 (微分等の演算子の計算方法) を持っています。また、すべての数値解析手法は最終的に連立一次方程式 (行列) に帰着します。(※ 非線形問題の場合は、Newton-Raphson 法などの非線形解法を適用した接線行列がこれに相当します。また、陽解法ではそうならない、という主張がありますが、「行列がたまたま対角行列である場合」と考えられます。)

この「計算点の相互作用」によって行列の疎構造 (どこに値が入り得て、どこが0であるか) が決定され、この行列をグラフ理論における隣接行列に変換することで、任意の数値解析の系を一意にグラフへと変換できます。

重み付きグラフ分割と幾何学的領域分割

前述のグラフに対し、各計算点ごとの計算時間や計算機間の通信時間などを重みとして設定することで重み付きグラフが定義できます。これに対して、何らか制約 (例: 並列計算であれば各領域の計算時間を均等にしたいので、各領域内の計算点の重みの合計 = 各領域の計算時間 を均等にするような制約) をもとにグラフを分割します。結果的に、計算点は空間的にグループ化された「領域」となり、領域分割がなされます。我々は、これらのグラフに関する演算と領域分割操作を、ライブラリ Gedatsu (graphs with embedded data subdicision utilities) としてまとめ、公開しています。

領域どうしの関係を表すメタグラフ

計算点のグラフを 5 つの領域に分割して得たメタグラフ (左) と、対応するブロック行列の構造 (右)。色の付いた対角ブロックが個々の領域に、灰色のブロックが隣り合う領域の間の相互作用に対応し、白いブロックは零 ([9] の Fig. 3)計算点のグラフを 5 つの領域に分割して得たメタグラフ (左) と、対応するブロック行列の構造 (右)。色の付いた対角ブロックが個々の領域に、灰色のブロックが隣り合う領域の間の相互作用に対応し、白いブロックは零 ([9] の Fig. 3)

計算点のグラフを領域に分割すると、今度は、領域どうしの関係を考えることができます。分割された領域の 1 つ 1 つをノード (メタノード) とみなし、隣り合う領域どうしをエッジで結んだグラフを、メタグラフと呼びます。計算点のグラフが係数行列の非零構造を表すのと同じように、メタグラフは、領域ごとにまとめたブロック行列の、どのブロックが非零になるかを表します。メタグラフもグラフなので、計算点のグラフと同じ道具で、重みを付けたり、もう一度分割したりできます。計算点のグラフとメタグラフという 2 つの階層で系を捉えると、領域を 1 つの単位として扱う手法 (領域ごとに少数の基底で解を表す低次元化モデルなど) も、同じ枠組みで並列化できます [5, 9]。

領域分割された系に対する並列連立一次方程式求解

我々は、この領域分割された系に対し、連立一次方程式を並列に効率良く求解するためのライブラリ monolis (monolithic linear equation solver based on domain decomposition) を開発しています。また、分割された領域の隣接関係を表す「メタグラフ」構造を利用し、マルチグリッド的前処理の開発も実施しています。

マルチメソッドなどの複雑な解析手法への適用

上記のように、グラフで一般化された考え方に従うと、異なる数値解析手法どうしを連結させた複雑な系の解析もシンプルな形に一般化できます。図では、粒子法流体解析と有限要素法構造解析を連結した例を紹介していますが、このような問題も、「各手法ごとの計算点グラフ」と、「各手法どうしをつなぐ連結グラフ (coupled graph)」を考え、それらを統合することでシンプルに扱うことができます。

この連結グラフを作成する際、幾何学的な内外判定や距離計算が必要となるため、領域分割型並列計算環境で動作する一般化幾何計算ライブラリ gg_tools (generalized geometrical tools) の開発を行っています。

関連する研究例

このようなグラフを用いた領域分割は、主に有限要素法並列解析の分野で広く利用されていましたが、我々は上記のライブラリを利活用し、有限要素法以外の発展的な数値解析手法に適用しています。

どの手法でも、考えることは同じです。離散化して得られる行列のどこが非零になりうるか、つまり、どの計算点どうしが相互作用するかを考え、それをグラフのエッジとします。グラフが決まれば、領域分割、隣の領域と重ねて持つ計算点 (オーバーラップ領域)、通信の相手は、同じ手順で定まります。以下に、手法ごとに、どう考えてグラフを作るかを、領域分割の例とともに紹介します。

メッシュフリー粒子法 (Euler 型 LSMPS 法)

領域分割した Stanford bunny 形状の解析モデル。色は領域 ([1] の Fig. 20)領域分割した Stanford bunny 形状の解析モデル。色は領域 ([1] の Fig. 20)

粒子法では、ある粒子での微分などの計算に、その粒子の影響半径の中にある粒子の値を使います。つまり、相互作用の相手は、影響半径で決まります。そこで、粒子を計算点 (グラフのノード) とし、影響半径の中にある粒子どうしをエッジで結びます。メッシュがなくても、これでグラフが得られます。領域分割では、各領域の粒子の数を均等にしながら、領域をまたぐエッジの数が最小になるように、グラフを分割します。分割面の近くの粒子は、隣の領域の粒子を参照するので、その粒子を重ねて持ち (オーバーラップ領域)、値を通信で受け取ります。粒子が動く Lagrange 型の粒子法では、相互作用の相手が時間とともに変わるため、分割のやり直しが必要です。粒子の位置を固定した Euler 型の LSMPS 法では、相手が変わらないので、初期配置のグラフを一度分割すれば、均一にした計算負荷が保たれます [1]。

B-spline 重合メッシュ法

B-spline 重合メッシュ法のグローバルメッシュとローカルメッシュを 32 領域に分割した例。黒は複数の領域が共有する要素 ([8] の Fig. 6)B-spline 重合メッシュ法のグローバルメッシュとローカルメッシュを 32 領域に分割した例。黒は複数の領域が共有する要素 ([8] の Fig. 6)

重合メッシュ法は、全体を覆うグローバルメッシュに、注目する領域のローカルメッシュを重ねる手法です。有限要素法では、係数行列の成分が非零になりうるのは、2 つの基底関数の値がともに非零となる場所があるときだけです。そこで、基底関数に対応する計算点 (Lagrange 基底関数の節点と、B-spline 基底関数の制御点) をノードとし、基底関数の値が非零となる範囲が少しでも重なる計算点どうしを、エッジで結びます。この決め方は、同じメッシュの中の組にも、グローバルメッシュとローカルメッシュにまたがる組にも、そのまま使えます。メッシュ内とメッシュ間の相互作用を区別せずに、1 つのグラフにまとめられることが要点です [2, 8]。メッシュを別々に分割すると、メッシュ間のつながりが領域分割に反映されません。1 つにまとめたグラフを分割すれば、2 つのメッシュがまとめて領域分割され、各領域が受け持つ計算点と要素、通信の相手が決まります。エッジの決め方は基底関数の種類や次数によらないので、B-spline 基底関数の次数を変えても、同じ手順で分割できます。また、2 つのメッシュを結び付ける行列の生成は、重なり領域に集中します。そのコストを計算点の重みとして与え、負荷が均等になるように分割しています [8]。

領域分割型の低次元化モデル

(a) 基底を求める領域 (512 個) と、(b) それらをまとめた並列計算の領域 (128 個) ([9] の Fig. 9)(a) 基底を求める領域 (512 個) と、(b) それらをまとめた並列計算の領域 (128 個) ([9] の Fig. 9)

低次元化モデル (reduced-order model、ROM) は、パラメータを変えて解析を繰り返すパラメトリックスタディを高速に行うための手法です。局所的な基底 (POD 基底) を領域ごとに求める方法では、基底を求める領域と、並列計算の領域という、2 種類の領域が現れます。我々は、これをグラフの階層として整理しました。まず、有限要素の節点を計算点とするグラフを分割して、基底を求める領域を作ります。この領域は、低次元の基底関数が割り当てられた、粗い有限要素とみなせます。そこで、領域の 1 つ 1 つを新たな計算点 (メタノード) とし、有限要素の節点のときと同じ考え方で、基底関数が重なる領域どうしをエッジで結びます。こうして得られるメタグラフは、低次元化された係数行列の、どのブロックが非零になるかを表します。このメタグラフをもう一度分割すると、並列計算の領域が決まります [5, 9]。2 段階目の分割は、節点の集まりや基底を分け直さないので、基底を求める領域の数と並列数を別々に選べ、基底や低次元化された行列の値も変わりません。これにより、低次元化された連立一次方程式の組み立てと求解までを、分散メモリ型で並列化できます。メタノードに計算コストの重みを与えれば、負荷分散も同じ仕組みで行えます [9]。

大規模データの可視化

32 プロセスで生成した Lucy モデルの表面メッシュ。右は領域ごとに色分けしたもの ([3] の Fig. 9)32 プロセスで生成した Lucy モデルの表面メッシュ。右は領域ごとに色分けしたもの ([3] の Fig. 9)

領域分割型の並列解析では、結果のデータも領域ごとに分かれて、各計算ノードに置かれます。可視化でも、解析と同じ、グラフに基づく領域分割を用います。有限要素法なら節点どうしの相互作用を、粒子法なら影響半径の中にある粒子どうしの相互作用を、エッジとします。グラフを分割するとエッジが切れるので、切れた先の計算点を隣の領域から写して持ち (オーバーラップ領域)、各領域が、分割する前と同じ相互作用の情報を持てるようにします。その上で、節点の値も粒子の値も、陰関数表現のスカラー場 (符号付き距離場や粒子数密度場) に変換し、領域ごとに並列に、マーチングキューブ法で表面メッシュを生成します [3]。データを 1 つのノードに集める必要がなく、数値解析手法も問いません。領域の境界に生じる不要な面は、境界付近の値を隣の領域と共有することで抑えています。この手法は、ソフトウェア IFDD-Surf として公開しています [7]。

画像から形状を取得する埋め込み境界型有限要素法

自由度数 23,877,504 の解析の、1,024 並列での領域分割 ([6] の Fig. 14)自由度数 23,877,504 の解析の、1,024 並列での領域分割 ([6] の Fig. 14)

実物の形状には、3 次元 CAD データのような設計図がないことが多くあります。我々は、複数の画像から、機械学習フォトグラメトリの手法 NeuS で形状を符号付き距離関数として学習し、固定した直交格子メッシュの上で、近似デルタ関数を Nitsche の方法に組み込んだ埋め込み境界型有限要素法によって境界条件を課す、流体解析システムを提案しています [6]。物体の表面を細かく表すには高解像度のメッシュが必要になり、自由度数が大きくなります。そこで、メッシュの節点を計算点とし、同じ要素を構成する節点どうしをエッジで結びます。このグラフの隣接行列の非零構造は、有限要素法の係数行列の非零構造と一致するので、行列計算の並列化に必要な情報は、グラフから得られます。各領域の計算量が均等になり、領域の間の通信量が最小になるようにグラフを分割し、不足する情報をオーバーラップ領域で補って、分散メモリ型の並列計算を行っています。

関連動画

共同研究者・共同研究機関

関連プロジェクト

  • 発見的数値解析利用を実現する並列分離型連成フレームワークの創成, 日本学術振興会科学研究費補助金, 基盤研究 (A), 2019年4月–2023年3月, 三目直登 (研究分担者) [研究代表者: 吉村忍]. Link
  • 複雑現象の革新的数値解析パラダイムによる減災設計戦略, 科学技術振興機構 (JST) 創発的研究支援事業, 2022年4月–2029年3月, 三目直登 (研究代表者). Link
  • 階層型メタグラフ構造に基づくデータ駆動 Finite "Meta-Element" Method, 日本学術振興会科学研究費補助金, 基盤研究 (B), 2026年4月–2029年3月, 三目直登 (研究代表者). Link

関連文献

Research Overview

Background and Motivation

As numerical analysis and mechanical simulation have advanced in recent years, the problems they address have become more complex year by year, and the programs used to analyze such complex problems have become ever more complicated. Speaking only from the viewpoint of university education, when one tries to conduct research on numerical analysis strategies for such problems, the complexity of the programs becomes a bottleneck, and research cannot be properly carried out within the two years of a master's program. We therefore focus on the fact that interactions between calculation points can be described as a graph, and, for targets whose implementation is time-consuming, such as data-distributed parallel analysis (parallel analysis using supercomputers and similar systems), we are developing a general methodology that encompasses all numerical analysis methods, together with highly portable libraries that implement it.

Interactions between Calculation Points, Sparse Matrix Structure, and Graphs

Each numerical analysis method has its own "interactions between calculation points" (the way operators such as derivatives are computed). In addition, every numerical analysis method ultimately reduces to a system of linear equations (a matrix). (* For nonlinear problems, this corresponds to the tangent matrix obtained by applying a nonlinear solution method such as the Newton–Raphson method. One may argue that explicit methods are an exception, but they can be regarded as "the case in which the matrix happens to be diagonal.")

These "interactions between calculation points" determine the sparse structure of the matrix (where nonzero values can appear and where the entries are zero), and by converting this matrix into an adjacency matrix in the sense of graph theory, any numerical analysis system can be uniquely converted into a graph.

Weighted Graph Partitioning and Geometric Domain Decomposition

By assigning weights to this graph, such as the computation time of each calculation point and the communication time between computers, a weighted graph can be defined. The graph is then partitioned under some constraint (for example, in parallel computing we want to equalize the computation time of each subdomain, so the constraint is to equalize the sum of the weights of the calculation points in each subdomain, which equals the computation time of that subdomain). As a result, the calculation points are grouped spatially into "subdomains," and the domain is decomposed. We have compiled these graph operations and domain decomposition operations into the library Gedatsu (graphs with embedded data subdicision utilities) and released it publicly.

Metagraphs Representing the Relations between Subdomains

Metagraph obtained by decomposing a calculation-point graph into five subdomains (left) and the corresponding block matrix structure (right). Colored diagonal blocks correspond to individual subdomains, gray blocks to interactions between adjacent subdomains, and white blocks are zero ([9], Fig. 3)Metagraph obtained by decomposing a calculation-point graph into five subdomains (left) and the corresponding block matrix structure (right). Colored diagonal blocks correspond to individual subdomains, gray blocks to interactions between adjacent subdomains, and white blocks are zero ([9], Fig. 3)

Once the graph of calculation points has been decomposed into subdomains, we can in turn consider the relations between the subdomains. A graph in which each subdomain is regarded as a node (a metanode) and adjacent subdomains are connected by edges is called a metagraph. Just as the graph of calculation points represents the nonzero structure of the coefficient matrix, the metagraph represents which blocks of the block matrix, grouped by subdomain, are nonzero. Since a metagraph is itself a graph, it can be weighted and decomposed again with the same tools as the graph of calculation points. By viewing a system on the two levels of the calculation-point graph and the metagraph, methods that treat a subdomain as a single unit (such as reduced-order models that represent the solution in each subdomain with a small number of bases) can also be parallelized within the same framework [5, 9].

Parallel Solution of Linear Equations for Domain-Decomposed Systems

For such domain-decomposed systems, we are developing monolis (monolithic linear equation solver based on domain decomposition), a library for solving systems of linear equations efficiently in parallel. We are also developing multigrid-like preconditioners that use the "metagraph" structure representing the adjacency relations between the decomposed subdomains.

Application to Complex Analysis Methods such as Multi-Method Analysis

Following the graph-generalized approach described above, the analysis of complex systems in which different numerical analysis methods are coupled can also be generalized into a simple form. The figure shows an example in which a particle-method fluid analysis and a finite-element structural analysis are coupled; such problems can also be handled simply by considering "a calculation-point graph for each method" and "a coupled graph connecting the methods," and integrating them.

Since creating this coupled graph requires geometric inside/outside tests and distance calculations, we are developing gg_tools (generalized geometrical tools), a generalized geometric computation library that runs in domain-decomposed parallel computing environments.

Related Research Examples

Domain decomposition using such graphs has been widely used mainly in the field of parallel finite element analysis, but we use the libraries above to apply it to advanced numerical methods other than the finite element method.

Whatever the method, the question to consider is the same: where can the matrix obtained by discretization have nonzero entries, in other words, which calculation points interact with each other? These interactions become the edges of the graph. Once the graph is determined, the domain decomposition, the calculation points that each subdomain shares with its neighbors (the overlapping region), and the communication partners are all determined by the same procedure. Below, for each method, we describe how the graph is constructed, together with an example of domain decomposition.

Meshfree Particle Method (Eulerian LSMPS Method)

Analysis model of the Stanford bunny shape after domain decomposition; colors indicate subdomains ([1], Fig. 20)Analysis model of the Stanford bunny shape after domain decomposition; colors indicate subdomains ([1], Fig. 20)

In particle methods, quantities such as derivatives at a particle are computed from the values of the particles within its radius of influence. In other words, the interaction partners are determined by the radius of influence. We therefore take the particles as calculation points (the nodes of the graph) and connect particles within each other's radius of influence by edges. This yields a graph even without a mesh. In domain decomposition, the graph is partitioned so that the number of particles in each subdomain is equalized while the number of edges crossing subdomain boundaries is minimized. Particles near a partition boundary refer to particles in the neighboring subdomain, so those particles are also held as copies (the overlapping region), and their values are received by communication. In Lagrangian particle methods, where the particles move, the interaction partners change over time, so the decomposition must be redone. In the Eulerian LSMPS method, where the particle positions are fixed, the partners do not change, so once the graph of the initial configuration has been partitioned, the equalized computational load is maintained [1].

B-spline Based s-Version of the Finite Element Method

Example of decomposing the global and local meshes of the B-spline based s-version of the finite element method into 32 subdomains; black indicates elements shared by multiple subdomains ([8], Fig. 6)Example of decomposing the global and local meshes of the B-spline based s-version of the finite element method into 32 subdomains; black indicates elements shared by multiple subdomains ([8], Fig. 6)

The s-version of the finite element method overlays a local mesh covering a region of interest onto a global mesh covering the entire domain. In the finite element method, an entry of the coefficient matrix can be nonzero only if there is a location where both of the two corresponding basis functions are nonzero. We therefore take the calculation points associated with the basis functions (the nodes of Lagrange basis functions and the control points of B-spline basis functions) as nodes, and connect by an edge any two calculation points whose ranges of nonzero basis-function values overlap even slightly. This rule applies as it is both to pairs within the same mesh and to pairs spanning the global and local meshes. The key point is that interactions within a mesh and between meshes are gathered into a single graph without distinguishing them [2, 8]. If the meshes were decomposed separately, the connections between the meshes would not be reflected in the domain decomposition. By partitioning the single combined graph, the two meshes are decomposed together, and the calculation points and elements assigned to each subdomain, as well as the communication partners, are determined. Since the rule for edges does not depend on the type or degree of the basis functions, the decomposition follows the same procedure even when the degree of the B-spline basis functions is changed. In addition, the generation of the matrices that couple the two meshes is concentrated in the overlapping region. This cost is given as weights on the calculation points, and the graph is partitioned so that the load is balanced [8].

Domain-Decomposed Reduced-Order Models

(a) Subdomains for computing the bases (512) and (b) the subdomains for parallel computation that group them (128) ([9], Fig. 9)(a) Subdomains for computing the bases (512) and (b) the subdomains for parallel computation that group them (128) ([9], Fig. 9)

A reduced-order model (ROM) is a technique for performing parametric studies, in which analyses are repeated with different parameters, at high speed. In approaches that compute local bases (POD bases) for each subdomain, two kinds of subdomains appear: the subdomains for computing the bases and the subdomains for parallel computation. We have organized these as a hierarchy of graphs. First, the graph whose calculation points are the finite element nodes is partitioned to create the subdomains for computing the bases. Each of these subdomains can be regarded as a coarse finite element to which low-dimensional basis functions are assigned. We therefore take each subdomain as a new calculation point (a metanode) and, in the same way as for finite element nodes, connect subdomains whose basis functions overlap by edges. The metagraph obtained in this way represents which blocks of the reduced coefficient matrix are nonzero. Partitioning this metagraph once more determines the subdomains for parallel computation [5, 9]. Because the second-level partitioning does not re-partition the sets of nodes or the bases, the number of subdomains for computing the bases and the number of parallel processes can be chosen independently, and the values of the bases and of the reduced matrices remain unchanged. This allows the entire process up to the assembly and solution of the reduced system of linear equations to be parallelized on distributed-memory computers. If computational-cost weights are assigned to the metanodes, load balancing can also be performed with the same mechanism [9].

Visualization of Large-Scale Data

Surface mesh of the Lucy model generated with 32 processes; the right image is colored by subdomain ([3], Fig. 9)Surface mesh of the Lucy model generated with 32 processes; the right image is colored by subdomain ([3], Fig. 9)

In domain-decomposed parallel analysis, the result data are also divided by subdomain and stored on the individual compute nodes. For visualization, too, we use the same graph-based domain decomposition as in the analysis. The edges represent the interactions between nodes in the finite element method and the interactions between particles within the radius of influence in particle methods. Since partitioning the graph cuts edges, the calculation points at the other ends of the cut edges are copied from the neighboring subdomains (the overlapping region), so that each subdomain holds the same interaction information as before the partitioning. On this basis, both nodal values and particle values are converted into scalar fields based on implicit function representations (signed distance fields and particle number density fields), and surface meshes are generated in parallel for each subdomain using the marching cubes method [3]. There is no need to gather the data onto a single node, and the approach does not depend on the numerical analysis method. Spurious surfaces arising at subdomain boundaries are suppressed by sharing the values near the boundaries with the neighboring subdomains. This method has been released as the software IFDD-Surf [7].

Immersed Boundary Finite Element Method with Shapes Obtained from Images

Domain decomposition with 1,024 parallel processes for an analysis with 23,877,504 degrees of freedom ([6], Fig. 14)Domain decomposition with 1,024 parallel processes for an analysis with 23,877,504 degrees of freedom ([6], Fig. 14)

Real objects often have no blueprint such as 3D CAD data. We have proposed a fluid analysis system that learns the shape from multiple images as a signed distance function using NeuS, a machine-learning photogrammetry method, and imposes boundary conditions on a fixed Cartesian grid mesh with an immersed boundary finite element method that incorporates an approximate delta function into Nitsche's method [6]. Representing the object surface in detail requires a high-resolution mesh, which leads to a large number of degrees of freedom. We therefore take the mesh nodes as calculation points and connect nodes that belong to the same element by edges. Since the nonzero structure of the adjacency matrix of this graph coincides with that of the finite element coefficient matrix, the information required to parallelize the matrix computations is obtained from the graph. The graph is partitioned so that the computational load of each subdomain is equalized and the communication between subdomains is minimized, the missing information is supplemented by the overlapping region, and the computation is performed in parallel on distributed-memory computers.

Related Video (in Japanese)

Collaborators

Related Papers