Changeset 5713 in /cluster/svnroot for bccd-ng/bw-institute/2016/day06/matmul/mpi.c
- Timestamp:
- May 26, 2016 9:06:37 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bccd-ng/bw-institute/2016/day06/matmul/mpi.c
r5712 r5713 12 12 unsigned int start_row,stop_row,stride; 13 13 bool print; 14 struct matrix m1,m2,local_dst_m ;14 struct matrix m1,m2,local_dst_m,dst_m; 15 15 16 16 MPI_Init(&argc,&argv); … … 74 74 init_matrix(&m2,random_seeds); 75 75 76 // Declare and allocate full destination matrix76 // Allocate full destination matrix on first rank 77 77 // Will be populated via MPI_Gather 78 struct matrix dst_m;79 78 dst_m.rows = m1.rows; 80 79 dst_m.cols = m2.cols; … … 135 134 #endif 136 135 136 MPI_Gather( 137 &local_dst_m.matrix, 138 (local_dst_m.cols*local_dst_m.rows), 139 MPI_INT, 140 &dst_m.matrix, 141 (dst_m.cols*dst_m.rows), 142 MPI_INT, 143 FIRST_RANK, 144 MPI_COMM_WORLD 145 ); 146 137 147 MPI_Finalize(); 138 148
Note: See TracChangeset
for help on using the changeset viewer.