OpenMPI: Using MPI_Pack and MPI_Unpack to pack heterogeneous data
- 11 June, 2006 //
- google SoC, informática //
- Tags :
- 0 Comments
I have written a little example of how to use MPI_Pack and MPI_Unpack to pack heterogeneuos data types and transmit them along the MPI universe of processes. With these two MPI routines, data of different types can be stored as bytes in a char * buffer and sent along the network. Receiving processes just use unpack to recover the data in its original state.
The example can be downloaded PackTest.
I compiled it using OpenMPI, but I think it will run in any MPI implementation.
In order to compile
$ mpicc packtest.c -o packtest
In order to run
$ mpirun -np 10 packtest