+/* 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 <star-reduction.c>
extent = smpi_datatype_get_extent(datatype);
- tmp_buf = (void *) xbt_malloc(count * extent);
+ tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
int is_commutative = smpi_op_is_commute(op);
mask = 1;
/* If I'm not the root, then my recvbuf may not be valid, therefore
I have to allocate a temporary one */
if (rank != root) {
- recvbuf = (void *) malloc(count*(max(extent,true_extent)));
+ recvbuf = (void *) smpi_get_tmp_recvbuffer(count*(max(extent,true_extent)));
recvbuf = (void *)((char*)recvbuf - true_lb);
}
if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
}
if (rank != root) {
- xbt_free(recvbuf);
+ smpi_free_tmp_buffer(recvbuf);
}
- free(tmp_buf);
+ smpi_free_tmp_buffer(tmp_buf);
return 0;
}