• 検索結果がありません。

A Multi-GPU Implementation of a Parallel Solver for Incompressible Navier-Stokes Equations Discretized by Stabilized Finite Element Formulations (Numerical Analysis : New Developments for Elucidating Interdisciplinary Problems II)

N/A
N/A
Protected

Academic year: 2021

シェア "A Multi-GPU Implementation of a Parallel Solver for Incompressible Navier-Stokes Equations Discretized by Stabilized Finite Element Formulations (Numerical Analysis : New Developments for Elucidating Interdisciplinary Problems II)"

Copied!
4
0
0

読み込み中.... (全文を見る)

全文

(1)

A Multi‐GPU

Implementation

of

a

Parallel

Solver for

Incompressible

Navier‐Stokes

Equations

Discretized

by

Stabilized Finite Element Formulations

HUYNH

Quang Huy Viet,

SUITO

Hiroshi

Graduate

School of

Environmental and Life

Science,

Okayama

University

E‐‐mail: hqhviet\emptysetokayama−u.ac.jp, suito@okayama‐u.ac.jp

1

Introduction

For

solving partial

differentialequations

problems

in

Computational

Fluid

Dynamics

(CFD),

finite ele‐

ment methodsareconventional numerical methods thatare

particularly

used because of theiraccuracy.

In

solving

the Navier‐Stokes

(NS)

equations

using

finite element methods for simulation ofincompress‐

ible

flows,

some instabilitiesarise fromthepresenceof advectionterms or the

high Reynolds

number.

Hughes

and

Tezduyar

etal.

[1,

2, 3,

4]

proposed

stabilized finite element formulations for

incompressible

flows. Stabilizationin

solving

Navier‐Stokesequations isachieved

by adding

twostabilizationterms to the Galerkin formulations of the Navier‐Stokes equations. The first stabilizationtermis the streamline

upwind

/\mathrm{P}\mathrm{e}\mathrm{t}\mathrm{r}\mathrm{o}\mathrm{v}

‐Galerkin

(SUPG)

term. The second stabilizationtermisthepressure

stabilizing/Petrov‐

Galerkin

(PSPG)

term. This stabilizedfiniteelement method has been showntobeveryeffective for the simulationofincompressibleflows.

Inengineering

applications,

when

computational

conditions become

stiff,

NS solvers

might

not con‐

verge tosolutions withinanallowed time limitation. Thereforeit is necessaryto

develop

fast andaccurate NS solvers

using

parallel processing techniques. Traditionally, parallel

NS solvers are

developed

using

supercomputersorPC clusters with

parallel programming platforms

suchas

OpenMP

andMPI.

Recently,

because modern

graphics processing

units

(GPUs)

havemany processorsorcores, GPU

computing

has

been

recognized

as a

powerful platform

to achieve

high performance

insimulation and

modeling

inthe

CFD. GPU

computing

istheuseof GPUsin associationwith theuseof CPUsto

speed

up

computations.

A

desktop

machineor aworkstation witha

powerful

GPU inside canachieve

extremely high

levels of

performance

forcomputationand simulation. Thenecessityexiststo

develop parallel

NS solversonGPUs

forvarious

engineering applications.

In arecentreport

[5],

we

briefly

described our

implementation

of asolver based onthe GPBi‐CG

algorithm

for 3\mathrm{D}

unsteady

Navier‐Stokes equations discretized

by

the SUPG

/

PSPG stabilized finite

elementformulationusinga

single

GPU.In this paper, wereporta newmulti‐GPU

implementation

of the solver and shows

performance

results.

2

Stabilized

Finite Element Formulations

2.1

Governing Equations

We consider the

following

dimensionless form of the Navier‐Stokesequationsina

spatial

domain

$\Omega$\subset \mathrm{R}^{3}

:

\displaystyle \frac{\partial u_{i}}{\partial t}+u_{j}\frac{\partial u_{i}}{\partial x_{j}}=-\frac{\partial p}{\partial x_{i}}+\frac{1}{Re}\frac{\partial}{\partial x_{j}}(\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial u_{j}}{\partial x_{i}})

in $\Omega$,

(1)

\displaystyle \frac{\partial u_{i}}{\partial x_{i}}=0

in $\Omega$.

(2)

Here,

we

adopt

the summation conventionon

repeated

indices that have values 1, 2, and 3. The

x,y,z axesinthe Cartesian coordinatesystemare

designated

asx_{i}, i = 1

,

2,

