4 smpi_coll_tuned_bcast_flattree(void *buff, int count, MPI_Datatype data_type,
5 int root, MPI_Comm comm)
10 int i, rank, num_procs;
13 MPI_Comm_rank(comm, &rank);
14 MPI_Comm_size(comm, &num_procs);
17 MPI_Recv(buff, count, data_type, root, tag, comm, MPI_STATUS_IGNORE);
21 reqs = (MPI_Request *) malloc((num_procs - 1) * sizeof(MPI_Request));
24 // Root sends data to all others
25 for (i = 0; i < num_procs; i++) {
28 MPI_Isend(buff, count, data_type, i, tag, comm, req_ptr++);
31 // wait on all requests
32 MPI_Waitall(num_procs - 1, reqs, MPI_STATUSES_IGNORE);