Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics : I activated -pedantic for a quick pass
[simgrid.git] / src / smpi / mpi / smpi_topo.cpp
index 3376a52..710eaaf 100644 (file)
@@ -169,7 +169,7 @@ int Topo_Cart::rank(const int* coords, int* rank) {
 
 int Topo_Cart::shift(int direction, int disp, int *rank_source, int *rank_dest) {
 
-  int position[ndims_];
+  int* position = new int[ndims_];
 
   if(ndims_ == 0) {
     return MPI_ERR_ARG;
@@ -204,7 +204,7 @@ int Topo_Cart::shift(int direction, int disp, int *rank_source, int *rank_dest)
   } else {
     this->rank(position, rank_source);
   }
-
+  delete[] position;
   return MPI_SUCCESS;
 }