+ All Categories
Home > Documents > GPUbased acceleration of computational electromagnetics...

GPUbased acceleration of computational electromagnetics...

Date post: 09-Jul-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
14
GPU-based acceleration of computational electromagnetics codes Danilo De Donno * ,, Alessandra Esposito, Giuseppina Monti, Luca Catarinucci and Luciano Tarricone Department of Innovation Engineering, University of Salento, Via per Monteroni, 73100, Lecce, Italy SUMMARY The solution of large and complex electromagnetic (EM) problems often leads to a substantial demand for high-performance computing resources and strategies. This is true for a wide variety of numerical methods and applications, ranging from EM compatibility to radio-coverage, circuit modeling, and optimization of components. In the last decades, graphics processing units (GPUs) have gained popularity in scientic computing as a low- cost and powerful parallel architecture. This paper gives an overview of the main efforts of researchers to port computational electromagnetics (CEM) codes to GPU. Moreover, GPU implementation aspects of two well-known techniques, namely the nite-difference time domain (FDTD) and the method of moments (MoM), are investigated. The impressive speed-ups achieved (up to 60 and 25 for FDTD and MoM, respectively) demonstrate the effectiveness of GPUs in accelerating CEM codes. Copyright © 2012 John Wiley & Sons, Ltd. Received 17 October 2011; Revised 6 March 2012; Accepted 8 May 2012 KEY WORDS: computational electromagnetics (CEM), graphics processing unit (GPU), parallel implementation, nite-difference time domain (FDTD), method of moments (MoM), electromagnetic compatibility, circuit modeling 1. INTRODUCTION Graphics processing units (GPUs) have proven to be a valid pathway for accelerating general purpose scientic problems. The appeal of GPUs derives from the combination of low-cost and huge computational power, which is often driven by the videogame market. The publication of high- level libraries such as NVIDIA Compute Unied Device Architecture (CUDA) [1] and OpenCL [2], which simplify software implementation, is further promoting the adoption of such parallel devices. In the eld of computational electromagnetics (CEM), the use of GPUs has proven to signicantly increase the performance in numerous applications. The nite-difference time-domain (FDTD) method was the rst electromagnetic (EM) numerical algorithm implemented on GPU by Krakiwski et al. in 2004 [3]. From then on, many approaches for solving FDTD on GPUs have been experimented [411], and a commercial release is available as well [12]. Besides the nite-difference frequency-domain method [13], also the nite element method (FEM) [14,15], the transmission line modeling [16], the alternating direction implicit technique [17], and the multilevel fast multipole algorithm [18] have demonstrated efcient performance when implemented on GPUs. The method of moments (MoM) is amenable to benet from this hardware architecture as well. First applications of GPUs to the MoM can be found in [19,20], where the solution of EM scattering problems for radar cross-section calculation is considered. Both works adopt the electric-eld integral-equation (EFIE) formulation, and the GPU is exploited to accelerate the MoM matrix computation and the linear system solution by conjugate gradient method. In [21], a CUDA-based EFIE solver for the analysis of a transverse-magnetic cylinder is presented, whereas in [22], both the impedance matrix assembly and the solution of the MoM system *Correspondence to: Danilo De Donno, Department of Innovation Engineering, University of Salento, Via per Monteroni, 73100, Lecce, Italy. E-mail: [email protected] Copyright © 2012 John Wiley & Sons, Ltd. How to cite this paper: D. De Donno, A. Esposito, G. Monti, L. Catarinucci, and L. Tarricone, “GPU-based Acceleration of Computational Electromagnetics Codes,” International Journal of Numerical Modeling: Electronic Networks, Devices and Fields, Wiley-Blackwell, vol. 26, no. 4, pp. 309-323, July 2013.
Transcript
Page 1: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

GPU-based acceleration of computational electromagnetics codes

Danilo De Donno*,†, Alessandra Esposito, Giuseppina Monti, Luca Catarinucci andLuciano Tarricone

Department of Innovation Engineering, University of Salento, Via per Monteroni, 73100, Lecce, Italy

SUMMARY

The solution of large and complex electromagnetic (EM) problems often leads to a substantial demand forhigh-performance computing resources and strategies. This is true for a wide variety of numerical methods andapplications, ranging from EM compatibility to radio-coverage, circuit modeling, and optimization of components.In the last decades, graphics processing units (GPUs) have gained popularity in scientific computing as a low-cost and powerful parallel architecture. This paper gives an overview of the main efforts of researchers toport computational electromagnetics (CEM) codes to GPU. Moreover, GPU implementation aspects of twowell-known techniques, namely the finite-difference time domain (FDTD) and the method of moments (MoM),are investigated. The impressive speed-ups achieved (up to 60� and 25� for FDTD and MoM, respectively)demonstrate the effectiveness of GPUs in accelerating CEM codes. Copyright © 2012 John Wiley & Sons, Ltd.

Received 17 October 2011; Revised 6 March 2012; Accepted 8 May 2012

KEY WORDS: computational electromagnetics (CEM), graphics processing unit (GPU), parallel implementation,finite-difference time domain (FDTD), method of moments (MoM), electromagnetic compatibility, circuit modeling

1. INTRODUCTION

Graphics processing units (GPUs) have proven to be a valid pathway for accelerating general purposescientific problems. The appeal of GPUs derives from the combination of low-cost andhuge computational power, which is often driven by the videogame market. The publication of high-level libraries such as NVIDIA Compute Unified Device Architecture (CUDA) [1] and OpenCL [2],which simplify software implementation, is further promoting the adoption of such parallel devices.

