/* ******************************************************************* C-DAC Tech Workshop : hyPACK-2013 October 15-18, 2013 Example 4.5 : memory-pack-unpack.c Objective : Pack the different datatype variable on the process 0 & send to other processes & unpack the data on that processes & displayresults Input : The Process with rank 0 reads the three values a, b, and n. format. Output : Process with Rank greater than 1 prints the output values a, b, and n Created : August-2013 E-mail : hpcfte@cdac.in ****************************************************************** */ #include #include #include"mpi.h" #define n_size 6 int main(int argc , char **argv) { int Myrank, Numprocs,iproc; int array[n_size],index=0; float b=1.2; char c='c', buffer[100]; int position; MPI_Status status; /*.....MPI initialization....................................*/ MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD,&Myrank); MPI_Comm_size(MPI_COMM_WORLD,&Numprocs); /*....Read the Input.............................*/ if(Myrank==0) { for(index=0 ; index