# An MPI-OpenMP Hybrid ParallelH-LU Direct Solver for Electromagnetic Integral Equations

Authors: Han Guo; Jun Hu; Zaiping Nie
Journal: International Journal of Antennas and Propagation
 (2015)

---

## Abstract

In this paper we propose a high performance parallel strategy/technique to implement the fast direct solver based on hierarchical matrices method. Our goal is to directly solve electromagnetic integral equations involving electric-large and geometrical-complex targets, which are traditionally difficult to be solved by iterative methods. The parallel method of our direct solver features both OpenMP shared memory programming and MPl message passing for running on a computer cluster. With modifications to the core direct-solving algorithm of hierarchical LU factorization, the new fast solver is scalable for parallelized implementation despite of its sequential nature. The numerical experiments demonstrate the accuracy and efficiency of the proposed parallel direct solver for analyzing electromagnetic scattering problems of complex 3D objects with nearly 4 million unknowns.


---

## Body

## 1. Introduction

Computational electromagnetics (CEM), which is driven by the explosive development of computing technology and vast novel fast algorithms in recent years, has become important to the modeling, design, and optimization of antenna, radar, high-frequency electronic device, and electromagnetic metamaterial. Among the three major approaches for CEM, finite-difference time-domain (FDTD) [1], finite element method (FEM) [2], and method of moments (MoM) [3], MoM has gained widely spread reputation for its good accuracy and built-in boundary conditions. Generally, MoM discretizes the electromagnetic integral equations (IEs) into linear systems and solves them via numerical algebraic methods. Although the original MoM procedure forms a dense system matrix which is computationally intensive for solving large-scale problems, a variety of fast algorithms have been introduced to accelerate MoM via reducing both of its CPU time and memory cost. Well-known fast algorithms for frequency domain IEs, such as multilevel fast multipole method (MLFMM) [4–6], multilevel matrix decomposition algorithm (MLMDA) [7–9], adaptive integral method (AIM) [10], hierarchical matrices (H-matrices, H
2-matrices) method [11–15], multiscale compressed block decomposition (MLCBD) [16, 17], and adaptive cross-approximation (ACA) [18, 19], have remarkably increased the capacity and ability of MoM to analyze radiation/scattering phenomena for electric-large objects.Traditionally, iterative solvers are employed and combined with fast algorithms to solve the MoM. Despite of the availability of many efficient fast algorithms, there are still some challenges in the iterative solving process for discretized IEs. One major problem is the slow-convergence issue. Due to various reasons, such as complex geometrical shapes of the targets, fine attachments, dense discretization, and/or nonuniform meshing, the spectrum condition of the impedance matrix of discretized IEs can be severely deteriorated. Therefore, the convergence speed of iteration will be slowed down significantly so that we are not able to obtain an accurate solution within a reasonable period of time. In order to overcome this difficulty, preconditioning techniques are usually employed to accelerate the convergence. There are some popular preconditioners, including diagonal blocks inverse [20], incomplete Cholesky factorization [21], incomplete LU factorization (ILU) [21, 22], and sparse approximate inverse (SAI) [23], used widely. However, the effectiveness of preconditioning techniques is problem dependent and the convergence still cannot be guaranteed. For some extreme cases preconditioning shows little alleviation to the original problem. By contrast, direct solving like Gaussian elimination or LU factorization [24] spends fixed number of operations, whose impedance/system is only related to the size of impedance/system matrix, namely, the number of unknowns N, to obtain the accurate solution of MoM. Although these standard direct solvers are not favored over iterative solvers because of their costly computational complexity O
(
N
3
), a number of fast direct solvers (FDS) are introduced recently [14–19, 25], which inherit the merit of direct solving for avoiding slow-convergence issue, and have significantly reduced the required CPU time and memory.So far, there are some existing literatures discussing the parallelization of direct solvers for electromagnetic integral equations [26, 27]. It is notable that the implementation of parallelizing FDS is not trivial. Since the algorithms of major FDS share a similar recursive factorization procedure in a multilevel fashion, their implementations are intrinsically sequential in nature. However, they can be parallelized with good scalability by elaborate dissection and distribution. In this paper, we proposed an MPI-OpenMP hybrid parallel strategy to implement the H-matrices based direct solver with hierarchical LU (H-LU) factorization [15, 28]. This parallel direct solver is designed for running on a computer cluster with multiple computing nodes with multicore processors for each node. OpenMP shared memory programming [29] is utilized for the parallelization on multicore processors for each node, while MPI message passing [30] is employed for the distribution computing among all the nodes. The proposed parallel FDS shows good scalability and parallelization efficiency, and numerical experiments demonstrate that it can solve electrical-large IE problems involving nearly 4 million unknowns within dozens of hours.The rest of this paper is organized as follows. Section2 reviews the discretized IE we aim to solve and basic MoM formulas. Section 3 outlines the construction of H-matrices based IE system, including spatial grouping of basis functions and the partition of the impedance matrix, as well as the direct solving procedure of H-LU factorization. Section 4 elaborates the parallelizing strategy for the construction and LU factorization of H-matrices based IE system, with the discussion of its theoretical parallelization efficiency. Section 5 gives some results of numerical tests to show the efficiency, capacity, and accuracy of our solver. Finally, the summary and conclusions are given in Section 6.


## 2. Electromagnetic Integral Equation and Method of Moments