3. Here,u_{i} representsthe

componentof the

velocity

vectorfield\mathrm{u}in the

i^{th} dimension,

pstands for the scalarpressure

field,

and

Re denotes the

Reynolds

number.

Letus discretize the

spatial

domain $\Omega$

by

elements

$\Omega$^{e},

e= 1

,2\ldots,n_{\mathrm{e}l}. Let

S_{\mathrm{u}},

\mathcal{V}_{\mathrm{u}} be the trial and

testfunctionspacesfor

velocity

and

S_{p}, \mathcal{V}_{p}

(\mathcal{V}_{p}=S_{p})

be trial andtest functionspacesforpressure. The stabilized finite element formulation of theequations

(1)-(2)

with the SUPG

/

PSPG stabilizationterms

canbe

expressed

asfollows

[1]:

Find\mathrm{u}\in S_{\mathrm{u}} and

p\in S_{p}

such that\forall \mathrm{w}\in \mathcal{V}_{\mathrm{u}}and

\forall q\in \mathcal{V}_{p}

:

数理解析研究所講究録

(2)

\displaystyle \int_{ $\Omega$}w_{i}(\frac{\partial u_{i}}{\partial t}+\overline{u}_{j}\frac{\partial u_{i}}{\partial x_{j}})d $\Omega$-\int_{ $\Omega$}\frac{\partial w_{i}}{\partial x_{i}}pd $\Omega$+\int_{ $\Omega$}\frac{1}{Re}\frac{\partial w_{i}}{\partial x_{j}}(\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial u_{j}}{\partial x_{i}})d $\Omega$

+\displaystyle \sum_{e=1}^{n_{\mathrm{e}1}}\int_{$\Omega$_{\mathrm{e}}} $\tau$\overline{u}_{k}\frac{\partial w_{i}}{\partial x_{k}}(\frac{\partial u_{i}}{\partial t}+\overline{u}_{j}\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial p}{\partial x_{i}})d $\Omega$=0

,

(3)

\displaystyle \int_{ $\Omega$}q\frac{\partial u_{i}}{\partial x_{i}}d $\Omega$+\sum_{\mathrm{e}=1}^{n_{\mathrm{e}1}}\int_{$\Omega$_{\mathrm{e}}} $\tau$\frac{\partial q}{\partial x_{i}}(\frac{\partial u_{i}}{\partial t}+\overline{u}_{j}\frac{\partial u_{i}}{\partial x_{j}}+\frac{\partial p}{\partial x_{i}})d $\Omega$=0

,

(4)

where $\tau$isthe SUPG

/

PSPG stabilizationparameter. The formulationtocalculate theparameter $\tau$

is

given

indetailsinthepaper

[1].

3

GPBi‐CG

Algorithm

Algorithm

1 The

Unpreconditioned

GPBi‐CG

x_{0} isaninitialguess,

r_{0}=b-Ax_{o}

;

Set

r_{0}^{*}=r_{0},

t_{-1}=w_{-1}=0,

$\beta$_{-1}=0

;

forn=0,1, until

||r_{n}||\leq $\epsilon$||b||

do

p_{n}=r_{n}+$\beta$_{n-1}(p_{n-1}-u_{n-1})

,

$\alpha$_{n}=\displaystyle \frac{(r_{\dot{\mathrm{o}}},r_{n})}{(r_{\mathrm{o}}^{*},Ap_{n})},

y_{n}=t_{n-1}-r_{n}-$\alpha$_{n}w_{n-1}+$\alpha$_{n}Ap_{n},

t_{n}=r_{n}-$\alpha$_{n}Ap_{n},

