X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e7c0c67af63b3979a597a66e5e1c8b0435fc6e19..1687df79d61a9418bba830bbd0ab7de16e457090:/src/smpi/colls/reduce-flat-tree.c diff --git a/src/smpi/colls/reduce-flat-tree.c b/src/smpi/colls/reduce-flat-tree.c index 7d178e1451..8a3140d5e0 100644 --- a/src/smpi/colls/reduce-flat-tree.c +++ b/src/smpi/colls/reduce-flat-tree.c @@ -1,3 +1,9 @@ +/* Copyright (c) 2013-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "colls_private.h" //#include @@ -6,7 +12,7 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, int root, MPI_Comm comm) { - int i, tag = 4321; + int i, tag = COLL_TAG_REDUCE; int size; int rank; MPI_Aint extent; @@ -29,7 +35,7 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count, messages. */ if (size > 1) - origin = (char *) xbt_malloc(count * extent); + origin = (char *) smpi_get_tmp_recvbuffer(count * extent); /* Initialize the receive buffer. */ @@ -50,12 +56,12 @@ smpi_coll_tuned_reduce_flat_tree(void *sbuf, void *rbuf, int count, } /* Call reduction function. */ - star_reduction(op, inbuf, rbuf, &count, &dtype); + smpi_op_apply(op, inbuf, rbuf, &count, &dtype); } if (origin) - free(origin); + smpi_free_tmp_buffer(origin); /* All done */ return 0;