In the field of computational electromagnetics (CEM), the use of GPUs has proven to significantlyincrease the performance in numerous applications. The finite-difference time-domain (FDTD)method was the first electromagnetic (EM) numerical algorithm implemented on GPU by Krakiwskiet al. in 2004 [3]. From then on, many approaches for solving FDTD on GPUs have been experimented[4–11], and a commercial release is available as well [12]. Besides the finite-difference frequency-domainmethod [13], also the finite element method (FEM) [14,15], the transmission line modeling [16], thealternating direction implicit technique [17], and the multilevel fast multipole algorithm [18] havedemonstrated efficient performance when implemented on GPUs. The method of moments (MoM) isamenable to benefit from this hardware architecture as well. First applications of GPUs to the MoM canbe found in [19,20], where the solution of EM scattering problems for radar cross-section calculation isconsidered. Both works adopt the electric-field integral-equation (EFIE) formulation, and the GPU isexploited to accelerate the MoM matrix computation and the linear system solution by conjugategradient method. In [21], a CUDA-based EFIE solver for the analysis of a transverse-magnetic cylinderis presented, whereas in [22], both the impedance matrix assembly and the solution of the MoM system

*Correspondence to: Danilo De Donno, Department of Innovation Engineering, University of Salento, Via per Monteroni,73100, Lecce, Italy.†E-mail: [email protected]

INTERNATIONAL JOURNAL OF NUMERICAL MODELLING: ELECTRONIC NETWORKS, DEVICES AND FIELDSInt. J. Numer. Model. (2012)Published online in Wiley Online Library (wileyonlinelibrary.com). DOI: 10.1002/jnm.1849

Copyright © 2012 John Wiley & Sons, Ltd.

How to cite this paper: D. De Donno, A. Esposito, G. Monti, L. Catarinucci, and L. Tarricone, “GPU-based Acceleration of Computational Electromagnetics Codes,” International Journal of Numerical Modeling: Electronic Networks, Devices and Fields, Wiley-Blackwell, vol. 26, no. 4, pp. 309-323, July 2013.

Page 2: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

are accelerated for a reference problem concerning scattering from a metallic square plate. Topa et al.accelerated MoM-based simulations of wire-grid models [23] and have recently considered the mixed-potential integral-equation (MPIE) formulation for the solution of a conducting body-wire problem [24].

In all of the aforementioned publications, huge speed-up factors are achieved when the GPUimplementation is compared with the reference CPU code. For instance, looking at the most recentworks, speed-ups of about 20�, 6�, and 30� are reported respectively in FEM [14], MoM [23], andFDTD [11] simulations. A recent trend in GPU computing is the exploitation of multi-GPU clustersfor large-scale simulations. In [25], a 16-GPU cluster is proposed for the acceleration of FDTD withperformance gains up to 29� over an equivalent CPU cluster.

The achievable performance is mainly affected by the process of mapping serial CEM algorithms to theparallel GPU architecture and programming model. It can be claimed that FDTD is the algorithm bestsuited to exploit the GPU architecture because of its inherently parallel nature. Parallelization of matrix-based methods such as the MoM, instead, is less straightforward and implies more challenging issues.MoM’s performance depends on two critical tasks: the computation of the impedance matrix and thesolution of the respective linear system. The former, besides casting performance needs, requires a carefulmanagement of memory resources, and out-of-core solutions [26] could be considered to overcome thewell-known limitations of GPUs in terms of available on-board memory.

These two extreme cases, the matrix-free FDTD and the matrix-based MoM, are used in this workto highlight key points and potentialities of GPU computing in CEM. In our first publication [27],the 2D-FDTD method was used as a case study for demonstrating GPU capabilities. We illustratedsoftware design and implementation efforts required for developing efficient parallel GPU codes byusing CUDA. Because the FDTD amenability for GPU computing is strongly affected by the adoptedboundary conditions (BCs), in this work, we present an extension of [27] by discussing the resultsobtained on three different BCs, namely Mur’s first-order absorbing boundary conditions (ABC)[29], perfect electric conductor (PEC), and perfectly matched layer (PML) ABCs [30]. For the sakeof simplicity, the discussion is referred to a 2D problem of human–antenna interaction, although thevalidity of results can be extended to 3D cases and different applications. As for the MoM, wepropose a CUDA-based acceleration of the two most time-demanding tasks: the impedance matrixcomputation by MPIE formulation and the linear system solution via bi-conjugate gradient stabilized(BiCGSTAB) method. The previously mentioned GPU memory limitations are overcome by adoptinga pre-processing phase that evaluates the possibility of nullifying impedance matrix elements withoutaffecting the solution quality. The high efficiency of the GPU-enabled MoM is experimentallydemonstrated by modeling a branch-line coupler in microstrip technology.

2. GPU PROGRAMMING AND CUDA OVERVIEW

GPUs provide today an inexpensive and powerful computational architecture, with a rate of growthmuch higher than traditional microprocessors [31]. Till a few years ago, GPU programming was a verycomplex task, as it required a deep knowledge of the GPU architecture and the scientific problem underanalysis had to be recast into graphical terms and models by the programmer. Recently, NVIDIA hasgreatly reduced this burden by launching CUDA [1], a software platform for parallel computing onthe company’s GPUs, which provides an interface layer to the GPU hardware from developers. Accord-ing to the CUDA programming model (Figure 1), data-parallel portions of an application are implemen-ted as kernels. Each kernel is executed in parallel by several thread blocks organized into a grid. Themain CPU, acting as the host, can launch one kernel at a time. When the kernel execution is started, datatransfer between host and device (i.e., the GPU) occurs. This is an onerous operation; therefore, kernelsmust be designed with care so that data transfers from host to device and vice versa are minimized.Moreover, threads are executed in groups of 32, called warps. A warp executes a single instruction ata time across all its threads. The threads of a warp should access memory locations sufficiently closetogether, so that per-thread operations can be coalesced for greater memory efficiency. CUDA memorymodel comprises several memory spaces, which differ enormously for latency times, availability ofcache, and so on. The so-called global, texture, and constant are off-chip memories, thus featuring highaccess latency. On-chip sharedmemory and registers, instead, have reduced latency. Shared memory isnormally used when data sharing between threads of the same block is needed. Texture memory buffers

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 3: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