In this section, we give a brief review of surface IEs and their discretized forms [3] that our parallel FDS deals with. In the case of 3D electromagnetic field problem, electric field integral equation (EFIE) is written as
(1)
-
t
^
·
i
k
η
∫
s
′
d
s
′
J
r
′
·
I
-
∇
∇
′
k
2
g
(
r
,
r
′
)
=
t
^
·
E
inc
r
,
in which k is the wavenumber, η is the wave impedance, t
^ is the unit tangential component on the surface of the object, and g
(
r
,
r
′
) is the free space Green function. E
inc
r is the incident electric field and J
r
′ is the excited surface current to be determined. Correspondingly, the 3D magnetic field integral equation (MFIE) is written as
(2)
-
J
(
r
)
2
+
n
^
×
P
.
V
.
∫
s
d
s
′
J
(
r
′
)
×
∇
′
g
r
,
r
′
=
-
n
^
×
H
inc
(
r
)
,
in which n
^ is the normal component on the surface of the object, H
inc
(
r
) is the incident magnetic field, and P.V. stands for the Cauchy principal value integration. For time harmonic electromagnetic plane wave, E
inc and H
inc have the relationship
(3)
H
inc
=
1
η
k
^
×
E
inc
,
where k
^ is the unit vector of wave propagating direction. In order to cancel the internal resonance that occurred in the solution of individual EFIE or MFIE, the two equations are usually linearly combined. Specifically, we have the combined field integral equation (CFIE) written as
(4)
CFIE
=
α
·
EFIE
+
1
-
α
η
·
MFIE
.
To solve this IE numerically, first we need to mesh the surfaces of the object with basic patches. For electromagnetic IEs, triangular and quadrilateral patches are two types of frequently used patches, which are associated with Rao-Wilton-Gliso (RWG) basis function [31] and roof-top basis function [32], respectively. By using these basis functions, the undetermined J
(
r
) in (1) and (2) can be discretized by the combination of basis functions f
i
r, i
=
1,2
,
…
,
N as
(5)
J
r
=
∑
i
=
1
N
I
i
f
i
r
,
in which I
i is the unknown coefficients and N is the total number of unknowns. By using Galerkin test, we can form the N
×
N linear systems for (1) and (2) as
(6)
Z
EFIE
·
I
=
V
EFIE
,
Z
MFIE
·
I
=
V
MFIE
,
in which the system matrices Z
EFIE and Z
MFIE are also called impedance matrices in IEs context. The entries of the system matrices and right-hand side vectors can be calculated numerically through the following formulas:
(7)
Z
m
n
EFIE
=
-
i
k
η
∫
s
∫
s
′
g
(
r
,
r
′
)
f
m
r
·
f
n
r
′
d
s
′
d
s
+
i
η
k
∫
s
∫
s
′
g
(
r
,
r
′
)
∇
s
·
f
m
r
∇
s
′
·
f
n
r
′
d
s
′
d
s
,
Z
m
n
MFIE
=
1
2
∫
s
d
s
f
m
r
·
f
n
r
+
n
^
·
∫
s
d
s
f
m
r
×
∫
s
′
d
s
′
f
n
r
′
×
∇
′
g
(
r
,
r
′
)
,
V
m
EFIE
=
∫
s
d
s
f
m
r
·
E
inc
r
,
V
m
MFIE
=
∫
s
d
s
f
m
r
·
n
^
×
H
inc
r
.
Consequently, the discretized CFIE system matrix and excitation vector are
(8)
Z
m
n
CFIE
=
α
Z
m
n
EFIE
+
1
-
α
η
·
Z
m
n
MFIE
,
V
m
CFIE
=
α
V
m
EFIE
+
1
-
α
η
·
V
m
MFIE
.
By solving the linear system
(9)
Z
CFIE
·
I
=
V
CFIE
,
we can get the excited surface current J and corresponding radiation/scattering field.


## 3. Fast Direct Solver and Hierarchical LU Factorization

Generally, we can solve the linear system (9) iteratively or directly. For iterative solvers, the Krylov subspace methods are frequently used, such as CG, BiCG, GMRES, and QMR [33]. Because iterative methods often suffer from slow-convergence issues for complex applications, direct methods have become popular recently. Several researchers proposed a variety of FDS [14–19, 25], which aim at avoiding convergence problems for iterative solvers and utilize similar hierarchical inverse/factorization procedure and low rank compression techniques to reduce the computational and storage complexity.H-matrices method [11, 12, 15] is a widely known mathematical framework for accelerating both finite element method (FEM) and IE method. In the scenario of electromagnetic IE, H-matrices method is regarded as the algebraic counterpart of MLFMM [4–6]. The most advantage of H-matrices technique over MLFMM is that it can directly solve the IE system by utilizing its pure algebraic property. In this section, we briefly review the primary procedures of IE-based H-matrices method and the algorithm of hierarchical LU factorization which will be parallelized.In order to implementH-matrices method, firstly the impedance matrix Z
CFIE needs to be formed block-wisely and compressed by low rank decomposition scheme. We subdivide the surface of the object hierarchically and, according to their interaction types, form the impedance/forward system matrix in a multilevel pattern. This procedure is very similar to the setting-up step in MLFMM. By contrast to the octree structure of MLFMM, the structure in H-matrices is a binary tree. The subdivision is stopped when the dimension of smallest subregions covers a few wavelengths. The subblocks in the impedance matrix representing the far-field/weak interactions are compressed by low rank (LR) decomposition schemes. Here we use the adaptive cross-approximation (ACA) algorithm [18, 19] as our LR decomposition scheme, which only requires partial information of the block to be compressed and is thus very efficient.After theH-matrices based impedance matrix is generated, the hierarchical LU (H-LU) factorization [12, 26, 28] is employed on it and finally we get an LU decomposed system matrix LU (
Z
CFIE
). During and after the factorization process, subblocks in LR format are kept all the time. Having the LU (
Z
CFIE
), we can easily solve the IE with given excitations by a recursive backward substitution procedure. Figure 1 illustrates the overall procedure of the H-matrices based FDS introduced above.Figure 1
Overall procedure ofH-matrices based FDS.FromZ
CFIE to LU (
Z
CFIE
), the hierarchical LU factorization is employed. The factorization algorithm is elaborated below. Consider the block LU factorization of the level-1 partitioned Z
CFIE matrix; namely,
(10)
Z
CFIE
=
Z
11
Z
12
Z
21
Z
22
=
L
11
L
21
L
22
U
11
U
12
U
22
.
We carry out the following procedures in a recursive way: (i) get L
11 and U
11 by LU factorization Z
11
=
L
11
U
11; (ii) get U
12 by solving lower triangular system Z
12
=
L
11
U
12; (iii) get L
21 by solving upper triangular system Z
21
=
L
21
U
11; (iv) update Z
22: Z
22
=
Z
22
-
L
21
U
12; and (v) get L
22 and U
22 by LU factorization Z
22
=
L
22
U
22. Recursive implementations are participated among all procedures (i)–(v). Procedures (ii) and (iii) (and similar operations under the hierarchical execution of (i) and (v)) are performed via partitioned forward/backward substitution for hierarchical lower/upper triangular matrices [12, 28]. Procedure (iv) is a vital operation that contributes most of the computing time cost. This subblocks addition-multiplication procedure occurs not only in one or several certain levels, but pervades in all of the recursive executions. Figure 1 illustrates the overall procedure of H-matrices based FDS. Implementation details about H-matrices compression and recursive LU factorization can be found in [12, 14, 15]. In addition, a similar recursive direct solving process for noncompression IE system matrix is discussed in [26].Based on the result ofH-LU factorization, we can easily get the solution for any given excitation, namely, right-hand side (RHS) vector by hierarchical backward substitution. The CPU time cost for backward substitution is trivial compared to that of H-LU factorization.


