MPJ A Java-based Parallel Computing System by bns26590


									MPJ: A Java-based Parallel
   Computing System

                 Aamir Shafi
         Distributed Systems Group
          University of Portsmouth
            Presentation Outline
            • Introduction,
            • Design and Implementation of MPJ,
            • Preliminary Performance Evaluation,
            • Conclusions.

February 1, 2010                                    2
            Introduction (1)
            • Serial Computation:
                   – Using „a‟ single processor to solve a problem:
                      • Sequential - the CPU executes instructions „one after the
            • Parallel Computation:
                   – Using multiple processors to solve a problem:
                      • Each processors executes different instructions
                      • Processors collaborate by passing messages via:
                         – System bus (I.e. on a Symmetric Multi-Processors),
                         – Interconnect (i.e. on a Cluster),
                   – Why Parallel Computing?
                      • To achieve application speed-up (lesser execution time),
                      • To solve large-scale problems.
                   – Message Passing Interface:
                      • A software layer, used for inter-processor communications
                        between peer processes.
February 1, 2010                                                                    3
            Introduction (2)
            • In order to standardise the message passing
              software layer, the Message Passing Interface
              (MPI) was introduced in June 1994:
                   – Language bindings for C, C++, and Fortran,
            • Java is becoming a popular platform for scientific
                   – „Write once, run anywhere‟ philosophy,
                   – Built-in support for threads, networking, synchronization,
                     and security,
                   – Easy to use graphical packages,
                   – Improved performance - Just In Time (JIT) compilers:
                      • Comms performance is comparable to C on Fast Ethernet,
            • As a result, a Java binding was proposed in 98‟ by
              the Java Grande Forum:
                   – Not part of the official MPI standards effort.
February 1, 2010                                                                  4
             Introduction (3)
          • Previous Efforts:
               – “Either” of these two approaches can be used,
                   • Wrappers to existing MPI C libraries:
                      – High Performance,
                   • Pure Java:
                      – Portability,
          • Aims of this project:
               – Develop a reference implementation of the MPI standard
                 in Java,
               – Based on the ideology that there is no „one size fits all‟
                 approach for Java messaging,
                   • Application users can choose between high performance or
               – Options for various communication protocols:
                   • TCP (using Java New I/O package),
                   • Shared Memory,
                   • Myrinet etc.,
               – Allows use of wrappers to native MPI implementations.
February 1, 2010                                                                5
            Presentation Outline
            • Introduction,
            • Design and Implementation,
            • Preliminary Performance Evaluation,
            • Conclusions.

February 1, 2010                                    6
            • Aims:
                   –Support swapping various communication
                   –Based on the idea of UNIX device drivers,
            • Two device levels:
                   –The MPJ Device level (mpjdev):
                     • Makes it possible to provide an interface to native MPI
                   –The xdev Device level (xdev):
                     • Provides interface to implement drivers for various
                       communication protocols,
                        – TCP (using Java New I/O package),
                        – Shared Memory,
                        – Myrinet etc.
February 1, 2010                                                                 7
                                       MPJ API

                            MPJ collective Communications (High level)

                          MPJ point to point communications (Base level)

                                mpjdev (MPJ Device level)


                   Native MPI
                                                  smpdev         niodev     gmdev

                   JNI                                           Java NIO    JNI
                         Java Virtual Machine (JVM)

                                    Hardware (NIC, Memory etc)
February 1, 2010                                                                    8
            • MPJ complies with the functionality of MPI-1.2:
                   – Point to point communications,
                   – Collective communications,
                   – Groups, communicators, and contexts,
                   – Derived datatypes:
                     • Buffering API,
            • Runtime infrastructure:
                   – Allows bootstrapping MPJ processes,
                   – MPJ Daemon can be installed as OS service,
            • Communication protocols:
                   – Java NIO device,
                   – GM 2.x.x device (Myrinet),
                   – Shared memory device (using Threads API).
February 1, 2010                                                  9
            Presentation Outline
            • Introduction,
            • Design and Implementation,
            • Preliminary Performance Evaluation,
            • Conclusions.

February 1, 2010                                    10
            Preliminary Performance Evaluation
            • Point-to-point (connected by Fast Ethernet):
                   –mpiJava 1.2.5 (using MPICH 1.2.5),
                   –MPJ (using Java NIO),
                   –MPICH (1.2.5) (using ch_p4),
                   –LAM/MPI (7.0.9) (using TCP RPI),
            • Transfer time and throughput graphs,
            • Analysis.

February 1, 2010                                             11
            Transfer Time Comparison

                   MPJ: ~250 microseconds (latency)
                   mpiJava, LAM/MPI, MPICH: ~125
                   microseconds (latency)

February 1, 2010                                      12
            Throughput Comparison

                   MPJ: ~81 Mbps
                   mpiJava: ~84 Mbps
                   LAM/MPI: ~90 Mbps
                   MPICH: ~88 Mbps

February 1, 2010                       13
            • General behaviour is similar to other MPI
            • Optimisation areas:
                   –Latency for small messages:
                     • Currently control message and data is written in two
                       separate SocketChannel write operations,
                   –Large messages:
                     • Maintaining pool of buffers,
            • Understand the anamoly at 16 Mbyte

February 1, 2010                                                              14
            Presentation Outline
            • Introduction,.
            • Design and Implementation,
            • Preliminary Performance Evaluation,
            • Conclusions.

February 1, 2010                                    15
            • A key issue for Java messaging is not debating the
              use of pure Java or the JNI approach:
                   – But, providing a flexible mechanism to swap various
                     communication protocols.
            • MPJ has a pluggable architecture:
                   – We have implemented devices for:
                      • TCP (using Java NIO),
                      • Myrinet (using GM 2.x.x),
                      • Shared memory communications (using Threads API),
            • The MPJ runtime infrastructure allows
              bootstrapping MPJ processes across various

February 1, 2010                                                            16
             • MPJ is the second generation „MPI for
             • Current Status:
                   –Unit testing,
                   –First release by the end of June05,
                     • Java NIO device,
             • Arguably, the first “full” MPI library for Java
               providing a pure Java implementation.
             • Future Work:
                   –Define and implement Java bindings for MPI-2

February 1, 2010                                                   17

February 1, 2010        18

To top