A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove another bunch of const_casts.
[simgrid.git]
/
src
/
smpi
/
colls
/
gather
/
gather-ompi.cpp
diff --git
a/src/smpi/colls/gather/gather-ompi.cpp
b/src/smpi/colls/gather/gather-ompi.cpp
index
4510e08
..
1546bd3
100644
(file)
--- a/
src/smpi/colls/gather/gather-ompi.cpp
+++ b/
src/smpi/colls/gather/gather-ompi.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2013-201
7
. The SimGrid Team.
+/* Copyright (c) 2013-201
9
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-25,7
+25,7
@@
namespace simgrid{
namespace smpi{
namespace simgrid{
namespace smpi{
-int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_gather_ompi_binomial::gather(
const
void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
MPI_Datatype rdtype, int root, MPI_Comm comm)
{
int line = -1;
MPI_Datatype rdtype, int root, MPI_Comm comm)
{
int line = -1;
@@
-181,7
+181,7
@@
int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
/* other non-leaf nodes */
smpi_free_tmp_buffer(tempbuf);
}
/* other non-leaf nodes */
smpi_free_tmp_buffer(tempbuf);
}
-
xbt_free(
bmtree);
+
ompi_coll_tuned_topo_destroy_tree(&
bmtree);
return MPI_SUCCESS;
err_hndl:
return MPI_SUCCESS;
err_hndl:
@@
-199,7
+199,7
@@
int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
* Accepts: - same arguments as MPI_Gather(), first segment size
* Returns: - MPI_SUCCESS or error code
*/
* Accepts: - same arguments as MPI_Gather(), first segment size
* Returns: - MPI_SUCCESS or error code
*/
-int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
+int Coll_gather_ompi_linear_sync::gather(
const
void *sbuf, int scount,
MPI_Datatype sdtype,
void *rbuf, int rcount,
MPI_Datatype rdtype,
MPI_Datatype sdtype,
void *rbuf, int rcount,
MPI_Datatype rdtype,
@@
-247,7
+247,7
@@
int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
first_segment_count = scount;
COLL_TUNED_COMPUTED_SEGCOUNT((size_t)first_segment_size, typelng, first_segment_count);
first_segment_count = scount;
COLL_TUNED_COMPUTED_SEGCOUNT((size_t)first_segment_size, typelng, first_segment_count);
- Request::recv(
sbuf
, 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE);
+ Request::recv(
nullptr
, 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE);
Request::send(sbuf, first_segment_count, sdtype, root, COLL_TAG_GATHER, comm);
Request::send(sbuf, first_segment_count, sdtype, root, COLL_TAG_GATHER, comm);
@@
-266,8
+266,8
@@
int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
- Waitall for all the second segments to complete.
*/
char* ptmp;
- Waitall for all the second segments to complete.
*/
char* ptmp;
- MPI_Request
*reqs = NULL,
first_segment_req;
-
reqs = (MPI_Request*)calloc(size, sizeof(MPI_Request))
;
+ MPI_Request first_segment_req;
+
MPI_Request* reqs = new (std::nothrow) MPI_Request[size]
;
if (NULL == reqs) {
ret = -1;
line = __LINE__;
if (NULL == reqs) {
ret = -1;
line = __LINE__;
@@
-319,7
+319,7
@@
int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
ret = Request::waitall(size, reqs, MPI_STATUSES_IGNORE);
if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; }
ret = Request::waitall(size, reqs, MPI_STATUSES_IGNORE);
if (ret != MPI_SUCCESS) { line = __LINE__; goto error_hndl; }
-
free(reqs)
;
+
delete[] reqs
;
}
/* All done */
}
/* All done */
@@
-352,7
+352,7
@@
int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
* Accepts: - same arguments as MPI_Gather()
* Returns: - MPI_SUCCESS or error code
*/
* Accepts: - same arguments as MPI_Gather()
* Returns: - MPI_SUCCESS or error code
*/
-int Coll_gather_ompi_basic_linear::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_gather_ompi_basic_linear::gather(
const
void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
MPI_Datatype rdtype, int root, MPI_Comm comm)
{
int i;
MPI_Datatype rdtype, int root, MPI_Comm comm)
{
int i;