Next: Array Count Arguments.
Up: Language Binding
Previous: Error Codes.
A few functions in the MPI interface return multiple values, even
after the error code is eliminated. This is dealt with in mpiJava in
various ways. Sometimes an MPI function initializes some elements in
an array and also returns a count of the number of elements modified.
In Java we typically return an array result, omitting the count. The
count can be obtained subsequently from the length member of the
array. Sometimes an MPI function initializes an object conditionally
and returns a separate flag to say if the operation succeeded. In
Java we typically return an object reference which is null if
the operation fails. Occasionally extra internal fields are added to an
existing MPI class to hold extra results--for example the Status class has an extra field initialized by functions like Waitany to hold the index value. Rarely none of these methods
work and we resort to defining auxiliary classes to hold multiple
results from a particular function.