## 4. Parallelization ofH-Matrices Based IE Fast Direct Solver

The parallelization ofH-matrices based IE FDS contains two parts: (a) the parallelization (of the process) of generating the forward/impedance matrix with H-matrices form; (b) the parallelization of H-LU factorization and backward substitution. In this section, we will elaborate the approaches for implementing these two parts separately.


### 4.1. Parallelization of Generating Forward/Impedance Matrix

Since our FDS is executed on a computer cluster, the computing data must be stored distributively in an appropriate way, especially for massive computing tasks. The main data ofH-matrices based IE FDS are the LR compressed forward/impedance and LU factorized matrices. In principle, for forward/impedance matrix, we divide it into multiple rows, and each computing node stores one of these row-blocks. This memory distribution strategy is shown in Figure 2. The width of each row is not arbitrary but in correspondence to the hierarchical partition of the matrix in certain level K. Therefore, no LR formatted block will be split by the division lines that cross the entire row. In practice, the width of each row is approximately equal and the total number of rows is the power of 2, namely, 2
K. K is an integer which is less than the depth of the binary tree structure of H-matrices, which is denoted by L. Each row-block is computed and filled locally by each MPI node it is assigned to. Since every subblock is an independent unit, the filling process for these row-blocks can be parallelized for all MPI nodes without any communication or memory overlap. Furthermore, for each MPI node with multicore processor, the filling process of its corresponding blocks can be accelerated by utilizing the OpenMP memory share parallel computing. In the case of MoM, OpenMP is very efficient to parallelize the calculation of impedance elements, since this kind of calculation only depends on the invariant geometrical information and electromagnetic parameters, which are universally shared among all nodes.Figure 2
Data distribution strategy for forward/impedance matrix and also for LU factorized matrix.


### 4.2. Parallelization ofH-LU Factorization

