-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2019. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
*/
#include "../colls_private.hpp"
+#include <algorithm>
+
extern int mv2_reduce_intra_knomial_factor;
extern int mv2_reduce_inter_knomial_factor;
/* Finally, fill up the src array */
if(recv_iter > 0) {
- knomial_reduce_src_array = static_cast<int*>(smpi_get_tmp_sendbuffer(sizeof(int)*recv_iter));
+ knomial_reduce_src_array = new int[recv_iter];
}
mask = orig_mask;
is_commutative = (op==MPI_OP_NULL || op->is_commutative());
if (rank != root) {
- recvbuf=(void *)smpi_get_tmp_recvbuffer(count*(MAX(extent,true_extent)));
+ recvbuf = (void*)smpi_get_tmp_recvbuffer(count * std::max(extent, true_extent));
recvbuf = (void *)((char*)recvbuf - true_lb);
}
tmp_buf = static_cast<void**>(xbt_malloc(sizeof(void *)*expected_recv_count));
requests = static_cast<MPI_Request*>(xbt_malloc(sizeof(MPI_Request)*expected_recv_count));
for(k=0; k < expected_recv_count; k++ ) {
- tmp_buf[k] = smpi_get_tmp_sendbuffer(count*(MAX(extent,true_extent)));
+ tmp_buf[k] = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
tmp_buf[k] = (void *)((char*)tmp_buf[k] - true_lb);
}
}
if(src_array != NULL) {
- xbt_free(src_array);
+ delete[] src_array;
}
if(rank != root) {