Two approaches are available for initializing MPI: the World Model(Section The World Model) , and the Sessions Model(Section The Sessions Model).
A call to MPI_INIT or MPI_INIT_THREAD, from any language, initializes MPI for execution in all languages.
Advice to users.
Certain implementations use the (inout) argc, argv arguments of the
C version
of MPI_INIT in order to propagate values for argc and
argv to all
executing MPI processes.
Use of the Fortran
version of MPI_INIT to initialize MPI may result in a loss
of this ability.
( End of advice to users.)
The function MPI_INITIALIZED returns the same answer in all
languages.
The function MPI_FINALIZE finalizes the MPI environments for all languages.
The function MPI_FINALIZED returns the same answer in all languages.
The MPI environment is initialized in the same manner for all languages by MPI_INIT. E.g., MPI_COMM_WORLD carries the same information regardless of language: same MPI processes, same environmental attributes, same error handlers.
Advice to users.
The use of several languages in one MPI program may require the use
of special options at compile and/or link time.
( End of advice to users.)
Advice
to implementors.
Implementations may selectively link language specific MPI libraries
only to codes that need them, so as not to increase the size of
binaries for codes that use only one language.
The MPI initialization code needs to perform initialization for a language
only if that language library is loaded.
( End of advice to implementors.)
A call to MPI_SESSION_INIT from any language initializes a session that can be used from all languages.
A call to MPI_SESSION_FINALIZE from any language finalizes the session for all languages.
The function MPI_ABORT kills MPI processes in the group of the supplied communicator, irrespective of the language used by the caller or by the MPI processes killed.
Information can be added to info objects in one language and retrieved in another.