

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


During communication data is:
Rule: type specified by send = type specified by recv = type of variables in the send buffer = type of variables in the recv buffer A code not observing these rules is considered erroneous by MPI. In this case the program behavior is undefined.
Note:
MPI defines the following types: MPI_BYTE - transfers a byte of data unchanged MPI_PACK - data has been packed explicitly No conversion is needed on a homogeneous system. Sending MPI_BYTE-s is correct in MPI, but if the undelying data is typed, and the system is heterogeneous, the meaning (value) of the data is changed. Typed communication is strongly preffered.
Note:
MPI never performs type conversion of data (e.g., round a real to an integer). MPI does perform binary representation conversion of a value in heterogeneopus environments, where different cpus use different representations of this value (e.g., changes byte ordering for little/big endian representations, changes 32-bit fp to 64 bit fp, or changes internal representation of a character, etc.).
Overflow, underflow exceptions may appear during conversion. This results in failed communication and send (or recv) operations return error codes.
Run mpi_TypeConvert.c and assess the incorrect program behavior.
Run mpi_BufferSize.c to estimate how large can the messages be.
Run mpi_BufferUnsafe.c; progressively increase BUFSIZE and different number of processors until the program deadlocks.
The MPI standard does not specify what happens before MPI_Init. In LAM/MPI, a new process is exec/fork-ed for every MPI process (by mpirun), and they all therefore enter via their own main().
Other MPI implementations may differ - it is permissable, for example, to simply fork threads during MPI_Init. In this case, there would likely be only one entry via main, but several "MPI processes" after MPI_Init.