TheH-LU factorization is executed immediately after the forward/impedance matrix is generated. Compared with the forward/impedance matrix filling process, the parallelization of H-LU factorization is not straightforward because its recursive procedure is sequential in nature. In order to put H-LU factorization into a distributed parallel framework, here we use an incremental strategy to parallelize this process gradually.During theH-LU factorization, the algorithm is always working/computing on a certain block which is in LR form or full form or the aggregation of them, so that we can set a criterion based on the size of the block for determining whether current procedure should be parallelized. Specifically, assuming that the (total) number of unknowns is N, we have about 2
K nodes for computing; then if the maximal dimension of ongoing processing block is larger than N
/
2
K, MPI parallel computing with multiple nodes is employed; otherwise the process will be dealt with by single node. It should be noted that OpenMP memory share parallel is always employed for every node with multicore processor participating in computing. In the H-LU factorization process, OpenMP is in charge of intranode parallelization of standard LU factorization, triangular system solving for full subblocks, and SVD or QR decomposition for LR subblocks addition and multiplication, and so forth, which can be implemented through highly optimized computing package like LAPACK [34].According to the recursive procedure ofH-LU factorization, at the beginning, the algorithm will penetrate into the finest level of H-matrices structure, namely, level L, to do the LU factorization for the top-left most block with the dimension of approximately (
N
/
2
L
)
×
(
N
/
2
L
). Since L
≥
K, this process is handled by one node. After that the algorithm will recur to level L
-
1 to do the LU factorization for the extended top-left block of approximately (
N
/
2
L
-
1
)
×
(
N
/
2
L
-
1
) upon the previous factorization. If L
-
1
≥
K remains true, this process is still handled by one node. This recursion is kept on when it returns to level l that l
<
K, for which MPI parallel with multiple nodes will be employed.For the sake of convenience, we useH-LU(l) to denote the factorization on certain block in the level l of H-matrices structure. Recall the H-LU factorization procedure in Section 3. Procedure (i) is H-LU itself, so its parallelization is realized by other procedures on the finer levels. For the procedure (ii) and procedure (iii) we solve the triangular linear system as
(11)
L
X
=
A
,
(12)
Y
U
=
B
,
in which L, U, A, and B are the known matrices and L, U are lower and upper triangular matrices, respectively. X and Y need to be determined. There two systems can actually be solved recursively through finer triangular systems. For instance, by rewriting (11) as
(13)
L
11
L
21
L
22
X
11
X
12
X
21
X
22
=
A
11
A
12
A
21
A
22
,
we carry out the following procedures: (i) get X
11 and X
12 by solving lower triangular systems A
11
=
L
11
X
11 and A
12
=
L
11
X
12, respectively; (ii) get X
21 and X
22 by solving lower triangular system A
21
-
L
21
X
11
=
L
22
X
21 and A
22
-
L
21
X
12
=
L
22
X
22, respectively. From the above procedures we can clearly see that getting columns [
X
11
,
X
21
]
T and [
X
12
,
X
22
]
T represents two independent processes, which can be parallelized. Similarly, by refining Y as
(14)
Y
11
Y
12
Y
21
Y
22
,
getting rows [
Y
11
,
Y
12
] and [
Y
21
,
Y
22
] represents two independent processes. Therefore, if the size of X or Y, namely, U
12 or L
21 in the H-LU context is larger than N
/
2
K, their solving processes will be dealt with by multiple nodes.After solving processes of triangular systems is done, the updating forZ
22, namely, the procedure (iv) of H-LU, is taking place. We here use UPDATE(l) to denote any of these procedures on level l. Rewriting it as
(15)
Z
^
=
Z
-
A
B
,
apparently, this is a typical matrix addition and multiplication procedure, which can be parallelized through the addition and multiplication of subblocks when it is necessary:
(16)
Z
^
11
Z
^
12
Z
^
21
Z
^
22
=
Z
11
Z
12
Z
21
Z
22
-
A
11
A
12
A
21
A
22
B
11
B
12
B
21
B
22
=
Z
11
-
A
11
B
11
-
A
12
B
21
Z
12
-
A
11
B
12
-
A
12
B
22
Z
21
-
A
21
B
11
-
A
22
B
21
Z
22
-
A
21
B
12
-
A
22
B
22
.
In the final form of (16), the matrix computation for each of the four subblocks is an independent process and can be dealt with by different nodes simultaneously. When Z
22 is updated, the LU factorization is applied to Z
22 for getting L
22 and U
22. This procedure is identical to the H-LU factorization for Z
11, so any parallel scheme employed for factorizing Z
11 is also applicable for factorizing Z
22.The overall strategy for parallelizingH-LU factorization is illustrated in Figure 3. Before the LU factorization on level K
—
H-LU(K) is finished, only one node P
1 takes the computing job. Afterwards, two nodes P
1 and P
2 are used to get U
12 and L
21 simultaneously for H-LU(K
-
1). Then Z
22 is updated and factorized for getting U
22 and L
22 by the process H-LU(K). For triangular solving process on the K
-
2 level, 4 nodes can be used concurrently to getU
12 and L
21 based on the parallelizable processes of solving the upper and lower triangular systems as we discussed above. Besides, updating Z
22 can be parallelized by 4 nodes for 4 square blocks as enclosed by blue line in Figure 3. This parallelization can be applied to coarser levels in general. As for factorization H-LU(l) (
l
<
K
), 2
K
-
l nodes can be used for parallelizing the process of solving triangular systems and 4
K
-
l nodes can be used for parallelizing the procedure of updating Z
22. During and after H-LU factorization, the system matrix is kept in the form of distributive format as the same as that for forward/impedance matrix shown in Figure 2. Under the perspective of data storage, those row-blocks are updated by H-LU factorization gradually. It should be noted that, for the nodes participating in parallel computing, the blocks they are dealing with may not relate to the row-blocks they stored. Therefore, necessary communication for blocks transfer occurs among multiple nodes during the factorization.Figure 3
Parallel strategy/approach forH-LU factorization. P
i
(
i
=
1,2
,
3
,
…
) denotes the ith node.


### 4.3. Theoretical Efficiency of MPI Parallelization

To analyze the parallelization efficiency under an ideal circumstance, we assume that the load balance is perfectly tuned and the computer cluster is equipped with high-speed network; thus there is no latency for remote response and the internode communication time is negligible. Suppose there areP nodes and each node has a constant number of OpenMP threads. The parallelization efficiency is simply defined as
(17)
η
P
=
T
1
P
T
P
,
in which T
i is the processing time with i nodes.Apparently, for the process of generating forward/impedance matrix,η
P could be 100% if the number of operations for filling each row-block under P-nodes parallelization O
P
rowfill is 1
/
P of the number of operations for filling the whole matrix O
1
fill by single node, since T
1
∝
O
1
fill and T
P
∝
O
P
rowfill
=
O
fill
/
P are true if the CPU time for taking single operation is invariant. This condition can be easily satisfied to a high degree when P is not too large. When P is large enough, to divide the system matrix into P row-blocks may force the depth of H-matrices structure inadequately that consequently increases the overall complexity of H-matrices method. In other words,
(18)
O
P
rowfill
>
O
1
fill
P
,
for
large
P
.
Under this situation, the parallelization becomes inefficient.For the process ofH-LU factorization, by assuming that P
=
2
K, the total number of operations under P-nodes parallelization O
P
LU is
(19)
O
P
LU
≈
P
·
O
H
-LU
(
K
)
+
P
P
-
1
·
O
H
-TriSolve
K
+
P
3
6
O
H
-AddProduct
K
,
where H
-LU(
K
), H
-TriSolve
K, and H
-AddProduct
K denote the processes for LU factorization, triangular system solving, and matrices addition and multiplication in H-format in the Kth level of H-matrices structure, respectively. Their computational complexity is O
(
n
α
) (2
≤
α
<
3), in which n
=
N
/
P. However, because of parallelization, some operations are done simultaneously. Hence, the nonoverlap number of operations O
P
T that represents the actual wall time of processing is
(20)
O
P
T
≈
P
·
O
H
-LU
(
K
)
+
P
K
2
·
O
H
-TriSolve
K
+
P
2
4
O
H
-AddProduct
K
.
Additionally, the number of operations without parallelization for H-LU factorization O
1
LU is definitely no larger than O
P
LU for the potential increased overall complexity by parallelization. Therefore, the parallelization efficiency is
(21)
η
P
=
O
1
LU
P
·
O
P
T
≤
O
P
LU
P
·
O
P
T
.
When P goes larger, the result is approximately
(22)
η
P
≤
(
P
3
/
6
)
O
H
-AddProduct
K
P
·
(
P
2
/
4
)
O
H
-AddProduct
K
≈
2
3
.According to our analysis, we should say that, for a given size of IE problems, there is an optimalP for best implementation. If P is too small, the solving process cannot be fully parallelized. On the other hand, larger P will make the width of the row-blocks narrower that eliminate big LR subblocks and cause H-matrices structure to be flatter, which will consequently impair the low complexity feature of H-matrices method.Similarly, the number of OpenMP threadsM has an optimal value too. Too small M will restrict OpenMP parallelization, and too large M is also a waste because the intranode parallel computing only deals with algebraic arithmetic for subblocks of relatively small size; excessive threads will not improve its acceleration and lower the efficiency.


