Opaque objects will be presented as Java objects.
This introduces the
option of simplifying the user's task in managing these objects. MPI
destructors can be absorbed into Java object destructors, which are
called automatically by the Java garbage collector. We adopt this
strategy as the general rule. Explicit calls to MPI destructor
functions are typically omitted from the Java user interface. An
exception is made for the Comm classes. MPI_COMM_FREE
is a collective operation, so the user must ensure that calls are made
at consistent times by all processors involved--the call can't be left
to the vagaries of the garbage collector.

Advice to implementors. For JNI-based ``wrapper'' implementations based on the C binding of MPI, one
should ensure that all MPI functions, including the MPI_..._free object destructors, are called beforeMPI_Finalize is called. Because invocation of Java destructors
is under the control of the garbage collector there is no guarantee
that all Java-level finalize methods will be called before the
explicit call to the Java-level MPI.finish. A possible solution is
to maintain a global count of the number of outstanding MPI_..._free calls. This is initialized to 1 by MPI.init
and incremented by relevant constructors. All relevant Java finalize methods and MPI.finish should decrement this
counter, and be prepared to call the physical MPI_Finalize
function when and only when the count falls to zero.(End of advice to implementors.)