I have to implement a broadcasting algorithm that uses k-ary replication.
void mpi_mbroadcast(int fromp, int multi, int degree, char * from, char * to, int nbytes);
1) fromp is the source processor that holds the message to be broadcast.
2) multi is the length of the data structure that is being copied (the structure to be broadcast is an array of multi entries, the size of each entry being nbytes long).
3) degree is the degree of replication. Each processor in each superstep would send the received message to at most degree - 1 other processors.
4) from is the base address of the first byte that will be broadcast.
5) to is the base address of the first position that will receive the broadcast message.
6) nbytes is the size in bytes of the elementary data type (array element) that is being copied.
I have implemented a program that calculates partial sums and sends the sums to Processor 0. Now I have to implement a program that broadcast sums by k-ary replication.
Link: MPI Summation
How do I use the function above to send and receive data. (I think it is all-to-all broadcast)?