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
[SMPI] NULL -> nullptr substitution
[simgrid.git]
/
src
/
smpi
/
smpi_topo.cpp
diff --git
a/src/smpi/smpi_topo.cpp
b/src/smpi/smpi_topo.cpp
index
16b8cfa
..
9ede661
100644
(file)
--- a/
src/smpi/smpi_topo.cpp
+++ b/
src/smpi/smpi_topo.cpp
@@
-45,7
+45,7
@@
typedef struct s_smpi_mpi_topology {
} s_smpi_mpi_topology_t;
void smpi_topo_destroy(MPI_Topology topo) {
} s_smpi_mpi_topology_t;
void smpi_topo_destroy(MPI_Topology topo) {
- if(topo ==
NULL
) {
+ if(topo ==
nullptr
) {
return;
}
switch (topo->kind) {
return;
}
switch (topo->kind) {
@@
-79,15
+79,15
@@
MPI_Topology smpi_topo_create(MPIR_Topo_type kind) {
void smpi_cart_topo_destroy(MPIR_Cart_Topology cart) {
if (cart) {
if(cart->dims) {
void smpi_cart_topo_destroy(MPIR_Cart_Topology cart) {
if (cart) {
if(cart->dims) {
- free(cart->dims);
+
xbt_
free(cart->dims);
}
if(cart->periodic) {
}
if(cart->periodic) {
- free(cart->periodic);
+
xbt_
free(cart->periodic);
}
if(cart->position) {
}
if(cart->position) {
- free(cart->position);
+
xbt_
free(cart->position);
}
}
- free(cart);
+
xbt_
free(cart);
}
}
}
}
@@
-132,9
+132,6
@@
int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], int periods[]
newCart->topo.cart->nnodes = newSize;
newCart->topo.cart->nnodes = newSize;
- /* memcpy(newCart->topo.cart->dims, dims, ndims * sizeof(*newCart->topo.cart->dims)); */
- /* memcpy(newCart->topo.cart->periodic, periods, ndims * sizeof(*newCart->topo.cart->periodic)); */
-
// FIXME : code duplication... See smpi_mpi_cart_coords
nranks = newSize;
for (i=0; i<ndims; i++) {
// FIXME : code duplication... See smpi_mpi_cart_coords
nranks = newSize;
for (i=0; i<ndims; i++) {
@@
-161,14
+158,15
@@
int smpi_mpi_cart_create(MPI_Comm comm_old, int ndims, int dims[], int periods[]
int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm) {
MPI_Topology oldTopo = smpi_comm_topo(comm);
int oldNDims = oldTopo->topo.cart->ndims;
int smpi_mpi_cart_sub(MPI_Comm comm, const int remain_dims[], MPI_Comm *newcomm) {
MPI_Topology oldTopo = smpi_comm_topo(comm);
int oldNDims = oldTopo->topo.cart->ndims;
- int i, j = 0, newNDims, *newDims =
NULL, *newPeriodic = NULL
;
+ int i, j = 0, newNDims, *newDims =
nullptr, *newPeriodic = nullptr
;
- if (remain_dims ==
NULL
&& oldNDims != 0) {
+ if (remain_dims ==
nullptr
&& oldNDims != 0) {
return MPI_ERR_ARG;
}
newNDims = 0;
for (i = 0 ; i < oldNDims ; i++) {
return MPI_ERR_ARG;
}
newNDims = 0;
for (i = 0 ; i < oldNDims ; i++) {
- if (remain_dims[i]) newNDims++;
+ if (remain_dims[i])
+ newNDims++;
}
if (newNDims > 0) {
}
if (newNDims > 0) {
@@
-236,7
+234,8
@@
int smpi_mpi_cart_rank(MPI_Comm comm, int* coords, int* rank) {
} else if (coord < 0) {
if(topo->topo.cart->periodic[i]) {
coord = coord % topo->topo.cart->dims[i];
} else if (coord < 0) {
if(topo->topo.cart->periodic[i]) {
coord = coord % topo->topo.cart->dims[i];
- if (coord) coord = topo->topo.cart->dims[i] + coord;
+ if (coord)
+ coord = topo->topo.cart->dims[i] + coord;
} else {
*rank = -1;
return MPI_ERR_ARG;
} else {
*rank = -1;
return MPI_ERR_ARG;
@@
-424,7
+423,7
@@
assignnodes(int ndim, int nfactor, int *pfacts, int **pdims)
/* Allocate and initialize the bins */
bins = (int *) malloc((unsigned) ndim * sizeof(int));
/* Allocate and initialize the bins */
bins = (int *) malloc((unsigned) ndim * sizeof(int));
- if (
NULL
== bins) {
+ if (
nullptr
== bins) {
return MPI_ERR_NO_MEM;
}
*pdims = bins;
return MPI_ERR_NO_MEM;
}
*pdims = bins;
@@
-477,7
+476,7
@@
static int getfactors(int num, int *nfactors, int **factors) {
if(num < 2) {
(*nfactors) = 0;
if(num < 2) {
(*nfactors) = 0;
- (*factors) =
NULL
;
+ (*factors) =
nullptr
;
return MPI_SUCCESS;
}
/* Allocate the array of prime factors which cannot exceed log_2(num) entries */
return MPI_SUCCESS;
}
/* Allocate the array of prime factors which cannot exceed log_2(num) entries */