data in a suited cache optimized for 2D spatial locality, thus providing huge performance gains whenthreads read adjacent locations. Another relevant aspect in performance optimization of CUDA applica-tions is the so-called multiprocessor occupancy, which indicates the ratio of active warps to themaximum number of warps supported on a GPU multiprocessor. As the occupancy value depends onthe amount of shared memory and registers used by each thread block, the size of thread blocks and/orshared memory and register usage must be designed with care in order to maximize it.

3. CUDA-ENABLED FDTD METHOD

The FDTD method, proposed by Yee in 1966 [32], is quite well known and, because of its high ver-satility and intuitiveness, is one of the mostly adopted approaches in EM. Indeed, the simulation do-main is spatially partitioned into space points, called ‘Yee’s elementary cells’, and once each ofthem has been characterized in terms of material properties (permittivity, conductivity, and permeabil-ity) and the EM source has been modeled, the FDTD algorithm transforms the time-dependent Max-well’s curl equations into a set of finite-difference relations where space and time derivatives areapproximated by with the use of the central discretization, therefore resulting in second-order accurateexpressions. Assuming, for instance, that rectangular coordinates are used, the generic space point P isidentified with notation (i,j,k). Any space and time function F is indicated with the notation Fn

p i; j; kð Þ,meaning that the function xtitF along the direction p is computed at the time nΔt (Δt is the time step) inthe point (i,j,k). Yee’s cell is reported in Figure 2 and contains representations of the electric (E) andmagnetic (H) fields. The temporal and spatial discretizations adopted in the FDTD algorithm areimplemented at their best to solve Maxwell’s equations by using a leap-frog integration scheme. Attime step t= nΔt+ 1/2 and in the mesh point (i,j,k), each component Hn+ 1/2(i, j, k) is computed as a

Figure 1. CUDA programming model.

Figure 2. Elementary Yee’s cell.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 4: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

function of the previous value Hn� 1/2(i, j, k) in the same point, plus a function of xtitE components attime t= nΔt in the mesh points belonging to the neighborhood of (i,j,k). Similar computations areperformed for computing E components. In the simulation of real problems, BCs are applied to emulateboth infinite and open regions [29,30]. The result is a frame-by-frame representation of the EM fieldeither propagating or being scattered and absorbed by the objects.

The main drawback of FDTD methods is undoubtedly the requirements in terms of computationalresources. In fact, the discretization step should be adequately fine with respect to the smallest wave-length, and moreover, it should provide a rigorous representation of each simulated element (EMsources, obstacles, targets, and so on). In some cases, this implies very large simulation domainsand, consequently, huge storage capability and high CPU power. For this reason, although introducedin 1966, the FDTD method has started to be adopted only since the late 1990s with the advent ofparallel computing. In the following years, as more and more powerful computers were placed onthe market, it has become one of the most used full-wave EM solver. In such a scenario, the use ofGPUs as elementary computational nodes for updating the EM field seems to be the natural nextstep. The typical FDTD algorithm may be described by the following pseudo-code:

for each time iteration dofor each cell doif cell is at the border then

Apply Boundary Conditionselse

Update Field Valuesend if

end forend for

In the GPU-enabled implementation proposed here, the outer loop is kept on the host CPU whereas theinner loop disappears as the calculations over the cells are operated in parallel by CUDA threads.Figure 3 shows the flowchart of the GPU-FDTD code where EM fields and BCs are evaluated by CUDAkernels running on the GPU.

3.1. Field calculation

We consider the computation of electric and magnetic field components in a bidimensional xy squaredomain. The generalization to 3D cases can be easily performed by iterating the proposed approachover the third (z) dimensions already reported in [28]. In the addressed 2D case, two CUDA kernelsperform the field calculation as depicted in Figure 3. More specifically, the first kernel computesHz whereas the second updates Ex, Ey, and the excitation source. As shown in Figure 4, the adoptedstrategy maps each thread to Yee’s cell and each thread block to a set of contiguous cells. In thisway, the overall spatial domain is wrapped by the CUDA grid of thread blocks.

Figure 3. Flowchart of the CUDA-enabled FDTD.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 5: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

The equation to update the H field component along z at the grid position (i,j) is given by:

Hn�1=2z i; jð Þ ¼ Hn�1=2

z i; jð Þ � ΔtmΔ

Eny iþ i; jð Þ � En

y i; jð Þ � Enx i; jþ 1ð Þ þ En

x i; jð Þh i

(1)

where Δt is the time step, m is the magnetic permeability, and Δ=Δx=Δy is the size of the Yee’s cells.Similar equations are required for the computation of E field. Because of the leap-frog scheme, eachcomponent E (H) depends on the value of H (E) at the neighboring cells. This sort of data sharingbetween adjacent thread blocks was optimally addressed by loading all the needed components, includingtheones corresponding to adjacent blocks, into the GPU shared memory as shown in Figure 5.

3.2. Boundary conditions

We first refer to PEC conditions by which electric field components parallel to the PEC interface takezero value on the boundaries. For these particular BCs, it is not necessary to add any kernel, as the zerovalue assignment is straightforward and can be performed during the field computation. As will beexplained in the succeeding texts, quite more critical is the CUDA implementation of more sophisticatedABC, such as Mur’s and PML ABCs.

