I have problem with broadcasting 2d double array representing 137x137 matrix using MPI_Bcast for more then two processors. Program is written in C and OpenMPI is used. Here is what I am doing:
...
double matrix[138][138] = {0.0};
int myid, numprocs;
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
if(myid==ROOT){
[reading matrix from file to matrix array]
}
MPI_Bcast(matrix, M_SIZE, MPI_DOUBLE, ROOT, MPI_COMM_WORLD);
[some operation i.e. print matrix]
There is no problem when executing for one or two processor, however for 3 and more program suspends. When I tried with one-dimensional array[138] there is no problem at all.
I will be grateful for any helpful information. Thank you!