-/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2013-2019. 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. */
/* Short or medium size message and power-of-two no. of processes. Use
* recursive doubling algorithm */
-#include "../colls_private.h"
-#include "src/smpi/smpi_status.hpp"
+#include "../colls_private.hpp"
+#include "smpi_status.hpp"
+#include <algorithm>
namespace simgrid{
namespace smpi{
int Coll_allgatherv_mpich_rdb::allgatherv (
- void *sendbuf,
+ const void *sendbuf,
int sendcount,
MPI_Datatype sendtype,
void *recvbuf,
- int *recvcounts,
- int *displs,
+ const int *recvcounts,
+ const int *displs,
MPI_Datatype recvtype,
MPI_Comm comm)
{
recvtype->extent(&recvtype_true_lb, &recvtype_true_extent);
- tmp_buf_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(MAX(recvtype_true_extent,recvtype_extent)));
+ tmp_buf_rl = (void*)smpi_get_tmp_sendbuffer(total_count * std::max(recvtype_true_extent, recvtype_extent));
/* adjust for potential negative lower bound in datatype */
tmp_buf = (void *)((char*)tmp_buf_rl - recvtype_true_lb);