void Comm.send(Object buf, int offset, int count,
Datatype datatype, int dest, int tag)
| buf | send buffer array |
| offset | initial offset in send buffer |
| count | number of items to send |
| datatype | data type of each item in send buffer |
| dest | rank of destination |
| tag | message tag |
The elements of buf may have primitive type or class type. If the elements are objects, they must be serializable objects. If the datatype argument represents an MPI-compatible basic type, its value must be consistent with the element type of buf. Thus, the basic data type values included in the MPJ API specification are MPJ.BYTE, MPJ.CHAR, MPJ.SHORT, MPJ.BOOLEAN, MPJ.INT, MPJ.LONG, MPJ.FLOAT, MPJ.DOUBLE, and MPJ.OBJECT. If the datatype value is MPJ.OBJECT the objects in the buffer are transparently serialized and unserialized inside the communication operations.
The datatype argument is not redundant in the current specification of MPJ, because the proposal includes support for an analogue of MPI derived types. The derived types of MPJ are restricted to have a unique base type, one of the nine types enumerated above. If the datatype argument of a communication function represents an MPJ derived type, its base type must agree with the Java element type of the associated buf argument. Alternatively, if it was decided to remove derived types from MPJ, datatype arguments could be removed from many functions, and Java runtime inquiries could be used internally to extract the element type of the buffer3.