The class MPI only has static members. It acts as a module containing global services, such as initialization of MPI, and many global constants including the default communicator COMM_WORLD.
The most important class in the package is the communicator class Comm. All communication functions in mpiJava are members of Comm or its subclasses. As usual in MPI, a communicator stands for a ``collective object'' logically shared by a group of processors. The processes communicate, typically by addressing messages to their peers through the common communicator.
Another class that is important for the discussion below is the Datatype class. This describes the type of the elements in the message buffers passed to send, receive, and all other communication functions. Various basic datatypes are predefined in the package. These mainly correspond to the primitive types of Java, shown in Table 4.1. The MPI.OBJECT is a new predefined datatype for derived data types.
|
The standard send and receive operations of MPI are members of Comm with interfaces:
public void Send(Object buf, int offset, int count, Datatype
datatype, int dest, int tag)
public Status Recv(Object buf, int offset, int count, Datatype
datatype, int source, int tag)
In both cases the actual argument corresponding to buf must be a Java array. In the current implementation they must be arrays with elements of primitive type. By implication they must be one-dimensional arrays, because Java ``multidimensional arrays'' are really arrays of arrays. In these and all other mpiJava calls, the buffer array argument is followed by an offset that specifies the element of in array where the message actually starts.