hello i am trying to broadcast some values, but i dont see the function of broadcast happening....the code i had written to broadcast is
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
int rank, size, i, n, num, send;
n=atoi(argv[1]);
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD,&size);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
if(rank==0)
{
num=1234;
send=rank;
MPI_Bcast(&num, 4, MPI_INT, rank, MPI_COMM_WORLD);
MPI_Bcast(&send, 4, MPI_INT, rank, MPI_COMM_WORLD);
printf("broadcasted num : %d send : %d", num, send);
}
printf("\n rank %d : num %d : send %d", rank, num, send);
MPI_Finalize();
return 0;
}