Bindings

Note that in no way does MPIJ claim to be an official standard developed or endorsed by the MPI Forum.  MPIJ will fully support such a standard when it comes.  (Hopefully the official Java MPI bindings will be compliant with the official Java coding standard).

Design goals

MPIJ is based closely on the C++ bindings.  In deriving Java bindings for MPI we have used the official Java code conventions from Sun (http://java.sun.com/docs/codeconv/html/).  The logic behind this is that Java MPI bindings should look and feel like natural Java.  This seems reasonable since the Fortran bindings look and feel like Fortran, and the C bindings look and feel like C.  Therefore, we feel Java bindings should not look and feel C, but like Java.  The most noticeable result of this is that (as per the Java coding standard) class names begin with upper-case letters and method and variable names begin with lower-case letters. Also, method and variables names use capitals to begin new words (no hyphens are used to separate words).  So, "ALLTOALL" is allToAll.

We have also used the bindings developed in mpiJava as a guide.  However it is worth discussing some differences.  First it is important to realize that mpiJava and MPIJ have different overall goals:  MPIJ is a purely Java-based MPI implementation, while mpiJava is a Java wrapper to native MPI implementations.  This introduces both disparate implementation requirements (for instance user defined operations) as well as differing styles (MPIJ attempts to follow the Java standard while mpiJava maintains the Unix-C flavor of C based MPI implementations.)

The following is an incomplete list of differences between MPIJ and mpiJava.  It should first be noted that, while MPIJ contains a large amount of MPI functionality, it is not yet complete.  mpiJava, on the other hand, is essentially complete.

Returned objects (such as Status or Request)

MPIJ does not return new objects such as Status, but uses objects references that are passed into methods.  This is more like the C bindings than the C++ bindings.  The reason we have departed from the C++ bindings here is to avoid the constant creation and deletion of heap-allocated objects.  In C++ such objects would be usually be allocated on the stack, but in Java all objects are on the heap.

create and split

As per the C++ bindings, Intracomm.create() and Intracomm.split() are placed in Intracomm.  mpiJava places them in Comm.

Status

As in the C++ bindings, Status fields are accessed through methods.  mpiJava allows direct access of these fields (similar to the C bindings).

Overloaded methods

MPIJ overloades the calls to several methods to allow both the simplicity of using array length methods or the flexibility of specifying array offsets and lengths.  mpiJava uses both approaches, but exclusively.

User defined operations

In MPIJ this is accomplished by subclassing the Op class and overriding default methods as desired.  mpiJava is designed to support C user defined functions.

2-dimensional arrays

MPIJ supports the sending and receiving of 2-dimensional arrays (each row entry has identical length).  mpiJava supports 1-dimensional arrays.  (Neither implementation supports n-dimensional arrays).