DOC PREVIEW
31

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MPJava: High-Performance Message Passing inJava using Java.nioWilliam Pugh and Jaime SpaccoUniversity of Maryland, College Park, MD 20740, USA,[pugh,jspacco]@cs.umd.eduAbstract. We explore advances in Java Virtual Machine (JVM) tech-nology along with new high performance I/O libraries in Java 1.4, andfind that Java is increasingly an attractive platform for scientific cluster-based message passing codes.We rep ort that these new technologies allow a pure Java implementa-tion of a cluster communication library that performs competitively withstandard C-based MPI implementations.1 IntroductionPrevious efforts at Java-based message-passing frameworks have focused on makingthe functionality of the Mes sage Passing Interface (MPI) [18] available in Java, eitherthrough native code wrappers to existing MPI libraries (mpiJava [3], JavaMPI [12])or pure Java implementations (MPIJ [8]). Previous work showed that both pure Javaand Java/native MPI hybrid approaches offered substantially worse performance thanMPI applications written in C or Fortran with MPI bindings.We have built Message Passing Java, or MPJava, a pure-Java message passingframework. We make extensive use of the java.nio package introduced in Java 1.4.Currently, our framework provides a subset of the functionality available in MPI. MP-Java does not use the Java Native Interface (JNI). The JNI, while convenient ando ccasionally necessary, violates type safety, incurs a performance penalty due to ad-ditional data copies between the Java and C heaps, and prevents the JVM’s Just-InTime (JIT) compiler from fully optimizing metho ds that make native calls.MPJava offers promising results for the future of high performance message passingin pure Java. On a cluster of Linux workstations, MPJava provides performance thatis competitive with LAM-MPI [9] for the Java Grande Forum’s Ping-Pong and All-to-All microbenchmarks. Our framework also provides performance that is comparableto the Fortran/LAM-MPI implementation of a Conjugate Gradient benchmark takenfrom the NASA Advanced Supercomputing Parallel Benchmarks (NAS PB) benchmarksuite.2 Design and ImplementationWe have designed MPJava as an MPI-like message passing library implemented in pureJava, making use of the improved I/O capabilities of the java.nio package. MPJavaadheres to the Single Program Multiple Data (SPMD) model used by MPI. EachMPJava instance knows how many total nodes are in use for the computation, aswell as its own unique processor identification tag (PID). Using this information, theprogrammer can decide how to split up shared data. For example, if 10 nodes arebeing used for one MPJava computation, a shared array with 100 elements can storeelements 0-9 on node 0, 10-19 on node 1, etc. Data can be exchanged between nodesusing point-to-point send() and recv() operations, or with collective communicationssuch as all-to-all broadcast. Distributing data in this manner and using communicationroutines is typical of MPI, OpenMP, and other parallel programming paradigms.2.1 FunctionalityThe MPJava API provides point-to-point send() and recv() functions:send( int peer, int offset, int len, double[] arr ) recv( int peer, intoffset, int len, double[] arr )These high-level functions abstract away the messy details related to TCP, allowingthe user to focus on the application rather than the message passing details.MPJava also provides a subset of the collective communication operations typicallyavailable to a message passing library such as MPI. For example, if an array with 100elements is distributed between 10 nodes, an all-to-all broadcast routine can be usedto recreate the entire array of 100 elements on each node:alltoallBroadcast( double[] arr, int distribution )The distribution parameter is a constant that tells MPJava how the data is dis-tributed between nodes. The default setting we use is as follows: an array with nelements will be split between p nodes with each node holding n/p elements and thelast node holding n/p + nmodp elements. Other distribution patterns are possible,though we employ the simple default setting for our experiments.2.2 BootstrappingMPJava provides a series of start-up scripts that read a list of hostnames, perform thenecessary remote logins to each machine, and start MPJava processes on each machinewith special arguments that allow each MPJ ava pro cess to find the others. The resultof the bootstrap pro ces s is a network of MPJava processes where each process has TCPconnections to every other process in the network. These TCP connections are used bythe nodes for point-to-point as well as collective communications.2.3 Collective Communication AlgorithmsWe explored two different all-to-all broadcast algorithms: a multi-threaded concurrentalgorithm in which all pairs of nodes exchange data in parallel, and a parallel prefixalgorithm that only uses a single thread.In the concurrent algorithm, each node has a separate send and re ceive thread,and the select() mechanism is used to multiplex communication to all the otherpro ces sors .In the parallel prefix implementation, data exchange proceeds in log2(n) rounds,sending 2r−1pieces of data in each round, where r is the current round number. Forexample, if there were 16 total nodes, node 0 would broadcast according to the followingschedule:Example broadcast schedule for node 0 with 16 total nodesround partner data1 1 02 2 0,13 4 0-34 8 0-73 Introduction to java.nioJava’s New I/O APIs (java.nio), are defined in Java Specification Request (JSR) 51[17]. The se New I/O, or NIO, libraries were heavily influenced and address a numberof issues exposed by the pioneering work of Matt Welsh et. al. on JAGUAR [21] andChi-Chao Chang and Thorsten von Eicken on JAVIA [5].3.1 Inefficiencies of java.io and java.netThe original java.io and java.net libraries available prior to JDK 1.4 perform wellenough for client-server codes based on Remote Method Invocation (RMI) in a WANenvironment. The performance of these libraries is not suitable, however, for high-performance communication in a LAN environment due to several key inefficiencies intheir design:– Under the java.io libraries, the proces s of converting between bytes and otherprimitive types (such as doubles) is inefficient. First, a native method is usedthat allows a double to b e treated as a 64 bit long integer (The JNI is requiredbecause type coercions from double to long are not allowed under Java’s strongtype system). Next, bit-shifts and bit-masks


31

Download 31
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view 31 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view 31 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?