## 4.1. Parallelization of Generating Forward/Impedance Matrix

Since our FDS is executed on a computer cluster, the computing data must be stored distributively in an appropriate way, especially for massive computing tasks. The main data ofH-matrices based IE FDS are the LR compressed forward/impedance and LU factorized matrices. In principle, for forward/impedance matrix, we divide it into multiple rows, and each computing node stores one of these row-blocks. This memory distribution strategy is shown in Figure 2. The width of each row is not arbitrary but in correspondence to the hierarchical partition of the matrix in certain level K. Therefore, no LR formatted block will be split by the division lines that cross the entire row. In practice, the width of each row is approximately equal and the total number of rows is the power of 2, namely, 2
K. K is an integer which is less than the depth of the binary tree structure of H-matrices, which is denoted by L. Each row-block is computed and filled locally by each MPI node it is assigned to. Since every subblock is an independent unit, the filling process for these row-blocks can be parallelized for all MPI nodes without any communication or memory overlap. Furthermore, for each MPI node with multicore processor, the filling process of its corresponding blocks can be accelerated by utilizing the OpenMP memory share parallel computing. In the case of MoM, OpenMP is very efficient to parallelize the calculation of impedance elements, since this kind of calculation only depends on the invariant geometrical information and electromagnetic parameters, which are universally shared among all nodes.Figure 2
Data distribution strategy for forward/impedance matrix and also for LU factorized matrix.


## 4.2. Parallelization ofH-LU Factorization

TheH-LU factorization is executed immediately after the forward/impedance matrix is generated. Compared with the forward/impedance matrix filling process, the parallelization of H-LU factorization is not straightforward because its recursive procedure is sequential in nature. In order to put H-LU factorization into a distributed parallel framework, here we use an incremental strategy to parallelize this process gradually.During theH-LU factorization, the algorithm is always working/computing on a certain block which is in LR form or full form or the aggregation of them, so that we can set a criterion based on the size of the block for determining whether current procedure should be parallelized. Specifically, assuming that the (total) number of unknowns is N, we have about 2
K nodes for computing; then if the maximal dimension of ongoing processing block is larger than N
/
2
K, MPI parallel computing with multiple nodes is employed; otherwise the process will be dealt with by single node. It should be noted that OpenMP memory share parallel is always employed for every node with multicore processor participating in computing. In the H-LU factorization process, OpenMP is in charge of intranode parallelization of standard LU factorization, triangular system solving for full subblocks, and SVD or QR decomposition for LR subblocks addition and multiplication, and so forth, which can be implemented through highly optimized computing package like LAPACK [34].According to the recursive procedure ofH-LU factorization, at the beginning, the algorithm will penetrate into the finest level of H-matrices structure, namely, level L, to do the LU factorization for the top-left most block with the dimension of approximately (
N
/
2
L
)
×
(
N
/
2
L
). Since L
≥
K, this process is handled by one node. After that the algorithm will recur to level L
-
1 to do the LU factorization for the extended top-left block of approximately (
N
/
2
L
-
1
)
×
(
N
/
2
L
-
1
) upon the previous factorization. If L
-
1
≥
K remains true, this process is still handled by one node. This recursion is kept on when it returns to level l that l
<
K, for which MPI parallel with multiple nodes will be employed.For the sake of convenience, we useH-LU(l) to denote the factorization on certain block in the level l of H-matrices structure. Recall the H-LU factorization procedure in Section 3. Procedure (i) is H-LU itself, so its parallelization is realized by other procedures on the finer levels. For the procedure (ii) and procedure (iii) we solve the triangular linear system as
(11)
L
X
=
A
,
(12)
Y
U
=
B
,
in which L, U, A, and B are the known matrices and L, U are lower and upper triangular matrices, respectively. X and Y need to be determined. There two systems can actually be solved recursively through finer triangular systems. For instance, by rewriting (11) as
(13)
L
11
L
21
L
22
X
11
X
12
X
21
X
22
=
A
11
A
12
A
21
A
22
,
we carry out the following procedures: (i) get X
11 and X
12 by solving lower triangular systems A
11
=
L
11
X
11 and A
12
=
L
11
X
12, respectively; (ii) get X
21 and X
22 by solving lower triangular system A
21
-
L
21
X
11
=
L
22
X
21 and A
22
-
L
21
X
12
=
L
22
X
22, respectively. From the above procedures we can clearly see that getting columns [
X
11
,
X
21
]
T and [
X
12
,
X
22
]
T represents two independent processes, which can be parallelized. Similarly, by refining Y as
(14)
Y
11
Y
12
Y
21
Y
22
,
getting rows [
Y
11
,
Y
12
] and [
Y
21
,
Y
22
] represents two independent processes. Therefore, if the size of X or Y, namely, U
12 or L
21 in the H-LU context is larger than N
/
2
K, their solving processes will be dealt with by multiple nodes.After solving processes of triangular systems is done, the updating forZ
22, namely, the procedure (iv) of H-LU, is taking place. We here use UPDATE(l) to denote any of these procedures on level l. Rewriting it as
(15)
Z
^
=
Z
-
A
B
,
apparently, this is a typical matrix addition and multiplication procedure, which can be parallelized through the addition and multiplication of subblocks when it is necessary:
(16)
Z
^
11
Z
^
12
Z
^
21
Z
^
22
=
Z
11
Z
12
Z
21
Z
22
-
A
11
A
12
A
21
A
22
B
11
B
12
B
21
B
22
=
Z
11
-
A
11
B
11
-
A
12
B
21
Z
12
-
A
11
B
12
-
A
12
B
22
Z
21
-
A
21
B
11
-
A
22
B
21
Z
22
-
A
21
B
12
-
A
22
B
22
.
In the final form of (16), the matrix computation for each of the four subblocks is an independent process and can be dealt with by different nodes simultaneously. When Z
22 is updated, the LU factorization is applied to Z
22 for getting L
22 and U
22. This procedure is identical to the H-LU factorization for Z
11, so any parallel scheme employed for factorizing Z
11 is also applicable for factorizing Z
22.The overall strategy for parallelizingH-LU factorization is illustrated in Figure 3. Before the LU factorization on level K
—
H-LU(K) is finished, only one node P
1 takes the computing job. Afterwards, two nodes P
1 and P
2 are used to get U
12 and L
21 simultaneously for H-LU(K
-
1). Then Z
22 is updated and factorized for getting U
22 and L
22 by the process H-LU(K). For triangular solving process on the K
-
2 level, 4 nodes can be used concurrently to getU
12 and L
21 based on the parallelizable processes of solving the upper and lower triangular systems as we discussed above. Besides, updating Z
22 can be parallelized by 4 nodes for 4 square blocks as enclosed by blue line in Figure 3. This parallelization can be applied to coarser levels in general. As for factorization H-LU(l) (
l
<
K
), 2
K
-
l nodes can be used for parallelizing the process of solving triangular systems and 4
K
-
l nodes can be used for parallelizing the procedure of updating Z
22. During and after H-LU factorization, the system matrix is kept in the form of distributive format as the same as that for forward/impedance matrix shown in Figure 2. Under the perspective of data storage, those row-blocks are updated by H-LU factorization gradually. It should be noted that, for the nodes participating in parallel computing, the blocks they are dealing with may not relate to the row-blocks they stored. Therefore, necessary communication for blocks transfer occurs among multiple nodes during the factorization.Figure 3
Parallel strategy/approach forH-LU factorization. P
i
(
i
=
1,2
,
3
,
…
) denotes the ith node.