3.2.1. Mur’s first-order ABCs. The popular Mur’s ABCs [29] are based on finite-differenceapproximations. The first-order Mur’s ABCs compute the transverse electric components along the borderof the spatial domain according to the following equations:

Figure 4. Mapping between real domain and CUDA grid of thread blocks.

Figure 5. Calculation of Hz field components: data sharing among thread blocks.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 6: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

Enþ1x i; 1ð Þ ¼ En

x i; 2ð Þ þ m Enþ1x i; 2ð Þ � En

x i; 1ð Þ� �(2)

Enþ1x i;NYð Þ ¼ En

x i;NY � 1ð Þ þ m Enþ1x i;NY � 1ð Þ � En

x i;NYð Þ� �(3)

Enþ1y 1; jð Þ ¼ En

y 2; jð Þ þ m�Enþ1y 2; jð Þ � En

y 1; jð Þ� (4)

Enþ1y NX; jð Þ ¼ En

y NX � 1; jð Þ þ m�Enþ1y NX � 1; jð Þ � En

y NX; jð Þ� (5)

where a rectangular domain of NX�NY cells has been considered, and m= (cΔt�Δ)/(cΔt+Δ) is the Murcoefficient (c is the speed of light).

In the implemented CUDA-based 2D-FDTD code, when the ABCs are computed for cells alongthe x-axis, best performance is achieved because data reside in contiguous regions of the GPU globalmemory (Figure 6(a)). This gives rise to coalesced memory accesses, that is, data are aggregated, thusreducing the total number of memory operations. On the contrary, when the ABCs are computedfor cells along the y-axis, non-contiguous accesses to memory occur and unwanted overhead in theexecution time of the kernel is introduced. Moreover, the available GPU resources are under-exploitedbecause of the partial mapping between Mur’s domain and CUDA thread blocks.

3.2.2. Perfectly matched layer ABCs. PML approach considers several layers of border cells where thefield is computed by suited equations [30]. According to Berenger’s split-field formulation, four fieldcomponents must be computed for each PML cell, as Hz is split into two components, namely Hzx

and Hzy. In the CUDA-based implementation, the spatial domain at the border layers is divided intofour regions: front, back, left, and right as in Figure 6(b). Each region is assigned to two kernels,one for the computation of E components, the other for Hzx and Hzy. Therefore, eight kernels arenecessary to compute the PML ABCs. The availability of several layers at the borders allows for abetter exploitation of GPU resources, thus maximizing multiprocessor occupancy and providingfaster access to global memory.

3.3. Numerical results

A practical application of the CUDA-based 2D-FDTD algorithm is presented here. We consider an EMcompatibility problem concerning the analysis of a half-wave dipole antenna radiating in the vicinity ofa human body. The dipole has been modeled by means of two metal arms fed by a sinusoidal source(hard source). A metal reflector one-quarter wavelength behind the dipole has also been added in orderto improve the directional characteristics of the antenna. The working frequency is set to 900MHz;a well-known numerical phantom [33] reproduces tissues and forms of the human body. The consid-ered spatial discretization step is Δ = 3 mm and the usual Courant condition Δt≤Δ= c

ffiffiffi2

p� �[34] is ap-

plied to determine the time step needed to obtain algorithm convergence. The code was tested on aninexpensive GPU, that is, the CUDA-compatible NVIDIA GeForce GTX 260 GPGPU, featuring 24streaming multiprocessors (192 processor cores) and 896MB of global memory. CUDA 4.0 toolkit

(a) (b)

Figure 6. Memory access and domain partitioning for Mur’s (a) and PML (b) ABCs.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 7: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

and optimized drivers for Ubuntu 10.10 32-bit O.S. were used. As for the CPU side, an equivalentsingle-threaded 2D-FDTD code is considered for benchmarking. The code was compiled by GCC 4.4and run on a single core of an Intel Core2 Quad CPU Q9550 at 2.83GHz. Spatial domains containingup to 5200� 5200 cells (the maximum size allowed by the available GPU memory space) were testedfor 1000 time iterations. All calculations were performed in double-precision arithmetic, which allowsfor about 10� 8 accuracy of the GPU results compared with those from the reference CPU code.

Figure 7(a) shows the achieved speed-ups for the parallel 2D-FDTD code with respect to theequivalent serial algorithm running on the host CPU. The speed-ups increase with the problem sizebecause of the better exploitation of GPU resources and multiprocessor occupancy. In fact, on the basisof the considered mapping between cells and CUDA threads, some GPU multiprocessors might be idleor underutilized in small-size problems. In spite of its highest computational complexity, PML ABCsobtain the maximum benefit from GPU parallelization, achieving a speed-up of about 60�. The GPUspeed reported in Figure 7(b) represents the number of computed cells per second and is obtained bythe following equation:

Speed MCells=s½ � ¼ N2�nit106�T (6)

where N is the number of cells along the axes (assuming a square domain with N2 cells), nit are thetime iteration steps, and T is the execution time of the algorithm. The output of the CUDA-enabled2D-FDTD code is depicted in Figure 8 where the distribution of the electric field and its interactionwith the numerical phantom are shown. Note that in addition to the electric and magnetic field distribu-tion over the entire human body, our 2D-FDTD algorithm performs an off-line processing to evaluatedosimetric parameters, for example, the specific absorption rate.

(a) (b)

Figure 7. Achieved speed-ups (a) and GPU speed (b) for the FDTD code with different boundary conditions.

Figure 8. Example of human–antenna interaction: electric field distribution calculated by the 2D-FDTD code run-ning on the GPU.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 8: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

4. CUDA-ENABLED MoM

