/* ************************************************************* */ /* */ /* mat_mat.c */ /* */ /* Created by Andrew Pineda and John Grondalski 8/18/00 */ /* */ /* This program computes, in parallel, the matrix-matrix product */ /* */ /* A=B*C */ /* ************************************************************* */ #include #include #define NCOLS 4 #define NROWS 4 int main(int argc, char **argv) { int i,j,k,l; int ierr, rank, size, root; float A[NROWS][NCOLS]; float Apart[NCOLS]; float Bpart[NCOLS]; float C[NROWS][NCOLS]; float A_exact[NROWS][NCOLS]; float B[NCOLS][NCOLS]; root = 0; /* Initiate MPI. */ ierr=MPI_Init(&argc, &argv); ierr=MPI_Comm_rank(MPI_COMM_WORLD, &rank); ierr=MPI_Comm_size(MPI_COMM_WORLD, &size); /* Initialize B and C. */ if (rank == root) { for(j=0;j