Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rework the doc of model-check/replay, and add an example with sthread
[simgrid.git] / src / smpi / mpi / smpi_topo.cpp
index 93cf8f03be4646c28fa624da47732382cdd1d8ff..48b723dc3c8aabe9f59867bc04bae78397804224 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -16,8 +16,7 @@
 static int assignnodes(int ndim, const std::vector<int>& factors, std::vector<int>& dims);
 static int getfactors(int num, std::vector<int>& factors);
 
-namespace simgrid{
-namespace smpi{
+namespace simgrid::smpi {
 
 void Topo::setComm(MPI_Comm comm)
 {
@@ -63,12 +62,12 @@ Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int p
       position_[i] = rank / nranks;
       rank = rank % nranks;
     }
-    
+
     if(comm_cart != nullptr){
       const Group* oldGroup = comm_old->group();
       auto* newGroup        = new Group(newSize);
       for (int i = 0 ; i < newSize ; i++) {
-        newGroup->set_mapping(oldGroup->actor_pid(i), i);
+        newGroup->set_mapping(oldGroup->actor(i), i);
       }
       *comm_cart = new  Comm(newGroup, std::shared_ptr<Topo>(this));
     }
@@ -320,8 +319,7 @@ int Topo_Cart::Dims_create(int nnodes, int ndims, int dims[])
   return MPI_SUCCESS;
 }
 
-}
-}
+} // namespace simgrid::smpi
 
 /*
  *  assignnodes