#define COLL_SETTER(cat, ret, args, args2) \
int(*Colls::cat) args; \
- void Colls::set_##cat(const std::string& name) \
+ void Colls::_XBT_CONCAT(set_, cat)(const std::string& name) \
{ \
- int id = find_coll_description(mpi_coll_##cat##_description, name, #cat); \
- cat = reinterpret_cast<ret(*) args>(mpi_coll_##cat##_description[id].coll); \
+ int id = find_coll_description(_XBT_CONCAT3(mpi_coll_, cat, _description), name, _XBT_STRINGIFY(cat)); \
+ cat = reinterpret_cast<ret(*) args>(_XBT_CONCAT3(mpi_coll_, cat, _description)[id].coll); \
if (cat == nullptr) \
- xbt_die("Collective " #cat " set to nullptr!"); \
+ xbt_die("Collective " _XBT_STRINGIFY(cat) " set to nullptr!"); \
}
namespace simgrid{
Datatype::copy(sendbuf, count, datatype, recvbuf, count, datatype);
// Send/Recv buffers to/from others
- MPI_Request *requests = xbt_new(MPI_Request, size - 1);
- void **tmpbufs = xbt_new(void *, rank);
+ MPI_Request* requests = new MPI_Request[size - 1];
+ unsigned char** tmpbufs = new unsigned char*[rank];
int index = 0;
for (int other = 0; other < rank; other++) {
tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
for(index = 0; index < size-1; index++) {
Request::unref(&requests[index]);
}
- xbt_free(tmpbufs);
- xbt_free(requests);
+ delete[] tmpbufs;
+ delete[] requests;
return MPI_SUCCESS;
}
datatype->extent(&lb, &dataext);
// Send/Recv buffers to/from others
- MPI_Request *requests = xbt_new(MPI_Request, size - 1);
- void **tmpbufs = xbt_new(void *, rank);
+ MPI_Request* requests = new MPI_Request[size - 1];
+ unsigned char** tmpbufs = new unsigned char*[rank];
int index = 0;
for (int other = 0; other < rank; other++) {
tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
for(index = 0; index < size-1; index++) {
Request::unref(&requests[index]);
}
- xbt_free(tmpbufs);
- xbt_free(requests);
+ delete[] tmpbufs;
+ delete[] requests;
return MPI_SUCCESS;
}