Efficient modeling of printed circuits, antennas, and components is crucial in current microwaveengineering. One of the most accurate techniques in this area is the MoM, which transforms integral-differential Maxwell’s equations into a linear system of algebraic equations. Unfortunately, theadvantages of MoM are blemished by its high demands of computer resources. In fact, the numericalcore of the method is represented by two main tasks: First, Maxwell’s integral-equation formulationis applied to the problem under analysis and second, the corresponding linear system is solvedby well-known algebraic solvers. In this work, a summary of our recent publications on GPU-basedacceleration of the MoM [35–37] for the analysis of microstrip circuits is presented. Moreover, wepropose a preliminary implementation of the BiCGSTAB solver on GPU. The achieved performanceshows impressive speed-ups over the CPU version of the solver that makes use of the commercialmulti-core Intel MKL library [38]. The high efficiency of our code is also demonstrated by comparisonswith the CUDA-based library for sparse matrix computations CUSP [39].

4.1. MPIE formulation

We discuss the GPU-enablement of an MPIE/MoM formulation based on papers [40,41] and enhancedby one of the authors in [42–44]. This formulation is now shortly recalled for the sake of clarity.

We consider N-port planar circuits with infinite transverse dimensions for both the dielectric andground plane; the metallization thickness is assumed negligible. We adopt the MPIE formulation,solved by considering closed-form Green’s functions in the spatial domain and by using the MoM.The evaluation of the Green’s functions in closed form is performed as suggested in [41]:

GAxx ¼ GA

xx;0 þ GAxx;sw þ GA

xx;ci

Gq ¼ Gq0 þ Gq

sw þ Gqci

(7)

that is, as the sum of direct terms and quasi-dynamic images GAxx;0;G

q0

� �, surface waves GA

xx;sw;Gqsw

� �,

and complex images GAxx;ci;G

qci

� �. We used Galerkin’s MoM to discretize the relevant equations, by

selecting rooftop functions defined over elementary rectangular domains. This way, a linear systemis derived from the MPIE:

Zxx ZxyZyx Zyy

IxIy

¼ Vx

Vy

(8)

where the unknowns Ix and Iy are the (complex) amplitudes of the basis functions, the right-hand-side(RHS) vector depends on the excitation applied to the microstrip network, and the entries Zij in theimpedance matrix are expressed by a fourfold integral in the spatial variables of the source and testcoordinates (Figure 9). In the implemented MoM, this integration has been reduced to a quasi-1Dintegral [42] by means of an analytical pre-processing, which exploits the circular symmetry of GA

and Gq. The Z-matrix terms can be written as:

Figure 9. Reference system and relative changes of coordinates.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 9: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

Zxx ¼Rr W1x rð ÞGA

xx rð Þ � 1o2

W2x rð ÞGq rð Þ

dr

Zxy ¼Rr � 1

o2W3x rð ÞGq rð Þ

dr

Zyx ¼Rr � 1

o2W3y rð ÞGq rð Þ

dr

Zyy ¼Rr W1y rð ÞGA

xx rð Þ � 1o2

W2y rð ÞGq rð Þ

dr

(9)

whereas the spatial-domain mixed-potential Green’s functions are calculated according to (7) and theterms W(r) are given by:

W rð Þ ¼Z x2 rð Þ

x1 rð ÞS rcosx; rsinxð Þdx (10)

More details about the calculation of the bidimensional convolution S(u, v) are reported in [42].

4.2. CUDA implementation

Figure 10 shows the flowchart of the implemented MoM. It is composed of five blocks, four of which(the gray highlighted ones) exploit the GPU processing power. The first block maps the circuit domaininto a rectangular mesh. Then, the impedance matrix is computed for the maximum frequency in theanalyzed range. A thresholding process evaluates the possibility of converting the computed matrixinto a sparse one, while respecting a given error tolerance on the final system solution. Finally, for eachfrequency, the impedance matrix is assembled and the BiCGSTAB solver invoked.

The CUDA kernel in charge of the impedance matrix computation is devoted to parallelize thecalculation of the integrals reported in (9). Such an operation may be described by the following serialpseudo-code: each cell each r Update Z values where the inner loop refers to numerical quasi-1Dintegration. The outer loop disappears in the CUDA-enabled implementation as the calculations overthe cells are operated in parallel by CUDA threads. The mapping between current cells in the circuitand CUDA thread blocks is depicted in Figure 11 whereas more details about the implemented codecan be found in [36].

Once the impedance matrix is computed, we evaluate whether a reduced number of matrix elementsis enough to solve the system in (8) with adequate accuracy. In a previous work [43], it was demonstrated

Figure 10. Flowchart of the implemented MoM.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 10: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

experimentally that, in many cases, the initial dense matrix can be reduced to a significantly sparseone by neglecting entries smaller than a fixed threshold value. Moreover, in [44], it was shown thatdirect terms, surface waves, and complex images appearing in the spatial domain closed-form Green’sfunctions can be neglected without loss of accuracy, according to the geometrical parametrization andthe distance between basis and test functions. When a circuit must be modeled in a certain frequencyrange, the matrix sparsity can be preserved at every frequency, if the appropriate threshold is evaluated atthe maximum frequency value. Therefore, thresholding can be executed only once, thus minimizing itsimpact on the overall performance. The obtained sparse matrix is converted into the compressedrow storage (CRS) format, which uses three 1D arrays to store non-zero elements, column indices,and pointers to the first entry of each row. This format is well suited for the GPU, where the amount ofavailable memory is limited and memory accesses should be as regular as possible in order to increasethe efficiency.

