Java platforms for parallelism
Message Passing Interface (MPI) is a language-independent communications protocol used to program parallel computers. Both point-to-point and collective communication is supported. MPI "is a message-passing application programmer interface, together with protocol and semantic specifications for how its features must behave in any implementation."
Grid computing
Several Java implementations of MPI
One of the first attempts was Bryan Carpenter's mpiJava, essentially a collection of JNI wrappers to a local C MPI library, resulting in a hybrid implementation with limited portability, which also has to be recompiled against the specific MPI library being used.
javaMpi is another wrapper around C MPI library
However, this original project also defined the mpiJava API (a de-facto MPI API for Java following the equivalent C++ bindings closely) which other subsequent Java MPI projects followed.
An alternative although less used API is the MPJ API, designed to be more object-oriented and closer to Sun Microsystems' coding conventions.
MPJ Express -- MPJ Express is an implementation of the Java bindings for the MPI standard. The system implements thread-safe communication in a Java messaging system to make it compliant with Javas threading. This library addresses contradictory issues of high-performance and portability by providing communication devices using Java NIO (pure Java) and Myrinet. It is possible for end users to switch communication protocols at runtime
Article with comparing MPJ to the Fortran + MPI: High-performance message passing in java using java.nio.
DPJ and Java-DVM provided class libraries to wrap data-parallel and Distributed-VM-model parallel computations respectively.
- Another wrapper around C MPI
HPJava is an environment for scientific and parallel programming using Java. It is based on an extended version of the Java language. One feature that HPJava adds to Java is a multi-dimensional array, or multiarray, with properties similar to the arrays of Fortran.
Other process communication
mostly taken from Java for Parallel computing
- Initialization of socket communication is a complex procedure and clearly it should not be coded anew for each application program.
In their Life example the messages were contiguous byte vectors that could be transmitted efficiently through the read and write methods of the Java socket API. But in general the messages will have more complex types and the data may not be contiguous in memory. Using the typed primitives of the standard API may then incur extra costs of copying and type-conversion.
- For reasons such as these, even with the simplified Java socket API, they concluded that direct socket programming will probably remain unattractive to scientific parallel programmers, even with the simplified Java socket API.
Java Remote Method Invocation (RMI):
- Java Remote Method Invocation (RMI), which is an object-oriented version of Remote Procedure Call (RPC), has been included with the Java Development Kit release 1.1. RMI provides a simple and powerful Java-to-Java communication model for invoking member functions on objects that exist in other Java virtual machines, exactly as if it were local objects running in the same virtual machines.
- High performance distributed computing can be done with Java RMI, but this has a few drawbacks since RMI is designed for client-server programming in Web based systems over slow networks. In parallel programming fast RMI with low latency and high bandwidth would be required. A better serialization would be needed, since Java's object serialization often takes 25%-50% of the time needed for a remote invocation.
Parallel Virtual Machine (PVM):
- is a message-passing system that permits a heterogeneous collection of networked computing systems to be used as a single large parallel machine.
- More focused on cluster scenarios, many cheap machines acting as one big computer vs. MPI which is focused on multi-processor machines
The design is based on widely used components: Web browsers and the portable Java. By pointing their browser to a known URL of a broker, users automatically make their resources available to host parts of parallel computations. This is achieved by downloading and executing an applet that spawns a small daemon thread that waits and listens for tasks from the broker. This approach makes it easy for a host to participate-all that is needed is a Java-capable web browser and the URL of the broker.
- It is good for very loosley-coupled parallel applications ("task parallelism") but it is less appropriate for the more tightly-coupled SPMD programming made possible by our approach.
Preprocessor which translates Java code with an extra keyword remote to RMI code, reducing the programming overhead. Communication costs are exactly the same as in RMI case.
Java performance references:
