+/* 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"
/*****************************************************************************
// local int variables
int src, dst, rank, num_procs, count, remainder;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
int pof2 = 1;
// local string variables
count = recv_count;
- tmp_buff = (char *) xbt_malloc(num_procs * recv_count * recv_extent);
+ tmp_buff = (char *) smpi_get_tmp_sendbuffer(num_procs * recv_count * recv_extent);
// perform a local copy
smpi_datatype_copy(send_ptr, send_count, send_type,
smpi_mpi_sendrecv(tmp_buff + (num_procs - rank) * recv_count * recv_extent,
rank * recv_count, recv_type, rank, tag, recv_ptr,
rank * recv_count, recv_type, rank, tag, comm, &status);
- free(tmp_buff);
+ smpi_free_tmp_buffer(tmp_buff);
return MPI_SUCCESS;
}