A complex-sparse BiCGSTAB solver was implemented on GPU to solve the linear system in (8).Even if a CUDA-enabled BiCGSTAB was recently made available by the open-source CUSP library[39], we decided to not rely on CUSP and develop our own solver from scratch. The general pre-conditioned BiCGSTAB method is resumed in Figure 12, where hx, yi= (x*)T � y (T and the asteriskdenote respectively the transpose matrix and the complex conjugate operations). We chose a simpleJacobi’s preconditioner, also known as diagonal preconditioner: in this case, M in Figure 12 is a vectorcontaining the diagonal of the system matrix. Convergence is obtained when the 2-norm of the residualr, divided by the 2-norm of the RHS b, is below a certain e (values of e commonly reported in literaturerange from 10� 6 to 10� 8).

Figure 11. Mapping between CUDA grid and circuit domain.

Figure 12. Preconditioned BiCGSTAB algorithm.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 11: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

In the developed CUDA-enabled BiCGSTAB, the main loop controlling the convergence behavioris kept on the CPU, whereas the computations inside are performed on the GPU. Four kernels are incharge of the operations carried out in the main loop, that is, xtitSparse Matrix–vector multiplication(SpMV), dot product of vectors, element-wise product of vectors, axpy (ax+ y), and axpby (ax+by)—a and b are complex scalars, and x and y are vectors. The SpMV kernel implements a modifiedversion of the Bell and Garland algorithm [45]. We adapted it in order to tackle double-precisioncomplex data and replicated the sophisticated optimization strategies therein proposed, such as loopunrolling and shared memory exploitation. Memory accesses were optimized according to the storageformat, in particular one warp was assigned to each matrix row in the CRS format. The CUDA kernelimplementing the dot product is an adaption and generalization of the well-known parallel reductionalgorithm proposed by Harris et al. [46]. Such code is appreciated for its efficiency due to advancedoptimization strategies. Element-wise product, axpy, and axpby routines were implemented fromscratch. In this way, we could aggregate multiple calls in the same kernel and reduce the overheaddue to host–device communications.

4.3. Numerical results

As a reference problem, we consider the analysis of microstrip branch-line couplers, which are four-port devices widely adopted in microwave and millimeter-wave applications such as power dividersand combiners. More specifically, the analyzed layout consists of two branch-line couplers connectedby means of a 360∘ microstrip line and operating in the 2.5–3.5-GHz frequency band (see Figure 13 forthe layout geometry). We first validated the tool efficacy by comparing our results with those providedby a well-known commercial full-wave simulator based on MoM, that is, the ADS Momentum tool [47].Then, a performance analysis was conducted by comparing the execution times of our GPU-enabled codewith the equivalent serial version running on the host CPU adopting the Intel MKL 10.3 library.

The code was tested on the same GPU considered for the FDTD experiments, that is, the CUDA-compatible NVIDIA GeForce GTX 260 GPGPU, featuring 24 streaming multiprocessors (192processor cores) and 896MB of global memory. The CUDA toolkit v.4.0 and optimized driversfor Linux Ubuntu 10.10 32-bit O.S. were used. As for the CPU side, the code was compiled byGCC 4.4 and run on an Intel Core2 Quad CPU Q9550 at 2.83GHz. Calculations on both host anddevice were performed with the use of double-precision complex arithmetic. The thresholding analysisdemonstrated how the impedance matrix for the considered circuit can be significantly sparsified.Figure 14 shows the relationship between the error on the S-parameters (secondary y-axis) and thethreshold value of the matrix coefficients. Numerical errors are still negligible (less than 3%) whenall entries smaller than 10� 5 � Zmax (Zmax being the maximum entry in the impedance matrix) arezeroed. The matrix sparsity is about 95% in such case, and the S-parameters calculated by our codeperfectly agree with those provided by the MoM-based ADS Momentum simulator (Figure 15), thusdemonstrating the accuracy and validity of the proposed approach.

Figure 13. Geometry of the analyzed branch-line coupler.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 12: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

Figure 16 shows the performance attained by the CUDA-based MPIE/MoM. When a single fre-quency point is considered (refer to Figure 16(a)), the impedance matrix computation on GPU is about18 times faster than the computation on CPU for the maximum solvable problem size (12 000� 12 000entries). After thresholding, the 95% sparse system is solved by BiCGSTAB method: The proposedCUDA-enabled solver achieves a maximum speed-up of 12� over the Intel MKL-based one. More-over, our algorithm outperforms the CUSP BiCGSTAB code by a factor of 2. Figure 16(b) summarizesthe aggregated speed-ups (matrix computation + thresholding + system solution) when a frequencyanalysis is conducted for a problem size of 12 000 unknowns. As shown, the impact of thresholdingon the overall performance is really negligible when more than 100 frequency points are considered(recall that matrix analysis is performed once at the maximum frequency value). This situation is rathercommon, both during standard frequency analysis of components and, above all, when performing the

Figure 14. Thresholding of the impedance matrix: sparsity versus error on the S-parameters.

Figure 15. Modulus of the branch-line coupler S-parameters: comparison between ADS Momentum andGPU-enabled MPIE/MoM.

(a) (b)

Figure 16. Achieved speed-ups for a single run (a) and for frequency analysis (b) of the MPIE/MoM when theproposed or CUSP BiCGSTAB is adopted.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 13: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

optimization of components, especially if iterative methods are adopted. In the case reported here, thespeed-ups over the reference CPU code stabilize at 20� and 25� when respectively the CUSP and theproposed BiCGSTAB solvers are adopted. Note that such speed-ups cannot be directly compared withthose of the FDTD, which are three times higher because of the different computational complexity—matrix-free (FDTD) versus matrix-based (MoM) algorithm.

5. CONCLUSIONS