## 4.3. Theoretical Efficiency of MPI Parallelization

To analyze the parallelization efficiency under an ideal circumstance, we assume that the load balance is perfectly tuned and the computer cluster is equipped with high-speed network; thus there is no latency for remote response and the internode communication time is negligible. Suppose there areP nodes and each node has a constant number of OpenMP threads. The parallelization efficiency is simply defined as
(17)
η
P
=
T
1
P
T
P
,
in which T
i is the processing time with i nodes.Apparently, for the process of generating forward/impedance matrix,η
P could be 100% if the number of operations for filling each row-block under P-nodes parallelization O
P
rowfill is 1
/
P of the number of operations for filling the whole matrix O
1
fill by single node, since T
1
∝
O
1
fill and T
P
∝
O
P
rowfill
=
O
fill
/
P are true if the CPU time for taking single operation is invariant. This condition can be easily satisfied to a high degree when P is not too large. When P is large enough, to divide the system matrix into P row-blocks may force the depth of H-matrices structure inadequately that consequently increases the overall complexity of H-matrices method. In other words,
(18)
O
P
rowfill
>
O
1
fill
P
,
for
large
P
.
Under this situation, the parallelization becomes inefficient.For the process ofH-LU factorization, by assuming that P
=
2
K, the total number of operations under P-nodes parallelization O
P
LU is
(19)
O
P
LU
≈
P
·
O
H
-LU
(
K
)
+
P
P
-
1
·
O
H
-TriSolve
K
+
P
3
6
O
H
-AddProduct
K
,
where H
-LU(
K
), H
-TriSolve
K, and H
-AddProduct
K denote the processes for LU factorization, triangular system solving, and matrices addition and multiplication in H-format in the Kth level of H-matrices structure, respectively. Their computational complexity is O
(
n
α
) (2
≤
α
<
3), in which n
=
N
/
P. However, because of parallelization, some operations are done simultaneously. Hence, the nonoverlap number of operations O
P
T that represents the actual wall time of processing is
(20)
O
P
T
≈
P
·
O
H
-LU
(
K
)
+
P
K
2
·
O
H
-TriSolve
K
+
P
2
4
O
H
-AddProduct
K
.
Additionally, the number of operations without parallelization for H-LU factorization O
1
LU is definitely no larger than O
P
LU for the potential increased overall complexity by parallelization. Therefore, the parallelization efficiency is
(21)
η
P
=
O
1
LU
P
·
O
P
T
≤
O
P
LU
P
·
O
P
T
.
When P goes larger, the result is approximately
(22)
η
P
≤
(
P
3
/
6
)
O
H
-AddProduct
K
P
·
(
P
2
/
4
)
O
H
-AddProduct
K
≈
2
3
.According to our analysis, we should say that, for a given size of IE problems, there is an optimalP for best implementation. If P is too small, the solving process cannot be fully parallelized. On the other hand, larger P will make the width of the row-blocks narrower that eliminate big LR subblocks and cause H-matrices structure to be flatter, which will consequently impair the low complexity feature of H-matrices method.Similarly, the number of OpenMP threadsM has an optimal value too. Too small M will restrict OpenMP parallelization, and too large M is also a waste because the intranode parallel computing only deals with algebraic arithmetic for subblocks of relatively small size; excessive threads will not improve its acceleration and lower the efficiency.


## 5. Numerical Results

The cluster we test our code on has 32 physical nodes in total; each node has 64 GBytes of memory and four quad-core Intel Xeon E5-2670 processors with 2.60 GHz clock rate. For all tested IE cases, the discrete mesh size is0.1
λ, in which λ is the wavelength.


