-/* Copyright (c) 2013-2019. The SimGrid Team.
+/* Copyright (c) 2013-2020. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "../colls_private.hpp"
namespace simgrid{
namespace smpi{
-int Coll_alltoall_mvapich2_scatter_dest::alltoall(
- void *sendbuf,
- int sendcount,
- MPI_Datatype sendtype,
- void *recvbuf,
- int recvcount,
- MPI_Datatype recvtype,
- MPI_Comm comm)
+int alltoall__mvapich2_scatter_dest(const void *sendbuf,
+ int sendcount,
+ MPI_Datatype sendtype,
+ void *recvbuf,
+ int recvcount,
+ MPI_Datatype recvtype,
+ MPI_Comm comm)
{
int comm_size, i, j;
MPI_Aint sendtype_extent = 0, recvtype_extent = 0;
int mpi_errno=MPI_SUCCESS;
int dst, rank;
- MPI_Request *reqarray;
- MPI_Status *starray;
if (recvcount == 0) return MPI_SUCCESS;
/* FIXME: This should use the memory macros (there are storage
leaks here if there is an error, for example) */
- reqarray= (MPI_Request*)xbt_malloc(2*bblock*sizeof(MPI_Request));
+ MPI_Request* reqarray = new MPI_Request[2 * bblock];
- starray=(MPI_Status *)xbt_malloc(2*bblock*sizeof(MPI_Status));
+ MPI_Status* starray = new MPI_Status[2 * bblock];
for (ii=0; ii<comm_size; ii+=bblock) {
ss = comm_size-ii < bblock ? comm_size-ii : bblock;
}
}
/* --END ERROR HANDLING-- */
- xbt_free(starray);
- xbt_free(reqarray);
+ delete[] starray;
+ delete[] reqarray;
return (mpi_errno);
}