/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team.
* All rights reserved. */
-/* This program is xbt_free software; you can redistribute it and/or modify it
+/* 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"
mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].min
||nbytes > mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].max
) {
- tmp_buf = (char *)xbt_malloc( comm_size * recvcount * recvtype_size );
+ tmp_buf = (char *)smpi_get_tmp_sendbuffer( comm_size * recvcount * recvtype_size );
mpi_errno = smpi_datatype_copy((char *)recvbuf,
comm_size*recvcount, recvtype,
(char *)tmp_buf,
mpi_errno = MV2_Alltoall_function(tmp_buf, recvcount, recvtype,
recvbuf, recvcount, recvtype,
comm );
- xbt_free(tmp_buf);
+ smpi_free_tmp_buffer(tmp_buf);
} else {
mpi_errno = MPIR_Alltoall_inplace_MV2(sendbuf, sendcount, sendtype,
recvbuf, recvcount, recvtype,
return (mpi_errno);
}
-
-
int smpi_coll_tuned_allgather_mvapich2(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
#endif
if (two_level_bcast == 1) {
if (!is_contig || !is_homogeneous) {
- tmp_buf=(void *)xbt_malloc(nbytes);
+ tmp_buf=(void *)smpi_get_tmp_sendbuffer(nbytes);
/* position = 0;*/
/* if (rank == root) {*/
/* We are now done with the inter-node phase */
- if (MV2_Bcast_intra_node_function == &MPIR_Knomial_Bcast_intra_node_MV2) {
+
root = INTRA_NODE_ROOT;
- }
+
if (!is_contig || !is_homogeneous) {
mpi_errno = MV2_Bcast_intra_node_function(tmp_buf, nbytes,
recvcnts, datatype,
op, comm);
}
-
+ xbt_free(disps);
return mpi_errno;
}
return (mpi_errno);
}
+void smpi_coll_cleanup_mvapich2(void){
+int i=0;
+if(mv2_alltoall_thresholds_table)
+ xbt_free(mv2_alltoall_thresholds_table[i]);
+xbt_free(mv2_alltoall_thresholds_table);
+xbt_free(mv2_size_alltoall_tuning_table);
+xbt_free(mv2_alltoall_table_ppn_conf);
+
+xbt_free(mv2_gather_thresholds_table);
+if(mv2_allgather_thresholds_table)
+ xbt_free(mv2_allgather_thresholds_table[0]);
+xbt_free(mv2_size_allgather_tuning_table);
+xbt_free(mv2_allgather_table_ppn_conf);
+xbt_free(mv2_allgather_thresholds_table);
+
+xbt_free(mv2_allgatherv_thresholds_table);
+xbt_free(mv2_reduce_thresholds_table);
+xbt_free(mv2_red_scat_thresholds_table);
+xbt_free(mv2_allreduce_thresholds_table);
+xbt_free(mv2_bcast_thresholds_table);
+if(mv2_scatter_thresholds_table)
+ xbt_free(mv2_scatter_thresholds_table[0]);
+xbt_free(mv2_scatter_thresholds_table);
+xbt_free(mv2_size_scatter_tuning_table);
+xbt_free(mv2_scatter_table_ppn_conf);
+}