X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bdb4364a05171eee9ee58d3e53318c1218af2028..4e73c03c087fd07184d9ed45224f7fbad24e686e:/src/smpi/include/smpi_group.hpp diff --git a/src/smpi/include/smpi_group.hpp b/src/smpi/include/smpi_group.hpp index 1bb4d1711a..1a008533a1 100644 --- a/src/smpi/include/smpi_group.hpp +++ b/src/smpi/include/smpi_group.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2013-2017. The SimGrid Team. +/* Copyright (c) 2010-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -9,6 +9,7 @@ #include "smpi_f2c.hpp" #include +#include #include namespace simgrid{ @@ -21,17 +22,20 @@ class Group : public F2C{ * std::map here, but looking up a value there costs O(log(n)). * For a vector, this costs O(1). We hence go with the vector. */ - std::vector rank_to_index_map_; + std::vector rank_to_actor_map_; + std::map actor_to_rank_map_; std::vector index_to_rank_map_; + int refcount_; public: explicit Group(); explicit Group(int size); explicit Group(Group* origin); - void set_mapping(int index, int rank); - int index(int rank); + void set_mapping(simgrid::s4u::ActorPtr actor, int rank); int rank(int index); + simgrid::s4u::ActorPtr actor(int rank); + int rank(const simgrid::s4u::ActorPtr process); void ref(); static void unref(MPI_Group group); int size();