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] Move a map in smpi::Group from array to std::vector
[simgrid.git]
/
src
/
smpi
/
include
/
smpi_group.hpp
diff --git
a/src/smpi/include/smpi_group.hpp
b/src/smpi/include/smpi_group.hpp
index
4637dea
..
ca6ad34
100644
(file)
--- a/
src/smpi/include/smpi_group.hpp
+++ b/
src/smpi/include/smpi_group.hpp
@@
-16,7
+16,11
@@
namespace smpi{
class Group : public F2C{
private:
int size_;
class Group : public F2C{
private:
int size_;
- int *rank_to_index_map_;
+ /* This is actually a map from int to int. We could use
+ * 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<int> rank_to_index_map_;
std::unordered_map<int, int> index_to_rank_map_;
int refcount_;
public:
std::unordered_map<int, int> index_to_rank_map_;
int refcount_;
public: