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
Memory leak--
[simgrid.git]
/
src
/
smpi
/
mpi
/
smpi_topo.cpp
diff --git
a/src/smpi/mpi/smpi_topo.cpp
b/src/smpi/mpi/smpi_topo.cpp
index
710eaaf
..
9a81496
100644
(file)
--- a/
src/smpi/mpi/smpi_topo.cpp
+++ b/
src/smpi/mpi/smpi_topo.cpp
@@
-167,10
+167,8
@@
int Topo_Cart::rank(const int* coords, int* rank) {
return MPI_SUCCESS;
}
return MPI_SUCCESS;
}
-int Topo_Cart::shift(int direction, int disp, int *rank_source, int *rank_dest) {
-
- int* position = new int[ndims_];
-
+int Topo_Cart::shift(int direction, int disp, int* rank_source, int* rank_dest)
+{
if(ndims_ == 0) {
return MPI_ERR_ARG;
}
if(ndims_ == 0) {
return MPI_ERR_ARG;
}
@@
-178,6
+176,7
@@
int Topo_Cart::shift(int direction, int disp, int *rank_source, int *rank_dest)
return MPI_ERR_DIMS;
}
return MPI_ERR_DIMS;
}
+ int* position = new int[ndims_];
this->coords(getComm()->rank(), ndims_, position);
position[direction] += disp;
this->coords(getComm()->rank(), ndims_, position);
position[direction] += disp;