The impressive momentum coming from video game industry is continuously enhancing the computa-tional power of graphics processors (GPUs), without increasing their cost. Moreover, GPU exploitationhas recently been facilitated by the release of high-level libraries such as NVIDIA CUDA, simplifyingsoftware implementation. Several methods for CEM have been successfully parallelized on GPU, andhuge speed-ups have been reported in literature. In this work, the GPU implementation of two differentCEM algorithms has been investigated: the matrix-free FDTD method and the matrix-based MoM.As for the former, an electromagnetic-compatibility problem has been considered along with threewell-known BCs, namely PEC, Mur’s, and PML. The GPU code, developed by CUDA, has shownimpressive accelerations over the serial algorithm running on the host CPU, and speed-up factors upto 60 for PML absorbing conditions have been reported. As for the latter, the two most time-demandingtasks of the MoM have been accelerated on a commodity CUDA-capable GPU: the MPIE-basedimpedance matrix computation and the linear system solution. This last point has been handled byimplementing the sparse-complex BiCGSTAB solver. The stringent memory requirements have beenovercome by a thresholding process, which reduces the initially dense matrix to a significantly sparseone. The GPU-enabled MoM has been tested on a microstrip branch-line-coupler circuit, and besidesthe perfect agreement with a commercial simulator, a speed-up of 25� has been achieved over anequivalent CPU code.

REFERENCES

1. NVIDIACorporation. CUDAZone—the resource for CUDA developers,Online: http://www.nvidia.com/cuda/

2. KhronosGroup,OpenCL.2009,Online:http://www.khronos.org/opencl/

3. Krakiwsky S, Turner L, OkoniewskiM. Graphics processor unit (GPU)acceleration of finite-difference time-domain (FDTD) algorithm Proceed-ings of the 2004 InternationalSymposium on Circuits and Systems,2004; 265–268.

4. Inman M, Elsherbeni A, Smith C.FDTD calculations using graphicalprocessing units. IEEE/ACES Inter-national Conference on WirelessCommunications and Applied Com-putational Electromagnetics, 2005;728–731.

5. Adams S, Payne J, Boppana R.Finite difference time domain(FDTD) simulations using graphicsprocessors,High Performance Com-puting Modernization Program UsersGroup Conference. June 2007;334–338.

6. Valcarce A, Roche GDL, Zhang J.A GPU approach to FDTD for ra-dio coverage prediction. 11th IEEESingapore International Conferenceon Communication Systems, 2008;1585–1590.

7. Balevic A, et al. Accelerating simu-lations of light scattering based on

finite-difference time-domain methodwith general purpose GPUs. 11thIEEE International Conference onComputational Science and Engi-neering, 2008.

8. Unno M, Inoue Y, Asar H.GPGPU-FDTD method for 2-dimensional electromagnetic fieldsimulation and its estimation, IEEE18th Conference on Electrical Per-formance of Electronic Packagingand Systems, 2009; 239–242.

9. Sypek P, Dziekonski A, MrozowskiM. How to render FDTD computa-tions more effective using a graphicsaccelerator. IEEE Trans Magn,2009; 45(3):1324–1327.

10. Demir V, Elsherbeni AZ. Computeunified device architecture (CUDA)based finite-difference time-domain(FDTD) implementation. Journal ofthe Applied Comp. EM Society(ACES) April 2010; 25(4): 303–314.

11. Ong CY, et al. Speed it up, IEEEMicrowave Mag, April 2010; 11(2):70–78.

12. Acceleware Corp. Online: http://www.acceleware.com/fdtd-solvers/

13. Zainud-Deen SH et al. Electro-magnetic scattering using GPU-based finite difference frequencydomain method. PIER B 2009;16:351–369.

14. Kakay A, Westphal E, Hertel R.Speedup of FEM micromagneticsimulations with graphical processing

units. IEEE Trans Magn 2010; 46(6):2303–2306.

15. Godel N, Nunn N, Warburton T,Clemens T. Scalability of higher-order discontinuous GalerkinFEM computations for solvingelectromagnetic wave propaga-tion problems on GPU clusters.IEEE Trans Magn August 2010;46(8);3469–3472.

16. Rossi F, So PPM. Hardware acceler-ated symmetric condensed nodeTLM procedure for NVIDIA gra-phics processing units. 2009 IEEEInternational Symposium on Anten-nas and Propagation and USNC/URSI National Radio Science Meet-ing (APSURSI 2009), June 2009.

17. Stefanski TP, Drysdale TD. Accel-eration of the 3D ADI-FDTDmethod using graphics processorunits. IEEE MTT-S InternationalMicrowave Symposium Digest,2009.

18. Xu K, Ding DZ, Fan ZH, Chen RS.Multilevel fast multipole algorithmenhanced by GPU parallel techniquefor electromagnetic scattering pro-blems. Microwave Opt Technol LettMarch 2010; 52:502–507.

19. Chen R, Xu K, Ding J. Accelerationof MoM Solver for Scattering UsingGraphics Processing Units (GPUs).Wireless Technology Conference.Oriental Institute of Technology,Taipei, 2008.

GPU-BASED ACCELERATION

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm

Page 14: GPUbased acceleration of computational electromagnetics codesdedonno.unisalento.it/papers/ijnm_gpu_preprint.pdf · boundary conditions (BCs), in this work, we present an extension

20. Peng S, Nie Z. Acceleration of themethod of moments calculationsby using graphics processing units.IEEE Trans Antennas Propag2008; 56(7):2130–2133.

21. Killian T, Faircloth DL, Rao SM.Acceleration of TM cylinder EFIEwith CUDA. 2009 IEEE Interna-tional Symposium on Antennasand Propagation and USNC/URSINational Radio Science Meeting(APSURSI 2009), June 2009.

22. Lezar E, Davidson DB. GPU-accelerated method of momentsby example: monostatic scattering.IEEE Antennas Propag MagDecember 2010; 52(6):120–135.

23. Topa T, Karwowski A, Noga A.Using GPU with CUDA to acceler-ate MoM-based electromagneticsimulation of wire-grid models.IEEE Antennas Wirel Propag Lett2011; 10:342–345.