$\zeta$_{n}=\displaystyle \frac{(y_{n},' y_{n})(At_{n},t_{n})-(y_{n},t_{n})(At_{n},y_{n})}{(At_{n}At_{n})(y_{n},y_{n})-(y_{n},At_{n})(At_{n},y_{n})},

$\eta$_{n}=\displaystyle \frac{(At_{n},' At_{n})(y_{n},' t_{n})-(y_{n},At_{n})(At_{n},t_{\mathfrak{n}})}{(At_{n}At_{n})(y_{n}y_{n})-(y_{n},At_{n})(At_{n},y_{n})},

(if

n=0, then

$\zeta$_{n}=\displaystyle \frac{(At_{n},t_{n})}{(At_{n},At_{n})},

$\eta$_{n}=0

),

\mathrm{u}_{n}=$\zeta$_{n}Ap_{n}+$\eta$_{n}(t_{n-1}-r_{n}+$\beta$_{n-1}u_{n-1})

,

z_{n}=$\zeta$_{n}r_{n}+$\eta$_{n}z_{n-1}-$\alpha$_{n}u_{n},

x_{n+1}=x_{n}+ $\alpha$ p_{n}+z_{n},

r_{n+1}=t_{n}-$\eta$_{n}y_{n}-$\zeta$_{n}At_{n},

$\beta$_{n}=\displaystyle \frac{$\alpha$_{n}}{$\zeta$_{n}}\frac{(r_{0}^{*},r_{n+1})}{(r_{\dot{0}},r_{n})},

w_{n}=At_{n}+$\beta$_{n}Ap_{n}

; end for

stabilized finite element method leadstoa

large

and

This linear

equation

systemis solved

by using

the

To

implement

the GPBi‐CG

algorithm

onthe GPU

platform,

weused the Nvidia’s GPU linear

algebra

libraries cuSPARSE

[7]

and cuBLAS

[8]

to

implement

four basic vector operationsof the

algorithm:

SpMV, DOT,

AXPY and SCALasdescribed below.

\bullet

\mathrm{S}\mathrm{p}\mathrm{M}\mathrm{V}

:the sparse matrix‐vector

product,

. DOT: the inner

product,

\bullet AXPY: adda

multiple

ofonevector to

another,

\bullet SCAL:

scaling

avector

by

aconstant.

The

SpMV operation

is

implemented by using

thecuSPARSE

library.

The

DOT,

AXPY and SCAL

operationsare

implemented by using

thecuBLAS

library.

(3)

4

Multi‐GPU

Implementation

To extendto multi‐GPU implementation of theGPBi‐CG

algorithm,

we implemented themulti‐GPU

versionof

SpMV,

DOT,

AXPY,

andSCALoperations

by

usingthe MPI

library,

thecuSPARSE

library

and the cuBLAS

library.

It is trivialto

implement

themulti‐GPU version of the DOT,

AXPY,

and

SCALoperations by using the MPI

library

andcuBLAS

library.

However, theimplementation ofthe

multi‐GPUversion of the

SpMV

operationisnot

straightforward.

It is carriedout

by subdividing

the

computationaldomain into subdomains thataredistributedovertheGPUsby usingthe MPI

library.

To

reduce communicationcost,we

develop

anefficientprocedurethat eachGPUreceives from other GPUs

only

data eachGPUneeds. We consider theproblemof matrix‐vectormultiplicationofasparse matrix

Aandadensevector b. Wepartitionthe matrix Ainto groups ofadjacent completerowsand assign

onesuch grouptooneGPU. EachGPUis now

obligated

tocomputeentriesof the resultvectorAbthat match with thepartitioned rowsof the matrixAto formapartialresultof the resultvectorAb. This

submatrix‐vectorcomputationcanbe carriedoutaftereachGPUreceivesthe entries of thevectorb that

correspondtonon‐zeroentries intherowsof the submatrixAwhichare

assigned

toeachGPU. Asimple

implementation

forthisproblemisto

implement

acode that all the GPUsreceivesall the entries of the

entirevectorb. However,thisimplementationisnotefficientbecause the number ofnon‐zeroentries per

a rowofasparsematrix

generated by

fimite elementmethodsis small. To solve this

problem,

we

develop

an efficientprocedurethat each GPU receives from other GPUs

only

the entries of the vector b which eachGPUneedstocomputesubmatrix‐vector

multiplications.

5

Performance Results

Figure 1: Computationaldomain of the testproblem

We consideratestproblemwhichconsistsofan

object

immersed inafluid domainasshownin

Fig.

1.

Starting

fromasurfacemesh,wecreatedthreetetrahedral mesheswith differentresolutions. We carried

outthecomputationby usingaGPUsystemwith the

following

specification:

\bullet Intel XeonCPUE5630,2.

53\mathrm{G}\mathrm{H}\mathrm{z},

\bullet 2GPUs‐Tesla

C2070,

\bullet 24GB

System Memory.

(4)

Thble 1: Speed‐upratiosandexecution times

We measured thetimeof theexecutionontwoGPU devices and thatoftwoCPU threads. As shown inTab. 1,theGPUexecution is1.8 timesfaster than the CPUexecutionfor the

large

mesh with 638447 elements. The

speedup

ratioincreasesasthe number of elements of meshes increases.

6

Conclusions

Weproposeanefficient

implementation

ofamulti‐GPU

parallel

solver basedontheGPBi‐CG

algorithm

for 3\mathrm{D}

unsteady

Navier‐Stokesequationsdiscretized

by

the stabilized finite element formulations. We

develop

a

hybrid

CPU‐GPUstrategythat distributes the

computation

acrossGPUs

by using

the MPI

library.

In futureresearch,we

plan

toevaluate the

scalability

of theprogram

(speedup

factorversusthe

number of GPU

devices)

inmulti‐GPU

high‐performance computing

systems. We also

plan

to

improve

thecurrent

implementation by using multigrid‐ preconditioners.

Acknowledgment

This workwas

supported by Japan

Science and

Technology Agency,

Core Research for Evolutional Science

and

Technology

(JST‐CREST).

The first author would liketo

acknowledge

Mr.

Ryota

Yamane

(Okayama

University)

for

providing

the STL file used fortest computations.

References

[1]

T. E.

Tezduyar,

Stabilized fimite element formulations for

incompressible

flowcomputations,Advances

in

Applied

Mechanics28

(1992)

1‐44.

[2]

T. E.

Tezduyar,

S.

Mittal,

S. E.

Ray,

R.

Shih, Incompressible

flow computationswith stabilized bilinear and linear

equal

order

interpolation velocity

pressure

elements, Computer

Methodsin

Applied

Mechanics and

Engineering

95

(1992)

221‐242.

[3]

$\Gamma$.

Shakib,

T. J. R.

Hughes,

Z.

Johan,

A new finite element formulation for

computational

fluid

dynamics:

X. the

compressible

Euler and Navier‐Stokesequations,

Computer

Methodsin

Applied

lMechanics

and

Engineering

89

(1991)

141‐219.

[4]

L. P.

Franca,

S. L.

Fhey,

T. J. R.

Hughes,

Stabilized finite element methods: I.

application

tothe advective‐diffusive

model, Computer

Methodsin

Applied

Mechanics and

Engineering

95

(1992)

235‐ 276.

[5]

V.

Huynh,

H.

Suito,

A GPU Parallel Solver for 3D

Incompressible

Navier‐Stokes

Equations

Dis‐

cretized

by

the SUPG

/

PSPG Stabilized Finite Element

Formulation,

GPU

Technology

Confer‐ ence 2016, http://\mathrm{o}\mathrm{n}‐demand.gputechconf.

$\Gamma$ 1\mathrm{u}\mathrm{i}\mathrm{d}_{-}Dynamic\mathrm{s}_{-}\mathrm{C} $\Gamma$ \mathrm{D}_{-}01_{-}\mathrm{P}6160_{-}\mathrm{W}\mathrm{E}\mathrm{B}.pdf

(Accessed

Oct.

2016).

[6]

S. L.

Zhang,

GPBi‐CG: Generalized

product‐type

methods basedonUi‐CG for

solving nonsymmetric

linearsystems,SIAM J. Sci.

Comput.

18

(1997)

537‐551.

[7]

CuSPARSE,

https:

//developer.

nvidia.

com/cusparse

(accessed

Oct.

2016).

[8]

CuBLAS,

https:

//developer.

nvidia.com/cublas

(Accessed

Oct.

2016).

Figure 1: Computational domain of the test problem

参照

関連したドキュメント

We use L ∞ estimates for the inverse Laplacian of the pressure introduced by Plotnikov, Sokolowski and Frehse, Goj, Steinhauer together with the nonlinear potential theory due to

In [3] the authors review some results concerning the existence, uniqueness and regularity of reproductive and time periodic solutions of the Navier-Stokes equations and some

Using the theory of nonlinear semigroups, we prove existence results for strong and weak solutions1. Examples are

Wheeler, “A splitting method using discontinuous Galerkin for the transient incompressible Navier-Stokes equations,” Mathematical Modelling and Numerical Analysis, vol. Schotzau,

The existence and uniqueness of adapted solutions to the backward stochastic Navier-Stokes equation with artificial compressibility in two-dimensional bounded domains are shown

The numerical tests that we have done showed significant gain in computing time of this method in comparison with the usual Galerkin method and kept a comparable precision to this

We show the uniqueness of particle paths of a velocity field, which solves the compressible isentropic Navier-Stokes equations in the half-space R 3 + with the Navier

In this section, we shall prove the following local existence and uniqueness of strong solutions to the Cauchy problem (1.1)..