Tree Structured Communication
int* source_ptr /* out */) {
/* 2^stage = 1 << stage */
power_2_stage = 1 << stage;
if ((power_2_stage <= my_rank) &&
(my_rank < 2*power_2_stage)){
*source_ptr = my_rank - power_2_stage;
MPI_Recv(a_ptr, 1, MPI_FLOAT, source, 0,
MPI_COMM_WORLD, &status);
MPI_Recv(b_ptr, 1, MPI_FLOAT, source, 1,
MPI_COMM_WORLD, &status);
MPI_Recv(n_ptr, 1, MPI_INT, source, 2,
MPI_COMM_WORLD, &status);