Javaにおけるオブジェクト指向 メッセージパッシングライブラリの開発

Report
Javaによる
MPIの実装と評価
日下部 明(日本オラクル)
廣安 知之(同志社大 工)
三木 光範(同志社大 工)
Java
•Easy To Develop
Simple Language
•Platform Independent
No
Correct Source Code
Re-compile
Our Projects
Applications
Parallel Computers
Optimization tools
Gradient methods
Genetic Algorithms
Simulated Annealing
Applications on PC
clusters and GRID
tasks
Clusters
Application
GRID
Genetic Algorithms
生物の遺伝と進化を模擬した最適化手法
交叉による探索
多点探索
突然変異による探索
選択による探索領域の絞りこみ
Parallel Genetic Algorithms
Individual Information
name
Gene
1001110011
Fitness Value
Flags
Object Transport
Sample Class
Class Individual
char[] name
Int[]
gene
float
fitness value
Int[]
flags
Primitive Types Only
Sender
Receiver
send(name)
recv(name)
send(gene)
recv(gene)
send(fitness)
recv(fitness)
send(flag)
recv(flag)
Object Types
Sender
Receiver
Send
Recv
(individual)
(individual)
Bottleneck
Message passing
MPI
Message Passing Interface
Standard API Set
•For Fortran / C / C++
Defined
•For Java
Almost Defined
Java-MPI
mpijava
•Object Transport
•Interface To Native MPI
MPIJ
•Full Java Implementation
•Shared Memory Support
Objective
Deriving Java Merits
Java-MPI
Features
1. Object Transport
2. Full Java Implementation
3. Self Start-up
4. Shared Memory Support
Target 1
Cluster
Target 2
Multi Processor Machine
send/recv
void send (Object buf, int offset, int count,
Datatype datatype, int dest, int tag)
void recv (Object buf, int offset, int count,
Datatype datatype, int dest, int tag)
Java Datatypes
Primitive Types
•byte
•int
•char
•long
•short
•float
•boolean •double
Object Types
Other All
Marsharing
of f se t
c ount
O b je c t I n p u t S tre a m
re a d O b je c t
M e s s a g e B uf f e r
S y s te m. a rra y co p y
Me s s a g e
O b je c t
Me s s a g e
O b je ct
S y s te m. a rra y c o p y
Me s s a g e B u f f e r
writ e O b je c t
O b je c t O u t p u t S t re a m
of f se t
co u n t
Extended Comm
void send (Object buf, int offset, int count,
Datatype datatype, int dest, int tag)
void recv (Object buf, int offset, int count,
Datatype datatype, int dest, int tag)
void sendObject (Object buf, int dest, int tag)
Object recvObject (int src, int tag, Status status)
Extended Method
Me s s a g e B u f f e r
O b je c t I n p u t S t re a m
p a s s ref e re n c e
re a d O b je c t
Me s s a g e
O b je c t
Me s s a g e
O b je c t
writ e O b je c t
pa s s re f e re nc e
Mes s a g e B u f f e r
O b je c t O u t p u t S t re a m
How To Launch
MPICH
> mpirun -np n exefile
JDK Style
> java class
This MPI
> java -Dnp=n class
Spawning Tasks
Launching
Command
MPI.init
Java-MPI Binding
Void init(String[] args)
Our Implementation
Void init(String name_of_class, String[] args)
SMP Cluster
Experiment Environment
Switching HUB
100BASE-TX
Pentium 3
500MHz
2 Way SMP
Linux 2.2.12
Blackdown
JDK1.2.2 RC3
B an d W idth (B y te s /s ec )
Band Width
1.0e8
byte
int
1.0e7
double
1.0e6
1.0e5
1.0e4
1.0e3
1.0e1
1.0e2
1.0e3
1.0e4
1.0e5
M essage Size (Bytes)
1.0e6
Band Width
1 .0 e 8
byte with extended method
b yte
1 .0 e 7
1 .0 e 6
1 .0 e 5
1 .0 e 4
1 .0 e 3
1 .0 e 1
1 .0 e 2
1 .0 e 3
1 .0 e 4
1 .0 e 5
M essag e S iz e (B y tes)
1 .0 e 6
Band Width
byte[ ]
100000000
100M
10M
1M
1000000
100000
100K
MPICH
9
99
9
1
1M
99
23
4
56
62
2
7
Message Size (Byte)
31
78
2
99
9
99
23
4
100K
56
62
2
9
78
2
31
17
3
99
9
2
10K
56
2
8
31
6
9
99
17
7
1K
2
56
6
31
7
17
99
100
56
17
10
9
1K
1000
31
10K
10000
7
Java-MPI
17
Band Width
(Bytes/Sec)
10000000
Band Width (Intra Node)
byte[ ]
100M
100000000
10000000
1M
1000000
MPICH
100K
Shared Memory
100000
Socket
10K
99
41
99
23
1M
99
27
62
56
Message Size (Byte)
31
27
9
78
17
4
99
99
2
100K
23
62
2
31
78
99
17
23
99
62
10K
56
78
31
17
99
9
1K
2
6
56
7
31
17
99
100
56
17
9
10
31
10000
56
Band Width
(Bytes/Sec)
10M
Conclusion
(1/2)
Deriving Java Merits
1. Object Transport
Natural Expression
2. Full Java Implementation
Portability
3. Self Start-up
JDK Style Start-up
4. Shared Memory Support
Fast Communication
Conclusion
(2/2)
5. Inter Node Communication
Slower Than MPICH
6. Intra Node Communication
Faster Than MPICH
Future Works
より高率的な実装
1K付近でのBandwidthの落ち
込みの特定
Marshallingによる通信遅延の
検討
最適化アプリケーションなどでの
実際の使用
その他

similar documents