-/* Copyright (c) 2013-2020. The SimGrid Team.
+/* Copyright (c) 2013-2021. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
/* copy result back into recvbuf */
mpi_errno =
Datatype::copy(tmp_recvbuf, recvcounts[rank], datatype, recvbuf, recvcounts[rank], datatype);
- if (mpi_errno)
+ if (mpi_errno) {
+ delete[] disps;
+ smpi_free_tmp_buffer(tmp_recvbuf);
return (mpi_errno);
+ }
}
else {
if (op != MPI_OP_NULL)
/* copy result back into recvbuf */
mpi_errno = Datatype::copy(tmp_recvbuf, recvcounts[rank], datatype,
((char*)recvbuf + disps[rank] * extent), recvcounts[rank], datatype);
- if (mpi_errno)
+ if (mpi_errno) {
+ delete[] disps;
+ smpi_free_tmp_buffer(tmp_recvbuf);
return (mpi_errno);
+ }
}
}
}
recvcounts[rank], datatype,
recvbuf,
recvcounts[rank], datatype );
- if (mpi_errno) return(mpi_errno);
+ if (mpi_errno) {
+ delete[] disps;
+ smpi_free_tmp_buffer(tmp_recvbuf);
+ return (mpi_errno);
+ }
}
delete[] disps;
else
mpi_errno = Datatype::copy(recvbuf, total_count, datatype, tmp_results, total_count, datatype);
- if (mpi_errno)
+ if (mpi_errno) {
+ delete[] disps;
return (mpi_errno);
+ }
mask = 0x1;
i = 0;