High Performance Computing 1
MPI Messages
•In this code process 0 uses MPI_Pack to copy a to buffer and
•then append b and n. After the broadcast of buffer,  the remaining processes
•use MPI_Unpack to extract a, b, and n from the buffer. The datatype for the
•calls to MPI_Bcast is MPI_PACKED.
•The syntax is
•
•int MPI_Pack(void* pack_data, int in_count, MPI_Datatype datatype,
•   void* buffer, int size, int* position_ptr, MPI_Comm comm)
•
•
•int MPI_Unpack(void* buffer, int size, int* position_ptr, void* unpack_data, int count, MPI_Datatype datatype, MPI_comm comm)
•
•