-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2021. 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. */
int src_traced = getPid(comm, src);
// FIXME: Hack the way to trace this one
- std::vector<int>* dst_hack = new std::vector<int>();
- std::vector<int>* src_hack = new std::vector<int>();
+ auto dst_hack = std::make_shared<std::vector<int>>();
+ auto src_hack = std::make_shared<std::vector<int>>();
dst_hack->push_back(dst_traced);
src_hack->push_back(src_traced);
TRACE_smpi_comm_in(my_proc_id, __func__,
int size = datatype->get_extent() * count;
xbt_assert(size > 0);
- void* recvbuf = xbt_new0(char, size);
- retval = MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf, count, datatype, src, recvtag, comm, status);
+ std::vector<char> recvbuf(size);
+ retval =
+ MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf.data(), count, datatype, src, recvtag, comm, status);
if(retval==MPI_SUCCESS){
- simgrid::smpi::Datatype::copy(recvbuf, count, datatype, buf, count, datatype);
+ simgrid::smpi::Datatype::copy(recvbuf.data(), count, datatype, buf, count, datatype);
}
- xbt_free(recvbuf);
return retval;
}
*flag=1;
simgrid::smpi::Status::empty(status);
return MPI_SUCCESS;
- } else if (flag==NULL || status ==NULL){
+ } else if (flag == nullptr || status == nullptr) {
return MPI_ERR_ARG;
}
return simgrid::smpi::Request::get_status(request,flag,status);