### 5.1. Parallelization Efficiency

First, we test the parallelization scalability for solving scattering problem of PEC spheres with different electric sizes. The radii of these spheres areR
=
2.5
λ, R
=
5.0
λ, and R
=
10.0
λ, respectively. The total numbers of unknowns for these three cases are 27,234, 108,726, and 435,336, respectively. Figure 4 shows the efficiency for the total time solved by 1, 2, 4, 8, 16, 32, 64, and 128 MPI nodes, with 4 OpenMP threads for each node. The definition of parallelization efficiency is the same as formula (17); thus in this test we only consider the efficiency of pure MPI parallelization. Unsurprisingly, for parallelization with large number of nodes, bigger cases have higher efficiencies because of better load balance and less distortion to the H-matrices structure. Besides, since the H-LU factorization dominates the solving time consumption, these tested efficiencies of bigger cases are close to the maximum efficiency of theoretical one η
P
LU
=
2
/
3, which demonstrates the good parallelizing quality of our code.Figure 4
Parallelization efficiency for solving scattering problems of PEC sphere of different electric sizes.Next, we investigate the hybrid parallelization efficiency for different MPI nodes (P)/OpenMP threads (M) proportion. We employ all 512 cores in cluster to solve the 3 PEC sphere cases above in four scenarios, from pure MPI parallelization (1 OpenMP thread for each MPI node, large P
/
M) to heavy OpenMP parallelization embedded in MPI (16 OpenMP threads for each MPI node, small P
/
M). Here we slightly change the definition of parallelization efficiency as
(23)
η
P
,
M
=
T
1,1
P
·
M
·
T
P
,
M
,
in which T
i
,
j denotes the total solving time parallelized by i MPI nodes with j OpenMP threads for each node. The results are presented in Figure 5. We can clearly see that both pure MPI parallelization and heavy OpenMP hybrid parallelization have poorer efficiency compared to that of moderate OpenMP hybrid parallelization.Figure 5
Parallelization efficiency of different MPI nodes/OpenMP threads allocation.Ideally, largerP
/
M should give better efficiency for bigger cases. But, in reality, since larger P
/
M can result in more frequent MPI communication, more time is required for communication and synchronization, and so forth. Besides, large P also impairs the low complexity feature of H-matrices method regardless of the size of problems. Therefore, pure MPI parallelization does not show superiority over hybrid parallelization in our test. Referring to the optimal number of OpenMP threads per node, it is mainly determined by the size of smallest blocks in H-matrices which is preset, since OpenMP efficiency strongly relates to the parallelization of full or LR blocks addition and multiplication at low levels. For all cases of this test, the size of smallest blocks is between 50 and 200, so their optimal number of OpenMP threads per node turns out to be 4. However, we can expect the optimal number of OpenMP threads to be larger (smaller) if the size of the smallest blocks is larger (smaller). For the case of solving PEC sphere of R
=
10.0
λ with 128 nodes, 4 threads per node, the parallelization efficiency in this test is 0.737, which is higher than that of 0.562 in previous test. This is because, by our new definition of efficiency, the OpenMP parallelization is taken into account. These results also indicate the superiority of MPI-OpenMP hybrid parallelization over pure MPI parallelization.Figures6 and 7 show the memory cost and solving time for different problem sizes under different MPI nodes/OpenMP threads proportion. The memory cost complexity generally fits the O
(
N
1.5
) trend, which has also been demonstrated in sequential FDS [15, 17, 19]. Since the parallelization efficiency gradually rises along with the increase of problem size as shown above, the solving time complexity is about O
(
N
1.84
) instead of O
(
N
2
) exhibited in sequential scenario [15, 17, 19].Figure 6
Memory cost for different MPI nodes/OpenMP threads proportion.Figure 7
Solving time for different MPI nodes/OpenMP threads proportion.


### 5.2. PEC Sphere

In this part, we test the accuracy and efficiency of our proposed parallel FDS and compare its results to analysis solutions. A scattering problem of one PEC sphere with radiusR
=
30.0
λ is solved. After discretization, the total number of unknowns of this case is 3,918,612. For hybrid parallelizing, 128 MPI nodes are employed, with 4 OpenMP threads for each node. The building time for forward system matrix is 4,318.7 seconds, H-LU factorization time is 157,230.2 seconds, and solving time for each excitation (RHS) is only 36.6 seconds. The total memory cost is 987.1 GBytes. The numerical bistatic RCS results agree with the analytical Mie series very well, as shown in Figure 8.Figure 8
Bistatic RCS of PEC sphere withR
=
30.0
λ solved by proposed hybrid parallel FDS.


### 5.3. Airplane Model

Finally, we test our solver with a more realistic case. The monostatic RCS of an airplane model with the dimension of60.84
λ
×
35.00
λ
×
16.25
λ is calculated. After discretization, the total number of unknowns is 3,654,894. The building time for forward system matrix is 3548.5 seconds; H-LU factorization time is 110,453.4 seconds; and the peak memory cost is 724.3 GBytes. With the LU form of the system matrix, we directly calculate the monostatic RCS for 10,000 total vertical incident angles (RHS) by backward substitution. The average time cost for calculating each incident angle is 31.2 seconds. The RCS result is compared with that obtained by FMM iterative solver of 720 incident angles. Although FMM iterative solver only costs 112.4 GBytes for memory, the average iteration time of solving back scattering for each angle is 938.7 seconds with SAI preconditioner [23], which is not practical for solving thousands of RHS. From Figure 9 we can see that these two results agree with each other well.Figure 9
Monostatic RCS of airplane model solved by proposed hybrid parallel FDS and FMM iterative solver.


## 5.1. Parallelization Efficiency

