﻿ 求解抛物方程的MPI并行方法 Parallel Methods for Parabolic Equations Based on MPI Implementation

Pure Mathematics
Vol.07 No.02(2017), Article ID:20059,10 pages
10.12677/PM.2017.72013

Parallel Methods for Parabolic Equations Based on MPI Implementation

Yuyang Gao, Haiming Gu

Qingdao University of Science and Technology, Qingdao Shandong

Received: Mar. 11th, 2017; accepted: Mar. 28th, 2017; published: Mar. 31st, 2017

ABSTRACT

Many applications in mathematics and engineering involve numerical solutions of partial differential equations (PDEs). The demands of large-scale computing are quickly increasing in modern science and technology, and parallel computing has received more and more attention. In this paper, the main idea is that classical Group Explicit method (GEM) for parabolic equations, the group explicit method is established briefly and the stability analysis of the method is indicated simply. Then we focus on how to calculate the format in MPI parallel environment. Two parallel MPI algorithms are established and compared with non-parallel algorithm based on GEM. They are MPI block communication (wait communication) and non-blocking communication (no-wait communication). These two MPI schemas both better than one single process to calculate numerical solutions use group explicit method. Also, the non-blocking communication program has higher computational efficiency than blocking communication program.

Keywords:Finite Difference Method, Group Explicit Method, Parabolic Equations, MPI (Message Passing Interface)

1. 引言

MPI是目前最重要的并行编程工具( [8] )，它具有移植性好、功能强大、效率高等多种优点，MPI其实是一个“库”，共有上百个函数调用接口，在FORTRAN和C语言中可以直接对这些函数进行调用。MPI为并行算法提供了多种通信模式，一般的阻塞通讯模式即可满足大多数并行算法，但非阻塞通讯模式由于相对减少了通讯时间，从而使并行模式的效率得到较好的提升。将MPI并行技术与有限并行差分格式结合需要构造相匹配的消息传递模型( [9] )，因此，构造合适的并行消息传递模型是并行数值计算偏微分方程的重点。

2. 有限并行差分格式

2.1. 分组显式方法

(1)

(2)

(3)

(4)

(5)

(7)

(8)

(9)

(10)

(11)

，并舍弃无穷小项，可以得到如下网格方程，

(12)

(13)

(14)

(15)

(16)

(17)

(18)

2.2. 交替分组方法

(19)

(20)

(21)

(22)

3. MPI并行算法

Table 1. The steps of blocking communication mode

Table 2. The steps of non-blocking communication mode

MPI_Send(void* buf,int count,MPI_Datatype,int destination,int tag,MPI_Comm comm)

MPI_Recv(void* buf,int count,MPI_Datatype,int source,int tag,MPI_Comm comm, MPI_Status*status)

Figure 1. Communication mode of GEL

Figure 2. Communication mode of GER

Figure 3. Communication mode of AGE

MPI_Isend(void* buf,int count,MPI_Datatype,int destination,int tag,MPI_Comm comm, MPI_Request*request)

MPI_Irecv(void* buf,int count,MPI_Datatype,int source,int tag,MPI_Comm comm, MPI_Request*request)

MPI_Waitall(int count,MPI_Request*request,MPI_Status*status)

4. 数值并行计算

Table 3. The executive time of 4 processes in blocking and non-blocking communication mode for GEL (unit/sec.)

Table 4. The executive time of 4 processes in blocking and non-blocking communication mode for GER (unit/sec.)

Table 5. The executive time of 4 processes in blocking and non-blocking communication mode for AGE (unit/sec.)

Table 6. Comparison of the parallel efficiency in 4 processes

Figure 4. The executive time of single process and 4 processes of AGE blocking communication program

Figure 5. The executive time of AGE blocking and non- blocking communication program in 4 processes

5. 总结

Parallel Methods for Parabolic Equations Based on MPI Implementation[J]. 理论数学, 2017, 07(02): 89-98. http://dx.doi.org/10.12677/PM.2017.72013

1. 1. 都志辉, 李三立, 陈渔, 刘鹏. 高性能计算之并行编程技术——MPI并行程序设计[M]. 北京: 清华大学出版社, 2001.

2. 2. Quinn, M.J. (2004) Parallel Programming in C with MPI and Open MP. McGraw-Hill, New York.

3. 3. Evans, D.J. and Abdullah, A.R. (1983) Group Explicit Methods for Parabolic Equations. International Journal Computer Mathematics, 14, 73-105. https://doi.org /10.1080/00207168308803377

4. 4. Saul’yev, V.K. (1965) Integration of Equations of Parabolic Type by the Method of Nets. Proceedings of the Edinburgh Mathematical Society, 14, 247-248. https://doi.org /10.1017/S0013091500008890

5. 5. Mohd, A., Norhashidah, H. and Khoo, K.T. (2010) Numerical Performance of Parallel Group Explicit Solvers for the Solution of Fourth Order Elliptic Equations. Applied Mathematics and Computation, 217, 2737-2749.

6. 6. Vabishchevich, P.N. (2015) Explicit Schemes for Parabolic and Hyperbolic Equations. Applied Mathematics and Computation, 250, 424-431.

7. 7. 张宝琳. 求解扩散方程的交替分段显-隐式方法[J]. 数值计算与计算机应用, 1991, 4: 245-253.

8. 8. 张武生, 薛巍, 李建江, 郑纬民. MPI并行程序设计实例教程[M]. 北京: 清华大学出版社, 2009.

9. 9. Gorobets, A.V., Trias, F.X. and Oliva, A. (2013) A Parallel MPI + Open MP + Open CL Algorithm for Hybridsuper Computations of Incompressible Flows. Computers & Fluids, 88, 764-772.

10. 10. Kellogg, R.B. (1964) An Alternating Direction Method for Operator Equations. Journal of the Society of Industrial and Applied Mathematics, 12, 7. https://doi.org /10.1137/0112072