General notes on MPI handles in SIDL
MPI opaque handles require special, but simple, handle in SIDL. Here's how.
As MPI Forum explicitly DOES NOT define an inter-language form for object (comm, group, etc) handles, we use the
FORTRAN form which, being an integer of some size less than or equal to "long" in sidl, we will express in SIDL as a long.
Implementations in C/C++/Python will have to use appropriate conversion operators, MPI_Comm_c2f/MPI_Comm_f2c, when
passing/receiving object handles in long form.
The MPI standard does not include an automatic reference counting model for its handles.
Fortran caveat
The size-of-integer issue which is generic to SIDL+Fortran may manifest in the sidl which uses MPI handles. Specifically, if a fortran compiler (due to command line "-i4" or equivalent configuration file options) overrides the declared kind of the handle, uncompilable or unlinkable code may result.
C caveat
The size of integer returned by MPI_Comm_c2f will be MPI_Fint (or similar as the MPI specification moves forward). This may not be identical in size to C sidl long which is int64_t. Appropriate explicit casting will make your code more portable.