A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git]
/
examples
/
smpi
/
MM
/
Summa.c
diff --git
a/examples/smpi/MM/Summa.c
b/examples/smpi/MM/Summa.c
index
94588e5
..
12c2370
100644
(file)
--- a/
examples/smpi/MM/Summa.c
+++ b/
examples/smpi/MM/Summa.c
@@
-23,8
+23,11
@@
inline double Summa(
double *B_a , *B_b ; //matrix blocks
size_t err;
//double alpha = 1, beta = 1; //C := alpha * a * b + beta * c
double *B_a , *B_b ; //matrix blocks
size_t err;
//double alpha = 1, beta = 1; //C := alpha * a * b + beta * c
- size_t B_proc_col, B_proc_row; // Number of bloc(row or col) on one processor
+ size_t B_proc_row; // Number of bloc(row or col) on one processor
+#ifndef CYCLIC
+ size_t B_proc_col;
B_proc_col = k_b / Block_size; // Number of block on one processor
B_proc_col = k_b / Block_size; // Number of block on one processor
+#endif
B_proc_row = k_a / Block_size; // Number of block on one processor
//size_t lda = k_a, ldb = n, ldc = n;
B_proc_row = k_a / Block_size; // Number of block on one processor
//size_t lda = k_a, ldb = n, ldc = n;
@@
-122,7
+125,7
@@
inline double Summa(
XBT_DEBUG("position of B_b: %zu \n", pos_b);
}
end_time_intern = MPI_Wtime();
XBT_DEBUG("position of B_b: %zu \n", pos_b);
}
end_time_intern = MPI_Wtime();
- communication_time +=
start_time_intern - end
_time_intern;
+ communication_time +=
end_time_intern - start
_time_intern;
MPI_Barrier(row_comm);
MPI_Barrier(col_comm);
MPI_Barrier(row_comm);
MPI_Barrier(col_comm);
@@
-139,16
+142,16
@@
inline double Summa(
c[i*ldc+j] += B_a[i*lda_local+k]*B_b[k*ldb_local+j];
end_time_intern = MPI_Wtime();
c[i*ldc+j] += B_a[i*lda_local+k]*B_b[k*ldb_local+j];
end_time_intern = MPI_Wtime();
- computation_time +=
start_time_intern - end
_time_intern;
+ computation_time +=
end_time_intern - start
_time_intern;
}
MPI_Barrier(row_comm);
MPI_Barrier(col_comm);
end_time = MPI_Wtime();
}
MPI_Barrier(row_comm);
MPI_Barrier(col_comm);
end_time = MPI_Wtime();
- time =
start_time - end_time
;
- printf("communication time: %le
nano
seconds, "
- "computation time: %le
nano
seconds\n",
+ time =
end_time - start_time
;
+ printf("communication time: %le seconds, "
+ "computation time: %le seconds\n",
communication_time, computation_time);
communication_time, computation_time);