24. Topa T, Noga A, Karwowski A.Adapting MoM with RWG basisfunctions to GPU technology usingCUDA. IEEE Antennas WirelPropag Lett 2011; 10:480–483.

25. Ong C, Weldon M, Cyca D,Okoniewski M. Acceleration oflarge-scale FDTD simulations onhigh performance GPU clusters.2009 IEEE International Symposiumon Antennas and Propagation andUSNC/URSI National Radio ScienceMeeting (APSURSI 2009), June 2009.

26. Zhao XW, et al. Parallel MoM-POmethod with out-of-core techniquefor analysis of complex arrays onelectrically large platforms. PIER2010; 108:1–21.

27. De Donno D, Esposito A, TarriconeL, Catarinucci L. Introduction toGPUcomputing andCUDAprogram-ming: a case study on FDTD, IEEEAntennas Propag Mag June 2010;52(3):116–122.

28. Webb CJ, Bilbao S. Virtual roomacoustics: a comparison of techniquesfor computing 3D-FDTD schemes

using CUDA. 130th Audio Engineer-ing Society Convention, London, UK,May 2011.

29. Mur G. Absorbing boundary condi-tions for the finite-difference ap-proximation of the time-domainelectromagnetic-field equations, IEEETrans Electromagn Compat 2007;EMC-23(4):377–382.

30. Berenger JP. A perfectly matchedlayer for the absorption of EMwaves. J Comput Phys 1994;114:185–200.

31. Nickolls J, Dally W. The GPUcomputing era. IEEE Micro 2010;30(2):56–59.

32. Yee K. Numerical solution ofinitial boundary value problemsinvolving Maxwell’s equations inisotropic media. IEEE Trans Anten-nas Propag 1966; 14(3):302–307.

33. Catarinucci L, Palazzari P,Tarricone L. Human exposure tothe near-field of radiobase anten-nas: a full-wave solution usingparallel FDTD. IEEE Trans Micro-wave Theory Tech 2003; 51(3):935–941.

34. Taflove A, Hagness SC. Computa-tional Electrodynamics (2nd Ed).Artech House: Boston, 2000.

35. De Donno D, Esposito A, MontiG, Tarricone L. Parallel efficientmethod of moments exploitinggraphics processing units. Micro-wave Opt Technol Lett November2010; 52(11):2568–2572.

36. De Donno D, Esposito A, Monti G,Tarricone L. GPU-based accelera-tion of MPIE/MoM matrix calcula-tion for the analysis of microstripcircuits. 5th European Conferenceon Antennas and Propagation(EuCAP), Rome, Italy, April 2011.

37. De Donno D, Esposito A, Monti G,Tarricone L. Iterative solution oflinear systems in electromagnetics(and not only): experiences withCUDA. In UnConventional HighPerformance Computing, Lecture

Notes in Computer Science (LNCS),Vol. 6586. 2011.

38. Intel. Math Kernel Library (IntelMKL) 10.3. Online: http://software.intel.com/en-us/articles/intel-mkl/

39. CUSP Library v0.2.0. Online: http://code.google.com/p/cusp-library/

40. Aksun MI, Mittra R. Derivationof closed-form Green’s functionsfor a general microstrip geometry.IEEE Trans Microwave TheoryTech 1992; 40:2055–2062.

41. Aksun MI, Mittra R. Choices ofexpansion and testing functionsfor the method of moments ap-plied to a class of electromagneticproblems. IEEE Trans MicrowaveTheory Tech 1993; 41:503–508.

42. Tarricone L, Mongiardo M, CervelliF. A quasi-one-dimensional integra-tion technique for the analysis ofplanar microstrip circuits viaMPIE/MoM. IEEE Trans Micro-wave Theory Tech March 2001;49:517–523.

43. Cervelli F, Mongiardo M, TarriconeL. An impedance matrix transfor-mation for planar circuit integralequation solvers. IEEE MTT-S Inter-national Microwave SymposiumDigest, June 1998; 1559–1562.

44. Cervelli F, Mongiardo M, TarriconeL. Efficient phenomenologically-based 1-D evaluation of theimpedance matrix in a MPIE analy-sis of planar microstrip circuits.IEEE MTT-S International Micro-wave Symposium Digest, 1998;1735–1738.

45. Bell N, Garland M. Efficient sparsematrix–vector multiplication onCUDA. NVIDIA Technical Report,NVR-2008-004, NVIDIA Corpora-tion, December 2008.

46. Harris M, Sengupta S, Owens JD.Parallel prefix Sum (scan) withCUDA. In GPU Gems 3, Nguyen H(ed.). Addison Wesley, August 2007.

47. ADS-Momentum. Online: http://www.home.agilent.com/

AUTHORS’ BIOGRAPHIES

Danilo De Donno was born in Lecce, Italy, in 1983. He received the B.Sc. and M.Sc.degrees (cum-laude) in Telecommunication Engineering from the Politecnico di Milano,Italy, in 2005 and 2008 respectively. He received his Ph.D. in Information Engineeringin 2012 at The University of Salento, Lecce, Italy. From July to December 2011 he wasa visiting researcher at the School of Electrical and Computer Engineering of The GeorgiaInstitute of Technology in Atlanta, Georgia, USA. He is currently Post-Doc at the Innova-tion Engineering Department of The University of Salento. His research interests includethe design of parallel electromagnetics algorithms on graphics processors (GPUs), RFIDsystems, Computational RFID (CRFID), and Software-Defined Radio experimentation.

D. DE DONNO ET AL.

Copyright © 2012 John Wiley & Sons, Ltd. Int. J. Numer. Model. (2012)DOI: 10.1002/jnm


Recommended