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
also requalify mc version of the tesh
[simgrid.git]
/
teshsuite
/
smpi
/
coll-allreduce-with-leaks
/
coll-allreduce-with-leaks.c
diff --git
a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c
b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c
index b88d897895a1364121651d23fd4d63ecbd7e79ee..c67de826f24fdf54618248659ba865e1e7f84add 100644
(file)
--- a/
teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c
+++ b/
teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.c
@@
-14,8
+14,6
@@
int main(int argc, char *argv[])
{
int rank;
int size;
- int i;
- int status;
MPI_Init(&argc, &argv);
int maxlen = argc >= 2 ? atoi(argv[1]) : 1;
@@
-26,23
+24,22
@@
int main(int argc, char *argv[])
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_set_errhandler(dup, MPI_ERRORS_RETURN);
- int* sb =
xbt_new0(int, size * maxlen
);
- int* rb =
xbt_new0(int, size * maxlen
);
+ int* sb =
(int*)calloc(size * maxlen, sizeof(int)
);
+ int* rb =
(int*)calloc(size * maxlen, sizeof(int)
);
- for (i
= 0; i < size *
maxlen; ++i) {
+ for (i
nt i = 0; i < size *
maxlen; ++i) {
sb[i] = rank*size + i;
rb[i] = 0;
}
-
status = MPI_Allreduce(sb, rb, size *
maxlen, MPI_INT, MPI_SUM, dup);
+
int status = MPI_Allreduce(sb, rb, size *
maxlen, MPI_INT, MPI_SUM, dup);
if (rank == 0 && status != MPI_SUCCESS) {
printf("all_to_all returned %d\n", status);
fflush(stdout);
}
- //Do not free dup
- xbt_free(sb);
- xbt_free(rb);
+ //Do not free dup and rb
+ free(sb);
MPI_Finalize();
return (EXIT_SUCCESS);
}