Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Groups: Remove old rank2index map
authorChristian Heinrich <franz-christian.heinrich@inria.fr>
Mon, 4 Jun 2018 09:12:43 +0000 (11:12 +0200)
committerChristian Heinrich <franz-christian.heinrich@inria.fr>
Thu, 21 Jun 2018 09:55:40 +0000 (11:55 +0200)
This was not used anymore, but the index_to_rank map still needs to be
removed; it is still in use and may need a bit more effort.

src/smpi/include/smpi_group.hpp
src/smpi/mpi/smpi_group.cpp

index 3c55ae4..eb56ba4 100644 (file)
@@ -24,7 +24,6 @@ class Group : public F2C{
      */
     std::vector<simgrid::s4u::ActorPtr> rank_to_actor_map_;
     std::map<simgrid::s4u::ActorPtr, int> actor_to_rank_map_;
-    std::vector<int> rank_to_index_map_;
     std::vector<int> index_to_rank_map_;
 
     int refcount_;
index ff759eb..e3eed4d 100644 (file)
@@ -25,7 +25,7 @@ Group::Group()
   refcount_          = 1;       /* refcount_: start > 0 so that this group never gets freed */
 }
 
-Group::Group(int n) : size_(n), rank_to_actor_map_(size_, nullptr), rank_to_index_map_(size_, MPI_UNDEFINED), index_to_rank_map_(size_, MPI_UNDEFINED)
+Group::Group(int n) : size_(n), rank_to_actor_map_(size_, nullptr), index_to_rank_map_(size_, MPI_UNDEFINED)
 {
   refcount_ = 1;
 }
@@ -35,7 +35,7 @@ Group::Group(Group* origin)
   if (origin != MPI_GROUP_NULL && origin != MPI_GROUP_EMPTY) {
     size_              = origin->size();
     refcount_          = 1;
-    rank_to_index_map_ = origin->rank_to_index_map_;
+    // FIXME: cheinrich: There is no such thing as an index any more; the two maps should be removed
     index_to_rank_map_ = origin->index_to_rank_map_;
     rank_to_actor_map_ = origin->rank_to_actor_map_;
     actor_to_rank_map_ = origin->actor_to_rank_map_;
@@ -46,7 +46,6 @@ void Group::set_mapping(simgrid::s4u::ActorPtr actor, int rank)
 {
   if (0 <= rank && rank < size_) {
     int index                = actor->get_pid();
-    rank_to_index_map_[rank] = index;
     if (index != MPI_UNDEFINED) {
       if ((unsigned)index >= index_to_rank_map_.size())
         index_to_rank_map_.resize(index + 1, MPI_UNDEFINED);