First, we test the parallelization scalability for solving scattering problem of PEC spheres with different electric sizes. The radii of these spheres areR
=
2.5
λ, R
=
5.0
λ, and R
=
10.0
λ, respectively. The total numbers of unknowns for these three cases are 27,234, 108,726, and 435,336, respectively. Figure 4 shows the efficiency for the total time solved by 1, 2, 4, 8, 16, 32, 64, and 128 MPI nodes, with 4 OpenMP threads for each node. The definition of parallelization efficiency is the same as formula (17); thus in this test we only consider the efficiency of pure MPI parallelization. Unsurprisingly, for parallelization with large number of nodes, bigger cases have higher efficiencies because of better load balance and less distortion to the H-matrices structure. Besides, since the H-LU factorization dominates the solving time consumption, these tested efficiencies of bigger cases are close to the maximum efficiency of theoretical one η
P
LU
=
2
/
3, which demonstrates the good parallelizing quality of our code.Figure 4
Parallelization efficiency for solving scattering problems of PEC sphere of different electric sizes.Next, we investigate the hybrid parallelization efficiency for different MPI nodes (P)/OpenMP threads (M) proportion. We employ all 512 cores in cluster to solve the 3 PEC sphere cases above in four scenarios, from pure MPI parallelization (1 OpenMP thread for each MPI node, large P
/
M) to heavy OpenMP parallelization embedded in MPI (16 OpenMP threads for each MPI node, small P
/
M). Here we slightly change the definition of parallelization efficiency as
(23)
η
P
,
M
=
T
1,1
P
·
M
·
T
P
,
M
,
in which T
i
,
j denotes the total solving time parallelized by i MPI nodes with j OpenMP threads for each node. The results are presented in Figure 5. We can clearly see that both pure MPI parallelization and heavy OpenMP hybrid parallelization have poorer efficiency compared to that of moderate OpenMP hybrid parallelization.Figure 5
Parallelization efficiency of different MPI nodes/OpenMP threads allocation.Ideally, largerP
/
M should give better efficiency for bigger cases. But, in reality, since larger P
/
M can result in more frequent MPI communication, more time is required for communication and synchronization, and so forth. Besides, large P also impairs the low complexity feature of H-matrices method regardless of the size of problems. Therefore, pure MPI parallelization does not show superiority over hybrid parallelization in our test. Referring to the optimal number of OpenMP threads per node, it is mainly determined by the size of smallest blocks in H-matrices which is preset, since OpenMP efficiency strongly relates to the parallelization of full or LR blocks addition and multiplication at low levels. For all cases of this test, the size of smallest blocks is between 50 and 200, so their optimal number of OpenMP threads per node turns out to be 4. However, we can expect the optimal number of OpenMP threads to be larger (smaller) if the size of the smallest blocks is larger (smaller). For the case of solving PEC sphere of R
=
10.0
λ with 128 nodes, 4 threads per node, the parallelization efficiency in this test is 0.737, which is higher than that of 0.562 in previous test. This is because, by our new definition of efficiency, the OpenMP parallelization is taken into account. These results also indicate the superiority of MPI-OpenMP hybrid parallelization over pure MPI parallelization.Figures6 and 7 show the memory cost and solving time for different problem sizes under different MPI nodes/OpenMP threads proportion. The memory cost complexity generally fits the O
(
N
1.5
) trend, which has also been demonstrated in sequential FDS [15, 17, 19]. Since the parallelization efficiency gradually rises along with the increase of problem size as shown above, the solving time complexity is about O
(
N
1.84
) instead of O
(
N
2
) exhibited in sequential scenario [15, 17, 19].Figure 6
Memory cost for different MPI nodes/OpenMP threads proportion.Figure 7
Solving time for different MPI nodes/OpenMP threads proportion.


## 5.2. PEC Sphere

In this part, we test the accuracy and efficiency of our proposed parallel FDS and compare its results to analysis solutions. A scattering problem of one PEC sphere with radiusR
=
30.0
λ is solved. After discretization, the total number of unknowns of this case is 3,918,612. For hybrid parallelizing, 128 MPI nodes are employed, with 4 OpenMP threads for each node. The building time for forward system matrix is 4,318.7 seconds, H-LU factorization time is 157,230.2 seconds, and solving time for each excitation (RHS) is only 36.6 seconds. The total memory cost is 987.1 GBytes. The numerical bistatic RCS results agree with the analytical Mie series very well, as shown in Figure 8.Figure 8
Bistatic RCS of PEC sphere withR
=
30.0
λ solved by proposed hybrid parallel FDS.


## 5.3. Airplane Model

Finally, we test our solver with a more realistic case. The monostatic RCS of an airplane model with the dimension of60.84
λ
×
35.00
λ
×
16.25
λ is calculated. After discretization, the total number of unknowns is 3,654,894. The building time for forward system matrix is 3548.5 seconds; H-LU factorization time is 110,453.4 seconds; and the peak memory cost is 724.3 GBytes. With the LU form of the system matrix, we directly calculate the monostatic RCS for 10,000 total vertical incident angles (RHS) by backward substitution. The average time cost for calculating each incident angle is 31.2 seconds. The RCS result is compared with that obtained by FMM iterative solver of 720 incident angles. Although FMM iterative solver only costs 112.4 GBytes for memory, the average iteration time of solving back scattering for each angle is 938.7 seconds with SAI preconditioner [23], which is not practical for solving thousands of RHS. From Figure 9 we can see that these two results agree with each other well.Figure 9
Monostatic RCS of airplane model solved by proposed hybrid parallel FDS and FMM iterative solver.


## 6. Conclusion

In this paper, we present anH-matrices based fast direct solver accelerated by both MPI multinodes and OpenMP multithreads parallel techniques. The macrostructural implementation of H-matrices method and H-LU factorization is parallelized by MPI, while the microalgebraic computation for matrix blocks and vector segments is parallelized by OpenMP. Despite the sequential nature of H-matrices direct solving procedure, this proposed hybrid parallel strategy shows good parallelization efficiency. Numerical results also demonstrate excellent accuracy and superiority in solving massive excitations (RHS) problem for this parallel direct solver.



---

*Source: 615743-2015-02-01.xml*