Im currently trying to implement a matrix-matrix multiplication using C. I have the following code
for(index=0; index<p; index++)
{
/* calculate the partial sum for matC given the row band of A and
B */
for (i=0; i<n/p; i++)
for (j=0; j<n; j++)
for (k=0; k<n; k++)
storage_matC[i*n+j] += storage_matA[i*n+k]*storage_matB[k*n+j];
if(index < p-1)
{
/* mpi send storage_matB to the next process (id+1)%p */
MPI_Send(storage_matB, n, MPI_FLOAT, (id+1)%p, 0, MPI_COMM_WORLD);
/* mpi receive storage_matB from the previous process */
MPI_Recv(&storage_matB, n, MPI_FLOAT, id, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
}
}
I need to be able to send the matrix_b used in the current process, and then receive it in the current process from the previous process. My program just hangs there and i have to terminate it. Can someone shed me some light on how to approach this problem...
Thank you so much for your time, your help is greatly appreciate it!