Title: GAME OF LIFE
1GAME OF LIFE
Load Balancing
2???? ????????
????? ?????? ????? ????? ????? ?????? ??????
?????.
3???? ??????
?????? ????? Game of Life ????????
??? ???? ????????? ?? Jacobi ???? ????? ????
???? ????? ????? ??????? ????? ?????? ?????
- Open MP
- MPI master and slaves
- MPI round robin division
- MPI row division
- MPI column division
- MPI Cartesian topology
4???? ????? Game of Life
????? ????? ?"? ????????? john conway ???? 1970
?????? ? .cellular automata ???? ?????
?????????? , ?? ?????? ???? ?????? ??? ???? . ???
????? ???? ?? ????? ??? ???? ????? ??????? , ???
?? ?? ???? ????? ???????? ???? ???? ?????? ?????
?? ??? ????? ?????? ?????
5???? ?????
- ??? ?? ??????? 8 "???? ?????" ??????? ?? ??? ???
???????? ????. - ?? ???????? ??? ????? ?? ??? ??? ??? ????
???????. - ?? ???????? ??? ????? ????? ????? ???? ??????
???. - ?? ???????? ??? ???? ?? ????? ????? ????? .
- ??? ?? ??? ??? ????? ????? ???? ????????.
6?? ???????? ??? ????? ?? ??? ??? ??? ???? ???????.
7?? ???????? ??? ???? ?? ????? ????? ????? .
8?? ???????? ??? ????? ????? ????? ???? ?????? ???.
9??? ?? ??? ??? ????? ????? ???? ????????.
10???? ????????? ?? Jacobi
- ?????? ?? ???? ??? ?????? ?? ??????
- ???? ??? ?? ???? (x,y) ??????? ?? ?????? ?????.
- ???? ?? ?? ?????? ??? 1 ????? ?? ?? ?? ?????? 0.
- ?????? ????? ?? ?? ?? ????? ????? ????
- ????? ???? ????? ?????? ????? ???????? ??????.
- ????? ?????? ?????? ??? ??? ???????? ????.
11????? ?????? ??????
12Open MP
A set of compiler directives and library routines
for parallel application programmers
?????? ???? ?? ???? ???????? (threads ) ?????
????? ??????? ?????? ????? ??????? , ??? ?????
??????. ?????? ????? ?? ??????? ??????? ?? ????
??????? ???????
13MPI master and slaves
????? ??? master ) ) ???? ?? ??????? ?? ????
??????. ?master ???? ?? ??????? ??? ??????? (
??????? ???? ??? ) ????? ??? ????? ( slave ) ???
?????? . ????? ?? ??????? ???? ?? slave ?? ??
??????? ?????? ?? ???? ???? , ?????? ? master.
14MPI round robin division
??????? ????? ???????. ????? ??????? ????????
????? ????? ?????? ???? ??? ????? ????? ?????
??????. ???? ??????? 2 ( m -1) m ????
??????? ???????
15MPI row division
??????? ????? ??????. ?? ????? ???? ????? ?????
????? ??????. ???? ??????? 2 ( p -1) p ????
????????
16MPI column division
??????? ????? ???????. ?? ????? ???? ????? ?????
?????? ??????. ???? ??????? 2 ( p -1) p
???? ????????
17MPI Cartesian topology
????? ???? ??????? ?????? ?????? ?????? ??????
????? ?????? (grid) . ??-??? ????? ?? ????? ?????
????? ????? ????? ????? ?? ??????? ??????? ??
????? ????? ??????. ????? ?? ??? ?????? ????? ??
????? ??????? ?????? ????? ?????? ????? ?????
?????.
18???????? ???????
19Speed up
Cost
Efficiency
20?????? ???????
?????? ?? ??? ????? ??? ???? ???? ??????
???????. .1 ???? ??????? ????????? ????????
??????. .2 ??? ?????? ??????? ??? ???????? ,
????? ?????? ???? ??????????? ?? ??????.
21???? ??? ???? ????? ??????/???????
Open MP
?????????? ?? ???? ??? ?????? ??????? ??? ??????
, ???? ????? ???? ???? ?? ?????? ???? ??? ???
???? ???? ???? ?? ???? ?? ??????.
22???? ??? ???? ????? ??????/???????
MPI
???? ????? ???????? ???? ????? ???????. ?. ????
????? ???? ????? ????? ????cartesian topology
. ?. ???? ????? ????? ????? ????? ???? round
robin division . ?. ???? ?????? ???? ??? ?????
???? ??????? ?? ???? ?? ????? ??? ?????
?????? ?? ???? ?? ???? ??? ????.
23????? ??????
- ????? ???? ???????? .
- ????? ???????? ??? ??????? ????? ????? ,????
???? ???? ????? ??????. - ????? ??? deadlock ????? ????? ????? ???
????????.
24??????? ???????
- ????? ???? ???????? - ????? ???? ?????? ?? ?????
?????? ???? ????? ???????? ???????? ??????.????
??? ????? ??????? ????? ??? ???? ????? ?????. - ????? ??????? ????? - ????? ????? ????? ?????.
- ????? ??? deadlock - ????? ??????
MPI_sendrecv()