diff --git a/cs677/hw4/src/transpose.cc b/cs677/hw4/src/transpose.cc index a2abd8e..f97ff5d 100644 --- a/cs677/hw4/src/transpose.cc +++ b/cs677/hw4/src/transpose.cc @@ -93,11 +93,11 @@ int main(int argc, char * argv[]) /* Print the initial matrices */ if (my_rank == 0) cout << " *** Initial Matrices ***" << endl; - for (int i = 0; i < comm_size; i++) + for (int i = 0; i < p; i++) { if (my_rank == i) printMatrix(&matrix[0][0], n, n); - MPI_Barrier(); /* for printint coherently */ + MPI_Barrier(MPI_COMM_WORLD); /* for printint coherently */ } /* Populate the displacements array */ @@ -133,11 +133,11 @@ int main(int argc, char * argv[]) /* Print the transposed matrices */ if (my_rank == 0) cout << " *** Final Transposed Matrices ***" << endl; - for (int i = 0; i < comm_size; i++) + for (int i = 0; i < p; i++) { if (my_rank == i) printMatrix(&matrix[0][0], n, n); - MPI_Barrier(); /* for printint coherently */ + MPI_Barrier(MPI_COMM_WORLD); /* for printint coherently */ } MPI_Finalize();