4.12.6.2 Callback Functions

MPI-/ calls may associate callback functions with MPI-/ objects: error handlers are associated with communicators and files, attribute copy and delete functions are associated with attribute keys, reduce operations are assciated with operation objects, etc. In a multilanguage environment, a function passed in an MPI-/ call in one language may be invoked by an MPI-/ call in another language. MPI-/ implementations must make sure that such invocation will use the calling convention of the language the function is bound to.

Advice to implementors. Callback functions need to have a language tag. This tag is set when the callback function is passed in by the library function (which is presumably different for each language), and is used to generate the right calling sequence when the callback function is invoked.(End of advice to implementors.)

MPI-Standard for MARMOT